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

Commit a9b1fc61 authored by Beverly's avatar Beverly Committed by android-build-merger
Browse files

Fix zen alarms only mode check

am: 51563b5f

Change-Id: I577da2d70a3ca8a9f2af0d574cb4406db25439f2
parents e7832d51 51563b5f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1639,7 +1639,7 @@ public class ZenModeConfig implements Parcelable {
        @UnsupportedAppUsage
        public String name;              // required for automatic
        @UnsupportedAppUsage
        public int zenMode;
        public int zenMode;             // ie: Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS
        @UnsupportedAppUsage
        public Uri conditionId;          // required for automatic
        public Condition condition;      // optional
+1 −0
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@ public class ZenLog {
            case TYPE_SUPPRESSOR_CHANGED: return "suppressor_changed";
            case TYPE_LISTENER_HINTS_CHANGED: return "listener_hints_changed";
            case TYPE_SET_NOTIFICATION_POLICY: return "set_notification_policy";
            case TYPE_SET_CONSOLIDATED_ZEN_POLICY: return "set_consolidated_policy";
            default: return "unknown";
        }
    }
+2 −3
Original line number Diff line number Diff line
@@ -942,12 +942,11 @@ public class ZenModeHelper {
    }

    private void applyCustomPolicy(ZenPolicy policy, ZenRule rule) {
        if (rule.zenMode == NotificationManager.INTERRUPTION_FILTER_NONE) {
        if (rule.zenMode == Global.ZEN_MODE_NO_INTERRUPTIONS) {
            policy.apply(new ZenPolicy.Builder()
                    .disallowAllSounds()
                    .build());
        } else if (rule.zenMode
                == NotificationManager.INTERRUPTION_FILTER_ALARMS) {
        } else if (rule.zenMode == Global.ZEN_MODE_ALARMS) {
            policy.apply(new ZenPolicy.Builder()
                    .disallowAllSounds()
                    .allowAlarms(true)