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

Commit f042d48b authored by d34d's avatar d34d Committed by Steve Kondik
Browse files

Themes: Check if newTheme has null fonts, icons, or overlays

Change-Id: Iee9e84b1106da8ee0e0f466e7be9f9c4a9e51fb5
parent 04ee911c
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -3935,12 +3935,17 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
     * @return True if we should recreate the status bar
     */
    private boolean shouldUpdateStatusbar(ThemeConfig oldTheme, ThemeConfig newTheme) {
        return newTheme != null && (oldTheme == null || !newTheme.getOverlayForStatusBar()
                .equals(oldTheme.getOverlayForStatusBar()) ||
                !newTheme.getFontPkgName()
                        .equals(oldTheme.getFontPkgName()) ||
                !newTheme.getIconPackPkgName()
                        .equals(oldTheme.getIconPackPkgName()) ||
        // no newTheme, so no need to update status bar
        if (newTheme == null) return false;

        final String overlay = newTheme.getOverlayForStatusBar();
        final String icons = newTheme.getIconPackPkgName();
        final String fonts = newTheme.getFontPkgName();

        return oldTheme == null ||
                (overlay != null && !overlay.equals(oldTheme.getOverlayForStatusBar()) ||
                (fonts != null && !fonts.equals(oldTheme.getFontPkgName())) ||
                (icons != null && !icons.equals(oldTheme.getIconPackPkgName())) ||
                newTheme.getLastThemeChangeRequestType() == RequestType.THEME_UPDATED);
    }