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

Commit f701954d authored by Jason Monk's avatar Jason Monk Committed by Dan Sandler
Browse files

Disable heads up when DISABLE_NOTIFICATION_ALERT

When notification alerts are disabled also turn off heads up. This
will fall back to the old behavior, which can allow the fullscreen
intent to be triggered instead.

Bug: 14157742
Change-Id: I4b6e3d9383894b1674d600c374ff8968ca53513e
parent 96caa682
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@ public abstract class BaseStatusBar extends SystemUI implements
    private Locale mLocale;
    protected boolean mUseHeadsUp = false;
    protected boolean mHeadsUpTicker = false;
    protected boolean mDisableNotificationAlerts = false;

    protected IDreamManager mDreamManager;
    PowerManager mPowerManager;
+8 −1
Original line number Diff line number Diff line
@@ -367,7 +367,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        @Override
        public void onChange(boolean selfChange) {
            boolean wasUsing = mUseHeadsUp;
            mUseHeadsUp = ENABLE_HEADS_UP && Settings.Global.HEADS_UP_OFF != Settings.Global.getInt(
            mUseHeadsUp = ENABLE_HEADS_UP && !mDisableNotificationAlerts
                    && Settings.Global.HEADS_UP_OFF != Settings.Global.getInt(
                    mContext.getContentResolver(), Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED,
                    Settings.Global.HEADS_UP_OFF);
            mHeadsUpTicker = mUseHeadsUp && 0 != Settings.Global.getInt(
@@ -1930,6 +1931,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                animateStatusBarShow(mNotificationIconArea, animate);
            }
        }

        if ((diff & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) != 0) {
            mDisableNotificationAlerts =
                    (state & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) != 0;
            mHeadsUpObserver.onChange(true);
        }
    }

    /**