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

Commit 6be17174 authored by LuK1337's avatar LuK1337 Committed by Łukasz Patron
Browse files

fixup! SystemUI: Allow translucent notifications background on lockscreen [1/3]

* We should always draw the background when
  we aren't on the keyguard.

Change-Id: I2724883e7e28155e3f3423163e6ae111083e9a44
parent fd2adbe6
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -597,7 +597,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
                updateDismissRtlSetting("1".equals(newValue));
            } else if (key.equals(LOCKSCREEN_TRANSLUCENT_NOTIFICATIONS_BG_ENABLED)) {
                mShouldDrawNotificationBackground = !"1".equals(newValue);
                setWillNotDraw(!mShouldDrawNotificationBackground);
                setWillNotDraw(!mShouldDrawNotificationBackground && onKeyguard());
            }
        }, HIGH_PRIORITY, Settings.Secure.NOTIFICATION_DISMISS_RTL,
                LOCKSCREEN_TRANSLUCENT_NOTIFICATIONS_BG_ENABLED);
@@ -615,9 +615,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
        dynamicPrivacyController.addListener(this);
        mDynamicPrivacyController = dynamicPrivacyController;
        mStatusbarStateController = (SysuiStatusBarStateController) statusBarStateController;

        boolean willDraw = mShouldDrawNotificationBackground || DEBUG;
        setWillNotDraw(!willDraw);
    }

    private void updateDismissRtlSetting(boolean dismissRtl) {
@@ -780,7 +777,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd

    @ShadeViewRefactor(RefactorComponent.DECORATOR)
    protected void onDraw(Canvas canvas) {
        if (mShouldDrawNotificationBackground
        if ((mShouldDrawNotificationBackground || !onKeyguard())
                && (mSections[0].getCurrentBounds().top
                < mSections[NUM_SECTIONS - 1].getCurrentBounds().bottom
                || mAmbientState.isDozing())) {
@@ -954,7 +951,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    private void updateBackgroundDimming() {
        // No need to update the background color if it's not being drawn.
        if (!mShouldDrawNotificationBackground) {
        if (!mShouldDrawNotificationBackground && onKeyguard()) {
            return;
        }

@@ -2478,7 +2475,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    private void updateBackground() {
        // No need to update the background color if it's not being drawn.
        if (!mShouldDrawNotificationBackground) {
        if (!mShouldDrawNotificationBackground && onKeyguard()) {
            return;
        }

@@ -5329,6 +5326,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd

        mEntryManager.updateNotifications();
        updateVisibility();

        setWillNotDraw(!mShouldDrawNotificationBackground && onKeyguard);
    }

    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)