Fix app crash on deep shortcut restore

Although the recovery logic for app shortcuts and deep shortcuts are
mostly the same, in deepshortcut's case we don't care about the
component name. This CL fixes the bug where we reset the intent if the
activity a deepshortcut points to is not found. resetting the intent is
problematic as we'll need the shortcut id (which is stored as an
extra on the intent) to recover the deep shortcut using pinned shortcuts.

Bug: 140819317
Change-Id: I22f0266b98a9f6175303cc92a85397e240443250
This commit is contained in:
Samuel Fufa
2019-09-16 18:09:24 -07:00
parent bf7371e510
commit f28f843d74
2 changed files with 4 additions and 3 deletions

View File

@@ -64,7 +64,7 @@ public class ShortcutsChangedTask extends BaseModelUpdateTask {
for (ItemInfo itemInfo : dataModel.itemsIdMap) {
if (itemInfo.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
WorkspaceItemInfo si = (WorkspaceItemInfo) itemInfo;
if (si.getIntent().getPackage().equals(mPackageName) && si.user.equals(mUser)) {
if (mPackageName.equals(si.getIntent().getPackage()) && si.user.equals(mUser)) {
keyToShortcutInfo.addToList(ShortcutKey.fromItemInfo(si), si);
allIds.add(si.getDeepShortcutId());
}