Remove main looper assertions and attempts to run tests in main thread.
It looks like if we pass timeout_msec 300000 main thread is then
blocked. If we ever post a runnable to it synchronously in test, we'll
get a deadlock.
Change-Id: I7bd4ce2aaa1ffad72b83a343ff3331179896bd78
diff --git a/src/com/android/documentsui/ThumbnailCache.java b/src/com/android/documentsui/ThumbnailCache.java
index ee2f168..ecde685 100644
--- a/src/com/android/documentsui/ThumbnailCache.java
+++ b/src/com/android/documentsui/ThumbnailCache.java
@@ -22,7 +22,6 @@
import android.graphics.Bitmap;
import android.graphics.Point;
import android.net.Uri;
-import android.os.Looper;
import android.util.LruCache;
import android.util.Pair;
import android.util.Pools;
@@ -196,8 +195,7 @@
private static Result obtain(@Status int status, @Nullable Bitmap thumbnail,
@Nullable Point size, long lastModified) {
- // Make sure this method is only called from main thread.
- assert(Looper.myLooper() == Looper.getMainLooper());
+ Shared.checkMainLoop();
Result instance = sPool.acquire();
instance = (instance != null ? instance : new Result());
@@ -213,8 +211,7 @@
private Result() {}
public void recycle() {
- // Make sure this method is only called from main thread.
- assert(Looper.myLooper() == Looper.getMainLooper());
+ Shared.checkMainLoop();
mStatus = -1;
mThumbnail = null;