From 35c5755b712a7ddeb2fca8db272ccbd27cac1f83 Mon Sep 17 00:00:00 2001 From: Pinyao Ting Date: Tue, 26 Oct 2021 17:48:35 +0000 Subject: [PATCH] Fix the fallback logic for shortcut icons when icons are missing The icons of shortcuts in general are not persisted in backup payload and thus are not available on the new device, apps are reposponsible for republishing those shortcuts on the new device, with the only exception being pinned shortcuts, whose icons are stored in launcher.db as a fallback when icons are not avaialble in the shortcut themselves. A previous CL unexpected excluded deep shortcuts from loading their fallback icons in launcher.db, causes pinned shortcut to fallback further to default droid icons, this CL restores the original behavior. Bug: 202346722 Test: manual Change-Id: Ie09becd3a0dc1ca1e7c2573fe1b68b61a58c2091 --- src/com/android/launcher3/model/LoaderCursor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java index 8a5a9bf327..47df53810c 100644 --- a/src/com/android/launcher3/model/LoaderCursor.java +++ b/src/com/android/launcher3/model/LoaderCursor.java @@ -190,6 +190,7 @@ public class LoaderCursor extends CursorWrapper { String resourceName = itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT ? getString(iconResourceIndex) : null; byte[] iconBlob = itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT + || itemType == Favorites.ITEM_TYPE_DEEP_SHORTCUT || restoreFlag != 0 ? getBlob(iconIndex) : null;