am 5801ef04: Lazy load default app icon in LauncherModel. (Bug 11203738)
* commit '5801ef048adea9ca1a2e31839b73655d3d258b21':
Lazy load default app icon in LauncherModel. (Bug 11203738)
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 7e1442d..aad768d 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -186,9 +186,6 @@
mBgAllAppsList = new AllAppsList(iconCache, appFilter);
mIconCache = iconCache;
- mDefaultIcon = Utilities.createIconBitmap(
- mIconCache.getFullResDefaultActivityIcon(), context);
-
final Resources res = context.getResources();
Configuration config = res.getConfiguration();
mPreviousConfigMcc = config.mcc;
@@ -400,6 +397,11 @@
}
public Bitmap getFallbackIcon() {
+ if (mDefaultIcon == null) {
+ final Context context = LauncherAppState.getInstance().getContext();
+ mDefaultIcon = Utilities.createIconBitmap(
+ mIconCache.getFullResDefaultActivityIcon(), context);
+ }
return Bitmap.createBitmap(mDefaultIcon);
}