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
This commit is contained in:
Pinyao Ting
2021-10-26 17:48:35 +00:00
parent 3bd6b8bf81
commit 35c5755b71

View File

@@ -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;