diff options
author | Tony Wickham <twickham@google.com> | 2016-08-29 15:17:48 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2016-08-29 15:59:28 -0700 |
commit | fc02c1b446ee54561ac7351fb6ff0f8294785f0e (patch) | |
tree | a4fdb8c15c5c1613bef61dd1d8ce5227216f8a23 /src/com/android/launcher3/LauncherModel.java | |
parent | 4a4b49ff3482cbe7f8192807cdc99437810fe518 (diff) | |
download | android_packages_apps_Trebuchet-fc02c1b446ee54561ac7351fb6ff0f8294785f0e.tar.gz android_packages_apps_Trebuchet-fc02c1b446ee54561ac7351fb6ff0f8294785f0e.tar.bz2 android_packages_apps_Trebuchet-fc02c1b446ee54561ac7351fb6ff0f8294785f0e.zip |
Use promisedIntent instead of intent when deep shortcuts are restored.
This ensures that the intent has the package corresponding to the
shortcut publisher, rather than a market intent. It also ensures that
the intent has the EXTRA_SHORTCUT_ID attached.
Bug: 31123204
Change-Id: I05d56396b629880322e915f52bfc0605b921b0b1
Diffstat (limited to 'src/com/android/launcher3/LauncherModel.java')
-rw-r--r-- | src/com/android/launcher3/LauncherModel.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 1607a4a40..b31a00064 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -931,7 +931,8 @@ public class LauncherModel extends BroadcastReceiver } if (item.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) { incrementPinnedShortcutCount( - ShortcutKey.fromItemInfo(item), true /* shouldPin */); + ShortcutKey.fromShortcutInfo((ShortcutInfo) item), + true /* shouldPin */); } break; case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET: @@ -1000,7 +1001,8 @@ public class LauncherModel extends BroadcastReceiver sBgWorkspaceItems.remove(item); break; case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT: - decrementPinnedShortcutCount(ShortcutKey.fromItemInfo(item)); + decrementPinnedShortcutCount(ShortcutKey.fromShortcutInfo( + (ShortcutInfo) item)); // Fall through. case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION: case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT: @@ -3389,7 +3391,8 @@ public class LauncherModel extends BroadcastReceiver for (ItemInfo itemInfo : sBgItemsIdMap) { if (itemInfo.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) { ShortcutInfo si = (ShortcutInfo) itemInfo; - if (si.getIntent().getPackage().equals(mPackageName) && si.user.equals(mUser)) { + if (si.getPromisedIntent().getPackage().equals(mPackageName) + && si.user.equals(mUser)) { String shortcutId = si.getDeepShortcutId(); if (idsToShortcuts.containsKey(shortcutId)) { idsToWorkspaceShortcutInfos.addToList(shortcutId, si); @@ -3462,7 +3465,7 @@ public class LauncherModel extends BroadcastReceiver ShortcutInfo si = (ShortcutInfo) itemInfo; if (isUserUnlocked) { ShortcutInfoCompat shortcut = - pinnedShortcuts.get(ShortcutKey.fromItemInfo(si)); + pinnedShortcuts.get(ShortcutKey.fromShortcutInfo(si)); // We couldn't verify the shortcut during loader. If its no longer available // (probably due to clear data), delete the workspace item as well if (shortcut == null) { |