summaryrefslogtreecommitdiffstats
path: root/obex
diff options
context:
space:
mode:
authorKim Schulz <k.schulz@samsung.com>2013-08-22 11:18:02 +0200
committerZhihai Xu <zhihaixu@google.com>2013-09-12 19:07:28 -0700
commit0d376053747615ac7c4b45ab7810329ffbdf80d1 (patch)
treee8cb64bc4a5e37fe689164075dd9843162cc0e3b /obex
parent11f2b42d8c185ac91db07a539605cba7ecd28e6a (diff)
downloadframeworks_base-0d376053747615ac7c4b45ab7810329ffbdf80d1.zip
frameworks_base-0d376053747615ac7c4b45ab7810329ffbdf80d1.tar.gz
frameworks_base-0d376053747615ac7c4b45ab7810329ffbdf80d1.tar.bz2
Fixed review comments
- fixed review comments (internal+google) - corrected tabs/spaces - Add connection id header for obex client operations - added support for implementing ProfileService class Change-Id: Idab8b4fa54a0f31bec4ffa263a69a9850a07f858 Bug:10692365
Diffstat (limited to 'obex')
-rw-r--r--obex/javax/obex/ClientOperation.java11
-rw-r--r--obex/javax/obex/ServerSession.java8
2 files changed, 15 insertions, 4 deletions
diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java
index 294b502..0c65283 100644
--- a/obex/javax/obex/ClientOperation.java
+++ b/obex/javax/obex/ClientOperation.java
@@ -121,6 +121,13 @@ public final class ClientOperation implements Operation, BaseStream {
(header).mAuthResp.length);
}
+
+ if ((header).mConnectionID != null) {
+ mRequestHeader.mConnectionID = new byte[4];
+ System.arraycopy((header).mConnectionID, 0, mRequestHeader.mConnectionID, 0,
+ 4);
+
+ }
}
/**
@@ -420,7 +427,7 @@ public final class ClientOperation implements Operation, BaseStream {
//split the headerArray
end = ObexHelper.findHeaderEnd(headerArray, start, mMaxPacketSize
- ObexHelper.BASE_PACKET_LENGTH);
- // can not split
+ // can not split
if (end == -1) {
mOperationDone = true;
abort();
@@ -521,7 +528,7 @@ public final class ClientOperation implements Operation, BaseStream {
return false;
}
- // send all of the output data in 0x48,
+ // send all of the output data in 0x48,
// send 0x49 with empty body
if ((mPrivateOutput != null) && (mPrivateOutput.size() > 0))
returnValue = true;
diff --git a/obex/javax/obex/ServerSession.java b/obex/javax/obex/ServerSession.java
index a4b9759..f1b9a0d 100644
--- a/obex/javax/obex/ServerSession.java
+++ b/obex/javax/obex/ServerSession.java
@@ -256,6 +256,10 @@ public final class ServerSession extends ObexSession implements Runnable {
public void sendResponse(int code, byte[] header) throws IOException {
int totalLength = 3;
byte[] data = null;
+ OutputStream op = mOutput;
+ if (op == null) {
+ return;
+ }
if (header != null) {
totalLength += header.length;
@@ -270,8 +274,8 @@ public final class ServerSession extends ObexSession implements Runnable {
data[1] = (byte)0x00;
data[2] = (byte)totalLength;
}
- mOutput.write(data);
- mOutput.flush();
+ op.write(data);
+ op.flush();
}
/**