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

Commit 4b3bda22 authored by John Spurlock's avatar John Spurlock
Browse files

Honor Settings.Global.LOCK_SCREEN_SHOW_NOTIFICATIONS.

Hide notifications on the lockscreen if the setting = 0.

Bug:15104826
Change-Id: I394f10a9958a3ee4d03198f21eb09b778e00903e
(cherry picked from commit ac639f28502a7e8a6c52a6585810c8d94e0e5388)
parent 3d5e5c7b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -182,6 +182,7 @@ public abstract class BaseStatusBar extends SystemUI implements
     */
    protected int mState;
    protected boolean mBouncerShowing;
    protected boolean mShowLockscreenNotifications;

    protected NotificationOverflowContainer mKeyguardIconOverflowContainer;

@@ -201,6 +202,9 @@ public abstract class BaseStatusBar extends SystemUI implements
            final int mode = Settings.Global.getInt(mContext.getContentResolver(),
                    Settings.Global.ZEN_MODE, Settings.Global.ZEN_MODE_OFF);
            setZenMode(mode);
            final boolean show = Settings.Global.getInt(mContext.getContentResolver(),
                    Settings.Global.LOCK_SCREEN_SHOW_NOTIFICATIONS, 1) != 0;
            setShowLockscreenNotifications(show);
        }
    };

@@ -362,6 +366,9 @@ public abstract class BaseStatusBar extends SystemUI implements
        mContext.getContentResolver().registerContentObserver(
                Settings.Global.getUriFor(Settings.Global.ZEN_MODE), false,
                mSettingsObserver);
        mContext.getContentResolver().registerContentObserver(
                Settings.Global.getUriFor(Settings.Global.LOCK_SCREEN_SHOW_NOTIFICATIONS), false,
                mSettingsObserver);

        mContext.getContentResolver().registerContentObserver(
                Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS),
@@ -1247,6 +1254,10 @@ public abstract class BaseStatusBar extends SystemUI implements
        updateNotifications();
    }

    protected void setShowLockscreenNotifications(boolean show) {
        mShowLockscreenNotifications = show;
    }

    protected abstract void haltTicker();
    protected abstract void setAreThereNotifications();
    protected abstract void updateNotifications();
+9 −0
Original line number Diff line number Diff line
@@ -504,6 +504,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        }
    }

    @Override
    protected void setShowLockscreenNotifications(boolean show) {
        super.setShowLockscreenNotifications(show);
        updateStackScrollerState();
    }

    @Override
    public void start() {
        mDisplay = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE))
@@ -2851,7 +2857,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    }

    public void updateStackScrollerState() {
        if (mStackScroller == null) return;
        mStackScroller.setDimmed(mState == StatusBarState.KEYGUARD, false /* animate */);
        mStackScroller.setVisibility(!mShowLockscreenNotifications && mState == StatusBarState.KEYGUARD
                ? View.INVISIBLE : View.VISIBLE);
    }

    public void userActivity() {