am 6dec01ca: am 5801ef04: Lazy load default app icon in LauncherModel. (Bug 11203738)

* commit '6dec01caa1fc657138f868d4c9431a6c50d99590':
  Lazy load default app icon in LauncherModel. (Bug 11203738)
This commit is contained in:
Winson Chung
2014-02-14 20:37:01 +00:00
committed by Android Git Automerger
+5 -3
View File
@@ -186,9 +186,6 @@ public class LauncherModel extends BroadcastReceiver {
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 class LauncherModel extends BroadcastReceiver {
}
public Bitmap getFallbackIcon() {
if (mDefaultIcon == null) {
final Context context = LauncherAppState.getInstance().getContext();
mDefaultIcon = Utilities.createIconBitmap(
mIconCache.getFullResDefaultActivityIcon(), context);
}
return Bitmap.createBitmap(mDefaultIcon);
}