Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29a86c26 authored by Winson Chung's avatar Winson Chung Committed by Android Git Automerger
Browse files

am 872e70e0: Merge "Accounting for new Package event extras when updating...

am 872e70e0: Merge "Accounting for new Package event extras when updating forward-locked apps. (Bug 11855584)" into jb-ub-now-kermit

* commit '872e70e0':
  Accounting for new Package event extras when updating forward-locked apps. (Bug 11855584)
parents 1d7cf660 872e70e0
Loading
Loading
Loading
Loading
+21 −7
Original line number Diff line number Diff line
@@ -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);
            if (!replacing) {
                enqueuePackageUpdated(new PackageUpdatedTask(PackageUpdatedTask.OP_ADD, packages));
            // Then, rebind everything.
                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)) {
            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();