Commit 90398c58 by eguven Committed by Oliver Woodman

Check if thread is interrupted before opening connection

On an old version of okhttp, opening connection clears the thread interrupt flag silently. This is a workaround
to reduce the effect of the bug.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161784435
parent 70c5bf70
......@@ -228,6 +228,9 @@ public final class CacheUtil {
priorityTaskManager.proceed(priority);
}
try {
if (Thread.interrupted()) {
throw new InterruptedException();
}
// Create a new dataSpec setting length to C.LENGTH_UNSET to prevent getting an error in
// case the given length exceeds the end of input.
dataSpec = new DataSpec(dataSpec.uri, dataSpec.postBody, absoluteStreamPosition,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment