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
2024-12-19 16:02:32 -08:00
parent b5006ef5fb
commit 50884dadfe
16 changed files with 153 additions and 40 deletions
@@ -18,7 +18,6 @@ package com.android.launcher3.model;
import static com.android.launcher3.EncryptionType.ENCRYPTED;
import static com.android.launcher3.LauncherPrefs.nonRestorableItem;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT;
import static com.android.launcher3.icons.cache.CacheLookupFlag.DEFAULT_LOOKUP_FLAG;
import static com.android.quickstep.InstantAppResolverImpl.COMPONENT_CLASS_MARKER;
import android.app.prediction.AppTarget;
@@ -107,7 +106,7 @@ public class PredictionUpdateTask implements ModelUpdateTask {
return null;
}
AppInfo ai = new AppInfo(context, lai, user);
iconCache.getTitleAndIcon(ai, lai, DEFAULT_LOOKUP_FLAG);
iconCache.getTitleAndIcon(ai, lai, mPredictorState.lookupFlag);
return ai.makeWorkspaceItem(context);
});