Fix auto install add of installed activity
Reset the restore status for auto install icons where the activity is
installed and enabled so the item is not stuck in the auto install
state.
Bug: 112664405
Test: manual - See issue
Change-Id: I37116b6e6ecbe4215d96627f9b1ea6909d12a6c0
diff --git a/src/com/android/launcher3/model/PackageUpdatedTask.java b/src/com/android/launcher3/model/PackageUpdatedTask.java
index 1c0732e..c556083 100644
--- a/src/com/android/launcher3/model/PackageUpdatedTask.java
+++ b/src/com/android/launcher3/model/PackageUpdatedTask.java
@@ -227,16 +227,13 @@
isTargetValid = LauncherAppsCompat.getInstance(context)
.isActivityEnabledForProfile(cn, mUser);
}
-
- if (si.hasStatusFlag(ShortcutInfo.FLAG_AUTOINSTALL_ICON)) {
- // Auto install icon
- if (!isTargetValid) {
- if (updateShortcutIntent(context, si, packageName)) {
- infoUpdated = true;
- } else if (si.hasPromiseIconUi()) {
- removedShortcuts.put(si.id, true);
- continue;
- }
+ if (si.hasStatusFlag(ShortcutInfo.FLAG_AUTOINSTALL_ICON)
+ && !isTargetValid) {
+ if (updateShortcutIntent(context, si, packageName)) {
+ infoUpdated = true;
+ } else if (si.hasPromiseIconUi()) {
+ removedShortcuts.put(si.id, true);
+ continue;
}
} else if (!isTargetValid) {
removedShortcuts.put(si.id, true);