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

Commit bba3f86f authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "Honor Settings.Global.LOCK_SCREEN_SHOW_NOTIFICATIONS."

parents b138300a 47e7b739
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@ public abstract class BaseStatusBar extends SystemUI implements
     */
    protected int mState;
    protected boolean mBouncerShowing;
    protected boolean mShowLockscreenNotifications;

    protected NotificationOverflowContainer mKeyguardIconOverflowContainer;

@@ -194,6 +195,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);
        }
    };

@@ -296,6 +300,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),
@@ -1182,6 +1189,10 @@ public abstract class BaseStatusBar extends SystemUI implements
        updateNotificationIcons();
    }

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

    protected abstract void haltTicker();
    protected abstract void setAreThereNotifications();
    protected abstract void updateNotificationIcons();
+9 −0
Original line number Diff line number Diff line
@@ -499,6 +499,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))
@@ -2784,7 +2790,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() {