summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java b/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java
index 97a9659c70fb..e2ee2637f6ff 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java
@@ -102,6 +102,7 @@ class BackgroundTaskLoader implements Runnable {
Bitmap mDefaultThumbnail;
BitmapDrawable mDefaultIcon;
+ boolean mStarted;
boolean mCancelled;
boolean mWaitingOnLoadQueue;
@@ -121,16 +122,21 @@ class BackgroundTaskLoader implements Runnable {
android.os.Process.THREAD_PRIORITY_BACKGROUND);
mLoadThread.start();
mLoadThreadHandler = new Handler(mLoadThread.getLooper());
- mLoadThreadHandler.post(this);
}
/** Restarts the loader thread */
void start(Context context) {
mContext = context;
mCancelled = false;
- // Notify the load thread to start loading
- synchronized(mLoadThread) {
- mLoadThread.notifyAll();
+ if (!mStarted) {
+ // Start loading on the load thread
+ mStarted = true;
+ mLoadThreadHandler.post(this);
+ } else {
+ // Notify the load thread to start loading again
+ synchronized (mLoadThread) {
+ mLoadThread.notifyAll();
+ }
}
}