Merge "Don't show ringer status if dnd overrides it" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-04-13 15:43:22 +00:00
committed by Android (Google) Code Review
3 changed files with 84 additions and 25 deletions

View File

@@ -1469,6 +1469,17 @@ public class ZenModeConfig implements Parcelable {
&& !allowRepeatCallers;
}
/**
* Determines if DND is currently overriding the ringer
*/
public static boolean isZenOverridingRinger(int zen, ZenModeConfig zenConfig) {
// TODO (beverlyt): check if apps can bypass dnd b/77729075
return zen == Global.ZEN_MODE_NO_INTERRUPTIONS
|| zen == Global.ZEN_MODE_ALARMS
|| (zen == Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS
&& ZenModeConfig.areAllPriorityOnlyNotificationZenSoundsMuted(zenConfig));
}
/**
* Determines whether dnd behavior should mute all sounds controlled by ringer
*/