Binding AllApps synchronously. (Bug 6855061)

- Also ensuring that we restore to the settling page index if it is in motion

Change-Id: I9c6760383113f7614f6cb962ab6562b0e7eb7138
This commit is contained in:
Winson Chung
2012-07-24 23:56:21 -07:00
committed by Adam Cohen
parent 1462de39f0
commit c93e5ae120
6 changed files with 76 additions and 51 deletions
+8 -2
View File
@@ -1686,7 +1686,7 @@ public class LauncherModel extends BroadcastReceiver {
@SuppressWarnings("unchecked")
final ArrayList<ApplicationInfo> list
= (ArrayList<ApplicationInfo>) mAllAppsList.data.clone();
mHandler.post(new Runnable() {
Runnable r = new Runnable() {
public void run() {
final long t = SystemClock.uptimeMillis();
final Callbacks callbacks = tryGetCallbacks(oldCallbacks);
@@ -1698,7 +1698,13 @@ public class LauncherModel extends BroadcastReceiver {
+ (SystemClock.uptimeMillis()-t) + "ms");
}
}
});
};
boolean isRunningOnMainThread = !(sWorkerThread.getThreadId() == Process.myTid());
if (oldCallbacks.isAllAppsVisible() && isRunningOnMainThread) {
r.run();
} else {
mHandler.post(r);
}
}
private void loadAllAppsByBatch() {