From 0d376053747615ac7c4b45ab7810329ffbdf80d1 Mon Sep 17 00:00:00 2001 From: Kim Schulz Date: Thu, 22 Aug 2013 11:18:02 +0200 Subject: 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 --- obex/javax/obex/ClientOperation.java | 11 +++++++++-- obex/javax/obex/ServerSession.java | 8 ++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'obex') diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java index 294b50240daf..0c65283a5ea5 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 a4b9759588a4..f1b9a0d6c4d6 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(); } /** -- cgit v1.2.3