From a4c1002bacdbe8e0326c3de0411829905e2351bb Mon Sep 17 00:00:00 2001 From: Tobias Dubois Date: Wed, 30 May 2018 19:00:43 +0200 Subject: [PATCH] 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 --- .../launcher3/model/PackageUpdatedTask.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/com/android/launcher3/model/PackageUpdatedTask.java b/src/com/android/launcher3/model/PackageUpdatedTask.java index 1c0732e3f9..c55608310c 100644 --- a/src/com/android/launcher3/model/PackageUpdatedTask.java +++ b/src/com/android/launcher3/model/PackageUpdatedTask.java @@ -227,16 +227,13 @@ public class PackageUpdatedTask extends BaseModelUpdateTask { 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);