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

Commit 6f2834f4 authored by YK Hung's avatar YK Hung Committed by Android (Google) Code Review
Browse files

Merge "Add a static method on the ApplicationsState to enable app icon cache"

parents 3d0d262b 5e8e8ebc
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -101,6 +101,9 @@ public class ApplicationsState {
    @VisibleForTesting
    static ApplicationsState sInstance;

    // Whether the app icon cache mechanism is enabled or not.
    private static boolean sAppIconCacheEnabled = false;

    public static ApplicationsState getInstance(Application app) {
        return getInstance(app, AppGlobals.getPackageManager());
    }
@@ -115,6 +118,11 @@ public class ApplicationsState {
        }
    }

    /** Set whether the app icon cache mechanism is enabled or not. */
    public static void setAppIconCacheEnabled(boolean enabled) {
        sAppIconCacheEnabled = enabled;
    }

    final Context mContext;
    final PackageManager mPm;
    final IPackageManager mIpm;
@@ -776,7 +784,8 @@ public class ApplicationsState {
    }

    private static boolean isAppIconCacheEnabled(Context context) {
        return SETTING_PKG.equals(context.getPackageName());
        return SETTING_PKG.equals(context.getPackageName())
                || sAppIconCacheEnabled;
    }

    void rebuildActiveSessions() {