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

Commit d71c238a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Reload theme before dispatching UiMode event"

parents 9119aed5 fae63a28
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -34,9 +34,11 @@ class ConfigurationControllerImpl(context: Context)
    private val inCarMode: Boolean
    private var uiMode: Int = 0
    private var localeList: LocaleList? = null
    private val context: Context

    init {
        val currentConfig = context.resources.configuration
        this.context = context
        fontScale = currentConfig.fontScale
        density = currentConfig.densityDpi
        inCarMode = currentConfig.uiMode and Configuration.UI_MODE_TYPE_MASK ==
@@ -82,6 +84,10 @@ class ConfigurationControllerImpl(context: Context)
        }

        if (uiModeChanged) {
            // We need to force the style re-evaluation to make sure that it's up to date
            // and attrs were reloaded.
            context.theme.applyStyle(context.themeResId, true)

            this.uiMode = uiMode
            listeners.filterForEach({ this.listeners.contains(it) }) {
                it.onUiModeChanged()
+0 −5
Original line number Diff line number Diff line
@@ -1144,11 +1144,6 @@ public class StatusBar extends SystemUI implements DemoMode,

    @Override
    public void onUiModeChanged() {
        // UiMode will change the style was already evaluated.
        // We need to force the re-evaluation to make sure that all parents
        // are up to date and new attrs will be rettrieved.
        mContext.getTheme().applyStyle(mContext.getThemeResId(), true);

        if (mBrightnessMirrorController != null) {
            mBrightnessMirrorController.onUiModeChanged();
        }