[android] - workaround Android O OkHttp bug.
This commit is contained in:
@@ -85,7 +85,14 @@ class HTTPRequest implements Callback {
|
||||
}
|
||||
mRequest = builder.build();
|
||||
mCall = mClient.newCall(mRequest);
|
||||
mCall.enqueue(this);
|
||||
|
||||
// TODO remove code block for workaround in #10303
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N_MR1) {
|
||||
mCall.enqueue(this);
|
||||
} else {
|
||||
// Calling execute instead of enqueue is a workaround for #10303
|
||||
onResponse(mCall, mCall.execute());
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
onFailure(exception);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user