OSDN Git Service

Merge "[DO NOT MERGE] Split access-media-storage from read-external-storage" into...
authorTreeHugger Robot <treehugger-gerrit@google.com>
Fri, 25 Oct 2019 18:08:22 +0000 (18:08 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Fri, 25 Oct 2019 18:08:22 +0000 (18:08 +0000)
core/java/android/service/notification/ZenModeConfig.java
services/core/java/com/android/server/notification/ZenLog.java
services/core/java/com/android/server/notification/ZenModeHelper.java

index cb7d41b..93bcdbf 100644 (file)
@@ -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
index c6af756..8f05636 100644 (file)
@@ -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";
         }
     }
index f81015d..ebc4191 100644 (file)
@@ -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)