summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSravan Voleti <sravankumar@codeaurora.org>2018-11-02 10:44:32 +0530
committerSravan Voleti <sravankumar@codeaurora.org>2019-01-24 16:30:30 +0530
commit8bdf431f0d5c49ab17b93a1d5b4c772ba4fee54c (patch)
tree947bc629e111ac5c48af33e9fda3635192b6e352
parent6ffda879f23648c8b432c94ef15ee3a8bf3545be (diff)
OBEX: Update Client GET Request as per GOEP2.1 Spec.
Ensure final bit is set for last GET request packet containing headers and all subsequent GET request packets are also set final bit until operation is complete. CRs-Fixed: 2386647 Change-Id: Ic4cf8956af21a71ce907f8b92e58cf6f30371167
-rw-r--r--obex/javax/obex/ClientOperation.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java
index d090bf5cb479..65e2140df256 100644
--- a/obex/javax/obex/ClientOperation.java
+++ b/obex/javax/obex/ClientOperation.java
@@ -460,6 +460,7 @@ public final class ClientOperation implements Operation, BaseStream {
> mMaxPacketSize) {
int end = 0;
int start = 0;
+ int processedLen = 0;
// split & send the headerArray in multiple packets.
while (end != headerArray.length) {
@@ -486,10 +487,17 @@ public final class ClientOperation implements Operation, BaseStream {
byte[] sendHeader = new byte[end - start];
System.arraycopy(headerArray, start, sendHeader, 0, sendHeader.length);
+ processedLen += sendHeader.length;
+ opCode = (processedLen == headerArray.length) ? ObexHelper.OBEX_OPCODE_GET_FINAL
+ : ObexHelper.OBEX_OPCODE_GET;
+ //Set GET FINAL (0x83) for Last Request Header packet as per GOEP2.1
if (!mParent.sendRequest(opCode, sendHeader, mReplyHeader, mPrivateInput, false)) {
return false;
}
-
+ if (mReplyHeader.responseCode == ResponseCodes.OBEX_HTTP_OK) {
+ Log.i(TAG, "sendRequest return OBEX_HTTP_OK");
+ return true;
+ }
if (mReplyHeader.responseCode != ResponseCodes.OBEX_HTTP_CONTINUE) {
return false;
}