From c86eb1abf49e5ced12f6b2ad3606d9b80e571234 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Fri, 7 May 2021 16:05:51 -0700 Subject: [PATCH] Ignoring invalid deep shortcuts during load Bug: 182728800 Test: Manual Change-Id: I880c2c8898f7a968024bf7b95e763f4293ee19a0 --- src/com/android/launcher3/model/LoaderCursor.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java index 897b02ede2..7e3bceee1d 100644 --- a/src/com/android/launcher3/model/LoaderCursor.java +++ b/src/com/android/launcher3/model/LoaderCursor.java @@ -52,6 +52,7 @@ import com.android.launcher3.logging.FileLog; import com.android.launcher3.model.data.AppInfo; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.WorkspaceItemInfo; +import com.android.launcher3.shortcuts.ShortcutKey; import com.android.launcher3.util.ContentWriter; import com.android.launcher3.util.GridOccupancy; import com.android.launcher3.util.IntArray; @@ -394,6 +395,11 @@ public class LoaderCursor extends CursorWrapper { * otherwise marks it for deletion. */ public void checkAndAddItem(ItemInfo info, BgDataModel dataModel) { + if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) { + // Ensure that it is a valid intent. An exception here will + // cause the item loading to get skipped + ShortcutKey.fromItemInfo(info); + } if (checkItemPlacement(info)) { dataModel.addItem(mContext, info, false); } else {