Lazily loading theme icons

Theme icons are generated and stored in cache, but only loaded if requested in lookup flags
This allows to keep the memory usage low, but not loading theme icons for all the apps

Bug: 381897614
Flag: com.android.launcher3.extendible_theme_manager
Test: Updated tests
Change-Id: I494eab9c4f70670e6f5aeb864ed5287f6b9f1b9e
This commit is contained in:
Sunny Goyal committed 2025-03-31 13:07:03 -07:00
1 parent b5006ef5fb
commit 50884dadfe
16 files changed
+153 -40

No files matched your search

@@ -776,7 +776,7 @@ public class LoaderTask implements Runnable {
allAppsItemRequestInfos.add(new IconRequestInfo<>(
promiseAppInfo,
/* launcherActivityInfo= */ null,
promiseAppInfo.getMatchingLookupFlag().useLowRes()));
promiseAppInfo.getMatchingLookupFlag().withThemeIcon(false)));
}
}
}
@@ -843,7 +843,7 @@ public class LoaderTask implements Runnable {
appInfo,
activityInfo,
workspaceIconRequest.get().iconBlob,
false /* useLowResIcon= */
DEFAULT_LOOKUP_FLAG.withUseLowRes(false)
);
if (!iconRequestInfo.loadIconFromDbBlob(mContext)) {
Log.d(TAG, "AppInfo Icon failed to load from blob, using cache.");
@@ -861,7 +861,8 @@ public class LoaderTask implements Runnable {
+ ", isArchived: " + activityInfo.getApplicationInfo().isArchived);
}
}
return new IconRequestInfo<>(appInfo, activityInfo, false /* useLowResIcon= */);
return new IconRequestInfo<>(appInfo, activityInfo,
DEFAULT_LOOKUP_FLAG.withUseLowRes(false));
}
private List<ShortcutInfo> loadDeepShortcuts() {