diff options
author | Winson Chung <winsonc@google.com> | 2014-01-08 22:05:47 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-01-08 22:05:47 +0000 |
commit | 872e70e0b648af572f660c2b432786ac63545e4c (patch) | |
tree | d39eea43813d21f049754f03afd5e1001736a2ae | |
parent | 155f3bc69b79009c95dfd34aed4db6580ad15e27 (diff) | |
parent | 3ee4a474f2a1a76682b1b1ec261d6c68f3b7349d (diff) | |
download | android_packages_apps_Trebuchet-872e70e0b648af572f660c2b432786ac63545e4c.tar.gz android_packages_apps_Trebuchet-872e70e0b648af572f660c2b432786ac63545e4c.tar.bz2 android_packages_apps_Trebuchet-872e70e0b648af572f660c2b432786ac63545e4c.zip |
Merge "Accounting for new Package event extras when updating forward-locked apps. (Bug 11855584)" into jb-ub-now-kermit
-rw-r--r-- | src/com/android/launcher3/LauncherModel.java | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index b4f7f5dbd..b2cfb2456 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -1088,15 +1088,29 @@ public class LauncherModel extends BroadcastReceiver { } } else if (Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(action)) { - // First, schedule to add these apps back in. + final boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING, false); String[] packages = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST); - enqueuePackageUpdated(new PackageUpdatedTask(PackageUpdatedTask.OP_ADD, packages)); - // Then, rebind everything. - startLoaderFromBackground(); + if (!replacing) { + enqueuePackageUpdated(new PackageUpdatedTask(PackageUpdatedTask.OP_ADD, packages)); + if (mAppsCanBeOnRemoveableStorage) { + // Only rebind if we support removable storage. It catches the case where + // apps on the external sd card need to be reloaded + startLoaderFromBackground(); + } + } else { + // If we are replacing then just update the packages in the list + enqueuePackageUpdated(new PackageUpdatedTask(PackageUpdatedTask.OP_UPDATE, + packages)); + } } else if (Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(action)) { - String[] packages = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST); - enqueuePackageUpdated(new PackageUpdatedTask( - PackageUpdatedTask.OP_UNAVAILABLE, packages)); + final boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING, false); + if (!replacing) { + String[] packages = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST); + enqueuePackageUpdated(new PackageUpdatedTask( + PackageUpdatedTask.OP_UNAVAILABLE, packages)); + } + // else, we are replacing the packages, so ignore this event and wait for + // EXTERNAL_APPLICATIONS_AVAILABLE to update the packages at that time } else if (Intent.ACTION_LOCALE_CHANGED.equals(action)) { // If we have changed locale we need to clear out the labels in all apps/workspace. forceReload(); |