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
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user