diff options
author | Jon Miranda <jonmiranda@google.com> | 2019-09-19 09:25:17 -0700 |
---|---|---|
committer | Jonathan Miranda <jonmiranda@google.com> | 2019-09-24 19:40:30 +0000 |
commit | 3944746fb6e10725cb058d9428c08aaa88eee255 (patch) | |
tree | 96e1f391a96971820c282dc21e04ce66e6edec93 | |
parent | 6d5511a42f211c57c0a2f61fb1a29157ba634764 (diff) | |
download | packages_apps_Trebuchet-3944746fb6e10725cb058d9428c08aaa88eee255.tar.gz packages_apps_Trebuchet-3944746fb6e10725cb058d9428c08aaa88eee255.tar.bz2 packages_apps_Trebuchet-3944746fb6e10725cb058d9428c08aaa88eee255.zip |
Fixed a bug where restored promise icons stay promise icons.
Test:
1 Turn off WiFi
2 Install app. (Promise icon gets added to home screen).
3 Backup launcher.
4 Restore launcher.
5 Turn on WiFi
6 Note promise icon gets updated with as installation progresses.
Will submit to future/master later.
Bug: 140212732
Change-Id: I63cedc6c16f5028297fb1a0852ffbd4473319ae9
(cherry picked from commit 0e1b17f8c49c8bb149b3779e30b3cca17e2b8659)
-rw-r--r-- | src/com/android/launcher3/WorkspaceItemInfo.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher3/model/PackageUpdatedTask.java | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/launcher3/WorkspaceItemInfo.java b/src/com/android/launcher3/WorkspaceItemInfo.java index 1323588e3..23795c5c0 100644 --- a/src/com/android/launcher3/WorkspaceItemInfo.java +++ b/src/com/android/launcher3/WorkspaceItemInfo.java @@ -212,7 +212,7 @@ public class WorkspaceItemInfo extends ItemInfoWithIcon { public ComponentName getTargetComponent() { ComponentName cn = super.getTargetComponent(); if (cn == null && (itemType == Favorites.ITEM_TYPE_SHORTCUT - || hasStatusFlag(FLAG_SUPPORTS_WEB_UI | FLAG_AUTOINSTALL_ICON))) { + || hasStatusFlag(FLAG_SUPPORTS_WEB_UI|FLAG_AUTOINSTALL_ICON|FLAG_RESTORED_ICON))) { // Legacy shortcuts and promise icons with web UI may not have a componentName but just // a packageName. In that case create a dummy componentName instead of adding additional // check everywhere. diff --git a/src/com/android/launcher3/model/PackageUpdatedTask.java b/src/com/android/launcher3/model/PackageUpdatedTask.java index 5e6c7b8c2..d6ebaaf10 100644 --- a/src/com/android/launcher3/model/PackageUpdatedTask.java +++ b/src/com/android/launcher3/model/PackageUpdatedTask.java @@ -55,6 +55,9 @@ import java.util.Collections; import java.util.HashSet; import java.util.List; +import static com.android.launcher3.WorkspaceItemInfo.FLAG_AUTOINSTALL_ICON; +import static com.android.launcher3.WorkspaceItemInfo.FLAG_RESTORED_ICON; + /** * Handles updates due to changes in package manager (app installed/updated/removed) * or when a user availability changes. @@ -221,7 +224,7 @@ public class PackageUpdatedTask extends BaseModelUpdateTask { isTargetValid = LauncherAppsCompat.getInstance(context) .isActivityEnabledForProfile(cn, mUser); } - if (si.hasStatusFlag(FLAG_AUTOINSTALL_ICON)) { + if (si.hasStatusFlag(FLAG_RESTORED_ICON | FLAG_AUTOINSTALL_ICON)) { if (updateWorkspaceItemIntent(context, si, packageName)) { infoUpdated = true; } else if (si.hasPromiseIconUi()) { |