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

Commit d717b849 authored by Robert Snoeberger's avatar Robert Snoeberger
Browse files

Check for theme change after attaching to window.

The color extractor runs as an async task so the theme might have
changed bewteen being inflated and attaching to the window.

Fixes: 127653069
Test: set white wallpaper and kill systemui, check for black text
      on lock screen.

Change-Id: I2d7ef25ff84057489b7ad87bce089acee245fe85
parent 516218f9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -483,7 +483,9 @@ public class KeyguardStatusBarView extends RelativeLayout
                R.color.light_mode_icon_color_single_tone);
        float intensity = textColor == Color.WHITE ? 0 : 1;
        mCarrierLabel.setTextColor(iconColor);
        if (mIconManager != null) {
            mIconManager.setTint(iconColor);
        }

        applyDarkness(R.id.battery, mEmptyRect, intensity * (1f - mDarkAmount), iconColor);
        applyDarkness(R.id.clock, mEmptyRect, intensity, iconColor);
+18 −0
Original line number Diff line number Diff line
@@ -326,6 +326,14 @@ public class NotificationPanelView extends PanelView implements
            Dependency.get(ShadeController.class);
    private int mDisplayId;

    /**
     * Cache the resource id of the theme to avoid unnecessary work in onThemeChanged.
     *
     * onThemeChanged is forced when the theme might not have changed. So, to avoid unncessary
     * work, check the current id with the cached id.
     */
    private int mThemeResId;

    @Inject
    public NotificationPanelView(@Named(VIEW_CONTEXT) Context context, AttributeSet attrs,
            NotificationWakeUpCoordinator coordinator,
@@ -342,6 +350,7 @@ public class NotificationPanelView extends PanelView implements
        mCommandQueue = getComponent(context, CommandQueue.class);
        mDisplayId = context.getDisplayId();
        mPulseExpansionHandler = pulseExpansionHandler;
        mThemeResId = context.getThemeResId();
    }

    /**
@@ -390,6 +399,9 @@ public class NotificationPanelView extends PanelView implements
        Dependency.get(StatusBarStateController.class).addCallback(this);
        Dependency.get(ZenModeController.class).addCallback(this);
        Dependency.get(ConfigurationController.class).addCallback(this);
        // Theme might have changed between inflating this view and attaching it to the window, so
        // force a call to onThemeChanged
        onThemeChanged();
    }

    @Override
@@ -452,6 +464,12 @@ public class NotificationPanelView extends PanelView implements

    @Override
    public void onThemeChanged() {
        final int themeResId = getContext().getThemeResId();
        if (mThemeResId == themeResId) {
            return;
        }
        mThemeResId = themeResId;

        updateShowEmptyShadeView();

        // Re-inflate the status view group.