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

Commit cd793fca authored by Clark Scheff's avatar Clark Scheff Committed by Gerrit Code Review
Browse files

Themes: Only kill launchers if overlays or icons changed

There is no need to kill the launcher for every coponent changed.
The only ones that really concern us in regards to killing launchers
are MODIFIES_OVERLAYS and MODIFIES_ICONS

Change-Id: I840b8e2ecd4b52a33f352809c5d3d2c7e92ce85e
parent 2ece4008
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ public class ThemeService extends IThemeService.Stub {

        updateConfiguration(componentMap);

        killLaunchers();
        killLaunchers(componentMap);

        postFinish(true, componentMap);
        mIsThemeApplying = false;
@@ -647,7 +647,12 @@ public class ThemeService extends IThemeService.Stub {

    // Kill the current Home process, they tend to be evil and cache
    // drawable references in all apps
    private void killLaunchers() {
    private void killLaunchers(Map<String, String> componentMap) {
        if (!(componentMap.containsKey(ThemesColumns.MODIFIES_ICONS)
                || componentMap.containsKey(ThemesColumns.MODIFIES_OVERLAYS))) {
            return;
        }

        final ActivityManager am =
                (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
        final PackageManager pm = mContext.getPackageManager();