diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-03-30 16:47:03 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-03-30 16:51:12 -0700 |
commit | 144154d435ac535b28c947cd765c02590a683d3a (patch) | |
tree | deb19707329c070c56cf6f866f38e15e27781d3d | |
parent | 7efe651226f999ca32506fd2756ae18935320182 (diff) | |
download | android_packages_apps_Trebuchet-144154d435ac535b28c947cd765c02590a683d3a.tar.gz android_packages_apps_Trebuchet-144154d435ac535b28c947cd765c02590a683d3a.tar.bz2 android_packages_apps_Trebuchet-144154d435ac535b28c947cd765c02590a683d3a.zip |
No need to differentiate package event into app or updated based on
a package is being updated or not
Package update handling is a super set of package add handling which
also updates the all-apps and package disabled state.
This also prevents addtion of a home screen icon when a managed profile
app on SD card become available.
Bug: 27877926
Change-Id: I9264e422fd30b94ce6ebb2e5adea820b3cda3063
-rw-r--r-- | src/com/android/launcher3/LauncherModel.java | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 3c7366cc3..a82fa29a0 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -102,7 +102,6 @@ public class LauncherModel extends BroadcastReceiver private static final int ITEMS_CHUNK = 6; // batch size for the workspace icons private static final long INVALID_SCREEN_ID = -1L; - @Thunk final boolean mAppsCanBeOnRemoveableStorage; private final boolean mOldContentProviderExists; @Thunk final LauncherAppState mApp; @@ -216,7 +215,6 @@ public class LauncherModel extends BroadcastReceiver LauncherModel(LauncherAppState app, IconCache iconCache, AppFilter appFilter) { Context context = app.getContext(); - mAppsCanBeOnRemoveableStorage = Environment.isExternalStorageRemovable(); String oldProvider = context.getString(R.string.old_launcher_provider_uri); // This may be the same as MIGRATE_AUTHORITY, or it may be replaced by a different // resource string. @@ -1169,20 +1167,8 @@ public class LauncherModel extends BroadcastReceiver @Override public void onPackagesAvailable(String[] packageNames, UserHandleCompat user, boolean replacing) { - if (!replacing) { - enqueuePackageUpdated(new PackageUpdatedTask(PackageUpdatedTask.OP_ADD, packageNames, - user)); - 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, - packageNames, user)); - } + enqueuePackageUpdated( + new PackageUpdatedTask(PackageUpdatedTask.OP_UPDATE, packageNames, user)); } @Override |