Merge "Allow getResponseCode to block if response hasn't been received from remote" am: 834e5ce170 am: b987832918

am: 3cc3bd3f93

Change-Id: I8c045b24679ae05ffa804e89bf2b2eb842637fd3
This commit is contained in:
Ajay Panicker
2016-08-22 21:06:35 +00:00
committed by android-build-merger

View File

@@ -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();
}
}