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

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

Themes: Check if updateConfiguration should be called

Some components do not require us to update the configuration so
we should check for the components that do require a config
change and only then update the configuration.

Change-Id: I8efc00627e82ceff9d1e5262d1a7d6247ad44a58
parent a3f9a3fe
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -424,7 +424,9 @@ public class ThemeService extends IThemeService.Stub {

        updateProvider(request);

        if (shouldUpdateConfiguration(request)) {
            updateConfiguration(request, removePerAppTheme);
        }

        killLaunchers(request);

@@ -723,6 +725,15 @@ public class ThemeService extends IThemeService.Stub {
        return true;
    }

    private boolean shouldUpdateConfiguration(ThemeChangeRequest request) {
        return request.getOverlayThemePackageName() != null ||
                request.getFontThemePackageName() != null ||
                request.getIconsThemePackageName() != null ||
                request.getStatusBarThemePackageName() != null ||
                request.getNavBarThemePackageName() != null ||
                request.getPerAppOverlays().size() > 0;
    }

    private static ThemeConfig.Builder createBuilderFrom(Configuration config,
            ThemeChangeRequest request, String pkgName, boolean removePerAppThemes) {
        ThemeConfig.Builder builder = new ThemeConfig.Builder(config.themeConfig);