Merge "Defer deleting a http cache"
This commit is contained in:
@@ -155,17 +155,20 @@ public final class DirectStatementService extends Service {
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
if (mThread != null) {
|
final HttpResponseCache responseCache = mHttpResponseCache;
|
||||||
mThread.quit();
|
mHandler.post(new Runnable() {
|
||||||
}
|
public void run() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (mHttpResponseCache != null) {
|
if (responseCache != null) {
|
||||||
mHttpResponseCache.delete();
|
responseCache.delete();
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.i(TAG, "HTTP(S) response cache deletion failed:" + e);
|
Log.i(TAG, "HTTP(S) response cache deletion failed:" + e);
|
||||||
}
|
}
|
||||||
|
Looper.myLooper().quit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mHttpResponseCache = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user