Avoid downgrading archived app icon when widget is restored and when apps are archived.

- Restored widget were requesting icons through iconcache, and overwriting the restored icon from restored db.
	- Manually archiving icons would delete icon in cache, we should instead reuse the icon from when it was installed.

Bug: 399649982
Test: Manually performing restore with apps, widgets and shortcuts.
Flag: com.android.launcher3.restore_archived_app_icons_from_db
Change-Id: I4184af480f29eb3ef41173fe5edc5307f263d0b0
This commit is contained in:
Charlie Anderson committed 2025-03-19 21:28:37 -04:00
1 parent 99ef00bfb9
commit 19c4a92ebc
5 files changed
+86 -18

No files matched your search

@@ -762,7 +762,7 @@ public class LoaderTask implements Runnable {
}
IconRequestInfo<AppInfo> iconRequestInfo = getAppInfoIconRequestInfo(
appInfo, app, mWorkspaceIconRequestInfos);
appInfo, app, mWorkspaceIconRequestInfos, mIsRestoreFromBackup);
allAppsItemRequestInfos.add(iconRequestInfo);
mBgAllAppsList.add(appInfo, app, false);
}
@@ -831,9 +831,10 @@ public class LoaderTask implements Runnable {
IconRequestInfo<AppInfo> getAppInfoIconRequestInfo(
AppInfo appInfo,
LauncherActivityInfo activityInfo,
List<IconRequestInfo<WorkspaceItemInfo>> workspaceRequestInfos
List<IconRequestInfo<WorkspaceItemInfo>> workspaceRequestInfos,
boolean isRestoreFromBackup
) {
if (Flags.restoreArchivedAppIconsFromDb()) {
if (Flags.restoreArchivedAppIconsFromDb() && isRestoreFromBackup) {
Optional<IconRequestInfo<WorkspaceItemInfo>> workspaceIconRequest =
workspaceRequestInfos.stream()
.filter(request -> appInfo.getTargetComponent().equals(