diff options
author | Ajay Panicker <apanicke@google.com> | 2016-08-08 17:16:50 -0700 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2016-08-22 18:25:14 +0000 |
commit | f8c2ad085b5380ec226ba12b808511cf519e6ce6 (patch) | |
tree | 685b8365df3e72f3116b7bd65544c99460c5890c /obex/javax | |
parent | 53ff75bb68ccfaeb441dc41d57509635b0ab0f14 (diff) |
Allow getResponseCode to block if response hasn't been received from remote
Bug: 30645605
Change-Id: I9854ccbe98ace6d5490cb99586ca36379f5a1db1
Diffstat (limited to 'obex/javax')
-rw-r--r-- | obex/javax/obex/ClientOperation.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/obex/javax/obex/ClientOperation.java b/obex/javax/obex/ClientOperation.java index eb7e28040d22..c627dfb8abac 100644 --- a/obex/javax/obex/ClientOperation.java +++ b/obex/javax/obex/ClientOperation.java @@ -207,7 +207,6 @@ public final class ClientOperation implements Operation, BaseStream { * object */ public synchronized int getResponseCode() throws IOException { - //avoid dup validateConnection if ((mReplyHeader.responseCode == -1) || (mReplyHeader.responseCode == ResponseCodes.OBEX_HTTP_CONTINUE)) { validateConnection(); @@ -423,8 +422,9 @@ public final class ClientOperation implements Operation, BaseStream { private void validateConnection() throws IOException { ensureOpen(); - // to sure only one privateInput object exist. - if (mPrivateInput == null) { + // Make sure that a response has been recieved from remote + // before continuing + if (mPrivateInput == null || mReplyHeader.responseCode == -1) { startProcessing(); } } |