Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5801ef04 authored by Winson Chung's avatar Winson Chung
Browse files

Lazy load default app icon in LauncherModel. (Bug 11203738)

Change-Id: I397b532f247309de9ae5636b51f125f639966696
parent 3798b643
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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);
    }