summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/LauncherModel.java
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2010-10-07 14:37:40 -0400
committerJoe Onorato <joeo@google.com>2010-10-07 14:37:40 -0400
commitcec583352cd76bd4319d56beec03a4820a3e9d58 (patch)
tree788e93bf13fdfae2a1ad40a01f5e6cdb597e973e /src/com/android/launcher2/LauncherModel.java
parentfc223d969b62e5269351cabede7f10738d643e24 (diff)
downloadandroid_packages_apps_Trebuchet-cec583352cd76bd4319d56beec03a4820a3e9d58.tar.gz
android_packages_apps_Trebuchet-cec583352cd76bd4319d56beec03a4820a3e9d58.tar.bz2
android_packages_apps_Trebuchet-cec583352cd76bd4319d56beec03a4820a3e9d58.zip
When the SD card comes back, we need to show the apps on it.
The problem was that we were doing startLoader, but once the apps are loaded, all that does is re-bind everything. Before a recent change of mine, we were clearing mWorkspaceLoaded and mAllAppsLoaded. But that's not good either, because it meant that there needed to be a lock that the main thread and the worker thread were both acquiring, which was causing ANRs. Instead, now we schedule two messages - one to add the apps back into the list, and one to update everything to use those new icons. Bug: 3065061 Change-Id: If9d36d4b55a7ba72fcf48a5ed8941bb9466bebe6
Diffstat (limited to 'src/com/android/launcher2/LauncherModel.java')
-rw-r--r--src/com/android/launcher2/LauncherModel.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java
index 0978499a9..ee61a919e 100644
--- a/src/com/android/launcher2/LauncherModel.java
+++ b/src/com/android/launcher2/LauncherModel.java
@@ -340,8 +340,10 @@ public class LauncherModel extends BroadcastReceiver {
}
} else if (Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(action)) {
- // When everything comes back, just reload everything. We might not
- // have the right icons for apps on external storage.
+ // First, schedule to add these apps back in.
+ String[] packages = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
+ enqueuePackageUpdated(new PackageUpdatedTask(PackageUpdatedTask.OP_ADD, packages));
+ // Then, rebind everything.
startLoader(mApp, false);
} else if (Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(action)) {