Update DND visual interruption choices.

Change-Id: I7050264839c566dcef1dd01d155dda694a8d1ec0
diff --git a/api/current.txt b/api/current.txt
index 5c0628c..6406f57 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -5259,10 +5259,8 @@
     field public static final int PRIORITY_SENDERS_ANY = 0; // 0x0
     field public static final int PRIORITY_SENDERS_CONTACTS = 1; // 0x1
     field public static final int PRIORITY_SENDERS_STARRED = 2; // 0x2
-    field public static final int SUPPRESSED_EFFECTS_UNSET = -1; // 0xffffffff
-    field public static final int SUPPRESSED_EFFECT_LIGHTS = 1; // 0x1
-    field public static final int SUPPRESSED_EFFECT_PEEK = 2; // 0x2
-    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 4; // 0x4
+    field public static final int SUPPRESSED_EFFECT_SCREEN_OFF = 1; // 0x1
+    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 2; // 0x2
     field public final int priorityCallSenders;
     field public final int priorityCategories;
     field public final int priorityMessageSenders;
@@ -34457,9 +34455,8 @@
     field public static final int INTERRUPTION_FILTER_PRIORITY = 2; // 0x2
     field public static final int INTERRUPTION_FILTER_UNKNOWN = 0; // 0x0
     field public static final java.lang.String SERVICE_INTERFACE = "android.service.notification.NotificationListenerService";
-    field public static final int SUPPRESSED_EFFECT_LIGHTS = 1; // 0x1
-    field public static final int SUPPRESSED_EFFECT_PEEK = 2; // 0x2
-    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 4; // 0x4
+    field public static final int SUPPRESSED_EFFECT_SCREEN_OFF = 1; // 0x1
+    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 2; // 0x2
   }
 
   public static class NotificationListenerService.Ranking {
diff --git a/api/system-current.txt b/api/system-current.txt
index 2adb1e6..ed094f9 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -5392,10 +5392,8 @@
     field public static final int PRIORITY_SENDERS_ANY = 0; // 0x0
     field public static final int PRIORITY_SENDERS_CONTACTS = 1; // 0x1
     field public static final int PRIORITY_SENDERS_STARRED = 2; // 0x2
-    field public static final int SUPPRESSED_EFFECTS_UNSET = -1; // 0xffffffff
-    field public static final int SUPPRESSED_EFFECT_LIGHTS = 1; // 0x1
-    field public static final int SUPPRESSED_EFFECT_PEEK = 2; // 0x2
-    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 4; // 0x4
+    field public static final int SUPPRESSED_EFFECT_SCREEN_OFF = 1; // 0x1
+    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 2; // 0x2
     field public final int priorityCallSenders;
     field public final int priorityCategories;
     field public final int priorityMessageSenders;
@@ -36904,9 +36902,8 @@
     field public static final int INTERRUPTION_FILTER_PRIORITY = 2; // 0x2
     field public static final int INTERRUPTION_FILTER_UNKNOWN = 0; // 0x0
     field public static final java.lang.String SERVICE_INTERFACE = "android.service.notification.NotificationListenerService";
-    field public static final int SUPPRESSED_EFFECT_LIGHTS = 1; // 0x1
-    field public static final int SUPPRESSED_EFFECT_PEEK = 2; // 0x2
-    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 4; // 0x4
+    field public static final int SUPPRESSED_EFFECT_SCREEN_OFF = 1; // 0x1
+    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 2; // 0x2
     field public static final int TRIM_FULL = 0; // 0x0
     field public static final int TRIM_LIGHT = 1; // 0x1
   }
diff --git a/api/test-current.txt b/api/test-current.txt
index 7abc6d4..417107d 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -5259,10 +5259,8 @@
     field public static final int PRIORITY_SENDERS_ANY = 0; // 0x0
     field public static final int PRIORITY_SENDERS_CONTACTS = 1; // 0x1
     field public static final int PRIORITY_SENDERS_STARRED = 2; // 0x2
-    field public static final int SUPPRESSED_EFFECTS_UNSET = -1; // 0xffffffff
-    field public static final int SUPPRESSED_EFFECT_LIGHTS = 1; // 0x1
-    field public static final int SUPPRESSED_EFFECT_PEEK = 2; // 0x2
-    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 4; // 0x4
+    field public static final int SUPPRESSED_EFFECT_SCREEN_OFF = 1; // 0x1
+    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 2; // 0x2
     field public final int priorityCallSenders;
     field public final int priorityCategories;
     field public final int priorityMessageSenders;
@@ -34472,9 +34470,8 @@
     field public static final int INTERRUPTION_FILTER_PRIORITY = 2; // 0x2
     field public static final int INTERRUPTION_FILTER_UNKNOWN = 0; // 0x0
     field public static final java.lang.String SERVICE_INTERFACE = "android.service.notification.NotificationListenerService";
-    field public static final int SUPPRESSED_EFFECT_LIGHTS = 1; // 0x1
-    field public static final int SUPPRESSED_EFFECT_PEEK = 2; // 0x2
-    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 4; // 0x4
+    field public static final int SUPPRESSED_EFFECT_SCREEN_OFF = 1; // 0x1
+    field public static final int SUPPRESSED_EFFECT_SCREEN_ON = 2; // 0x2
   }
 
   public static class NotificationListenerService.Ranking {
diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java
index faf5b11..a83225d9 100644
--- a/core/java/android/app/NotificationManager.java
+++ b/core/java/android/app/NotificationManager.java
@@ -646,14 +646,23 @@
          * PRIORITY_SENDERS_ANY, PRIORITY_SENDERS_CONTACTS, PRIORITY_SENDERS_STARRED */
         public final int priorityMessageSenders;
 
+        /**
+         * @hide
+         */
         public static final int SUPPRESSED_EFFECTS_UNSET = -1;
-        public static final int SUPPRESSED_EFFECT_LIGHTS = 1 << 0;
-        public static final int SUPPRESSED_EFFECT_PEEK = 1 << 1;
-        public static final int SUPPRESSED_EFFECT_SCREEN_ON = 1 << 2;
+        /**
+         * Whether notification suppressed by DND should not interruption visually when the screen
+         * is off.
+         */
+        public static final int SUPPRESSED_EFFECT_SCREEN_OFF = 1 << 0;
+        /**
+         * Whether notification suppressed by DND should not interruption visually when the screen
+         * is on.
+         */
+        public static final int SUPPRESSED_EFFECT_SCREEN_ON = 1 << 1;
 
         private static final int[] ALL_SUPPRESSED_EFFECTS = {
-                SUPPRESSED_EFFECT_LIGHTS,
-                SUPPRESSED_EFFECT_PEEK,
+                SUPPRESSED_EFFECT_SCREEN_OFF,
                 SUPPRESSED_EFFECT_SCREEN_ON,
         };
 
@@ -762,8 +771,7 @@
 
         private static String effectToString(int effect) {
             switch (effect) {
-                case SUPPRESSED_EFFECT_LIGHTS: return "SUPPRESSED_EFFECT_LIGHTS";
-                case SUPPRESSED_EFFECT_PEEK: return "SUPPRESSED_EFFECT_PEEK";
+                case SUPPRESSED_EFFECT_SCREEN_OFF: return "SUPPRESSED_EFFECT_SCREEN_OFF";
                 case SUPPRESSED_EFFECT_SCREEN_ON: return "SUPPRESSED_EFFECT_SCREEN_ON";
                 case SUPPRESSED_EFFECTS_UNSET: return "SUPPRESSED_EFFECTS_UNSET";
                 default: return "UNKNOWN_" + effect;
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java
index 7ff883e..7b461b1 100644
--- a/core/java/android/service/notification/NotificationListenerService.java
+++ b/core/java/android/service/notification/NotificationListenerService.java
@@ -119,10 +119,16 @@
      * This does not change the interruption filter, only the effects. **/
     public static final int HINT_HOST_DISABLE_EFFECTS = 1;
 
-    public static final int SUPPRESSED_EFFECT_LIGHTS =
-            NotificationManager.Policy.SUPPRESSED_EFFECT_LIGHTS;
-    public static final int SUPPRESSED_EFFECT_PEEK =
-            NotificationManager.Policy.SUPPRESSED_EFFECT_PEEK;
+    /**
+     * Whether notification suppressed by DND should not interruption visually when the screen is
+     * off.
+     */
+    public static final int SUPPRESSED_EFFECT_SCREEN_OFF =
+            NotificationManager.Policy.SUPPRESSED_EFFECT_SCREEN_OFF;
+    /**
+     * Whether notification suppressed by DND should not interruption visually when the screen is
+     * on.
+     */
     public static final int SUPPRESSED_EFFECT_SCREEN_ON =
             NotificationManager.Policy.SUPPRESSED_EFFECT_SCREEN_ON;
 
@@ -993,8 +999,7 @@
 
         /**
          * Returns the type(s) of visual effects that should be suppressed for this notification.
-         * See {@link #SUPPRESSED_EFFECT_LIGHTS}, {@link #SUPPRESSED_EFFECT_PEEK},
-         * {@link #SUPPRESSED_EFFECT_SCREEN_ON}.
+         * See {@link #SUPPRESSED_EFFECT_SCREEN_OFF}, {@link #SUPPRESSED_EFFECT_SCREEN_ON}.
          */
         public int getSuppressedVisualEffects() {
             return mSuppressedVisualEffects;
diff --git a/core/java/android/service/notification/ZenModeConfig.java b/core/java/android/service/notification/ZenModeConfig.java
index 4688843..63853cb 100644
--- a/core/java/android/service/notification/ZenModeConfig.java
+++ b/core/java/android/service/notification/ZenModeConfig.java
@@ -77,8 +77,7 @@
     private static final boolean DEFAULT_ALLOW_REMINDERS = true;
     private static final boolean DEFAULT_ALLOW_EVENTS = true;
     private static final boolean DEFAULT_ALLOW_REPEAT_CALLERS = false;
-    private static final boolean DEFAULT_ALLOW_PEEK = true;
-    private static final boolean DEFAULT_ALLOW_LIGHTS = true;
+    private static final boolean DEFAULT_ALLOW_SCREEN_OFF = true;
     private static final boolean DEFAULT_ALLOW_SCREEN_ON = true;
 
     private static final int XML_VERSION = 2;
@@ -94,9 +93,8 @@
     private static final String ALLOW_ATT_MESSAGES_FROM = "messagesFrom";
     private static final String ALLOW_ATT_REMINDERS = "reminders";
     private static final String ALLOW_ATT_EVENTS = "events";
-    private static final String ALLOW_ATT_PEEK = "peek";
-    private static final String ALLOW_ATT_LIGHTS = "lights";
-    private static final String ALLOW_ATT_SCREEN_ON = "screen_on";
+    private static final String ALLOW_ATT_SCREEN_OFF = "visualScreenOff";
+    private static final String ALLOW_ATT_SCREEN_ON = "visualScreenOn";
 
     private static final String CONDITION_TAG = "condition";
     private static final String CONDITION_ATT_COMPONENT = "component";
@@ -128,9 +126,8 @@
     public int allowCallsFrom = DEFAULT_SOURCE;
     public int allowMessagesFrom = DEFAULT_SOURCE;
     public int user = UserHandle.USER_SYSTEM;
-    public boolean allowPeek = DEFAULT_ALLOW_PEEK;
-    public boolean allowLights = DEFAULT_ALLOW_LIGHTS;
-    public boolean allowScreenOn = DEFAULT_ALLOW_SCREEN_ON;
+    public boolean allowWhenScreenOff = DEFAULT_ALLOW_SCREEN_OFF;
+    public boolean allowWhenScreenOn = DEFAULT_ALLOW_SCREEN_ON;
 
     public ZenRule manualRule;
     public ArrayMap<String, ZenRule> automaticRules = new ArrayMap<>();
@@ -157,9 +154,8 @@
                 automaticRules.put(ids[i], rules[i]);
             }
         }
-        allowPeek = source.readInt() == 1;
-        allowLights = source.readInt() == 1;
-        allowScreenOn = source.readInt() == 1;
+        allowWhenScreenOff = source.readInt() == 1;
+        allowWhenScreenOn = source.readInt() == 1;
     }
 
     @Override
@@ -187,9 +183,8 @@
         } else {
             dest.writeInt(0);
         }
-        dest.writeInt(allowPeek ? 1 : 0);
-        dest.writeInt(allowLights ? 1 : 0);
-        dest.writeInt(allowScreenOn ? 1 : 0);
+        dest.writeInt(allowWhenScreenOff ? 1 : 0);
+        dest.writeInt(allowWhenScreenOn ? 1 : 0);
     }
 
     @Override
@@ -203,9 +198,8 @@
                 .append(",allowMessagesFrom=").append(sourceToString(allowMessagesFrom))
                 .append(",allowReminders=").append(allowReminders)
                 .append(",allowEvents=").append(allowEvents)
-                .append(",allowPeek=").append(allowPeek)
-                .append(",allowLights=").append(allowLights)
-                .append(",allowScreenOn=").append(allowScreenOn)
+                .append(",allowWhenScreenOff=").append(allowWhenScreenOff)
+                .append(",allowWhenScreenOn=").append(allowWhenScreenOn)
                 .append(",automaticRules=").append(automaticRules)
                 .append(",manualRule=").append(manualRule)
                 .append(']').toString();
@@ -240,14 +234,11 @@
         if (allowEvents != to.allowEvents) {
             d.addLine("allowEvents", allowEvents, to.allowEvents);
         }
-        if (allowPeek != to.allowPeek) {
-            d.addLine("allowPeek", allowPeek, to.allowPeek);
+        if (allowWhenScreenOff != to.allowWhenScreenOff) {
+            d.addLine("allowWhenScreenOff", allowWhenScreenOff, to.allowWhenScreenOff);
         }
-        if (allowLights != to.allowLights) {
-            d.addLine("allowLights", allowLights, to.allowLights);
-        }
-        if (allowScreenOn != to.allowScreenOn) {
-            d.addLine("allowScreenOn", allowScreenOn, to.allowScreenOn);
+        if (allowWhenScreenOn != to.allowWhenScreenOn) {
+            d.addLine("allowWhenScreenOn", allowWhenScreenOn, to.allowWhenScreenOn);
         }
         final ArraySet<String> allRules = new ArraySet<>();
         addKeys(allRules, automaticRules);
@@ -346,9 +337,8 @@
                 && other.allowMessagesFrom == allowMessagesFrom
                 && other.allowReminders == allowReminders
                 && other.allowEvents == allowEvents
-                && other.allowPeek == allowPeek
-                && other.allowLights == allowLights
-                && other.allowScreenOn == allowScreenOn
+                && other.allowWhenScreenOff == allowWhenScreenOff
+                && other.allowWhenScreenOn == allowWhenScreenOn
                 && other.user == user
                 && Objects.equals(other.automaticRules, automaticRules)
                 && Objects.equals(other.manualRule, manualRule);
@@ -357,8 +347,9 @@
     @Override
     public int hashCode() {
         return Objects.hash(allowCalls, allowRepeatCallers, allowMessages, allowCallsFrom,
-                allowMessagesFrom, allowReminders, allowEvents, allowPeek, allowLights,
-                allowScreenOn, user, automaticRules, manualRule);
+                allowMessagesFrom, allowReminders, allowEvents, allowWhenScreenOff,
+                allowWhenScreenOn,
+                user, automaticRules, manualRule);
     }
 
     private static String toDayList(int[] days) {
@@ -443,9 +434,9 @@
                         rt.allowCallsFrom = DEFAULT_SOURCE;
                         rt.allowMessagesFrom = DEFAULT_SOURCE;
                     }
-                    rt.allowPeek = safeBoolean(parser, ALLOW_ATT_PEEK, DEFAULT_ALLOW_PEEK);
-                    rt.allowLights = safeBoolean(parser, ALLOW_ATT_LIGHTS, DEFAULT_ALLOW_LIGHTS);
-                    rt.allowScreenOn =
+                    rt.allowWhenScreenOff =
+                            safeBoolean(parser, ALLOW_ATT_SCREEN_OFF, DEFAULT_ALLOW_SCREEN_OFF);
+                    rt.allowWhenScreenOn =
                             safeBoolean(parser, ALLOW_ATT_SCREEN_ON, DEFAULT_ALLOW_SCREEN_ON);
                 } else if (MANUAL_TAG.equals(tag)) {
                     rt.manualRule = readRuleXml(parser);
@@ -475,9 +466,8 @@
         out.attribute(null, ALLOW_ATT_EVENTS, Boolean.toString(allowEvents));
         out.attribute(null, ALLOW_ATT_CALLS_FROM, Integer.toString(allowCallsFrom));
         out.attribute(null, ALLOW_ATT_MESSAGES_FROM, Integer.toString(allowMessagesFrom));
-        out.attribute(null, ALLOW_ATT_PEEK, Boolean.toString(allowPeek));
-        out.attribute(null, ALLOW_ATT_LIGHTS, Boolean.toString(allowLights));
-        out.attribute(null, ALLOW_ATT_SCREEN_ON, Boolean.toString(allowScreenOn));
+        out.attribute(null, ALLOW_ATT_SCREEN_OFF, Boolean.toString(allowWhenScreenOff));
+        out.attribute(null, ALLOW_ATT_SCREEN_ON, Boolean.toString(allowWhenScreenOn));
         out.endTag(null, ALLOW_TAG);
 
         if (manualRule != null) {
@@ -650,13 +640,10 @@
             priorityCategories |= Policy.PRIORITY_CATEGORY_REPEAT_CALLERS;
         }
         int suppressedVisualEffects = 0;
-        if (!allowPeek) {
-            suppressedVisualEffects |= Policy.SUPPRESSED_EFFECT_PEEK;
+        if (!allowWhenScreenOff) {
+            suppressedVisualEffects |= Policy.SUPPRESSED_EFFECT_SCREEN_OFF;
         }
-        if (!allowLights) {
-            suppressedVisualEffects |= Policy.SUPPRESSED_EFFECT_LIGHTS;
-        }
-        if (!allowScreenOn) {
+        if (!allowWhenScreenOn) {
             suppressedVisualEffects |= Policy.SUPPRESSED_EFFECT_SCREEN_ON;
         }
         priorityCallSenders = sourceToPrioritySenders(allowCallsFrom, priorityCallSenders);
@@ -695,9 +682,9 @@
         allowMessagesFrom = prioritySendersToSource(policy.priorityMessageSenders,
                 allowMessagesFrom);
         if (policy.suppressedVisualEffects != Policy.SUPPRESSED_EFFECTS_UNSET) {
-            allowPeek = (policy.suppressedVisualEffects & Policy.SUPPRESSED_EFFECT_PEEK) == 0;
-            allowLights = (policy.suppressedVisualEffects & Policy.SUPPRESSED_EFFECT_LIGHTS) == 0;
-            allowScreenOn =
+            allowWhenScreenOff =
+                    (policy.suppressedVisualEffects & Policy.SUPPRESSED_EFFECT_SCREEN_OFF) == 0;
+            allowWhenScreenOn =
                     (policy.suppressedVisualEffects & Policy.SUPPRESSED_EFFECT_SCREEN_ON) == 0;
         }
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 333e4ff..7d37ad2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -2097,7 +2097,7 @@
         }
 
 
-        if (mNotificationData.shouldSuppressPeek(sbn.getKey())) {
+        if (mNotificationData.shouldSuppressScreenOn(sbn.getKey())) {
             if (DEBUG) Log.d(TAG, "No peeking: suppressed by DND: " + sbn.getKey());
             return false;
         }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
index 3cc1ab9..2cacb8a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java
@@ -283,11 +283,11 @@
         return Ranking.VISIBILITY_NO_OVERRIDE;
     }
 
-    public boolean shouldSuppressPeek(String key) {
+    public boolean shouldSuppressScreenOff(String key) {
         if (mRankingMap != null) {
             mRankingMap.getRanking(key, mTmpRanking);
             return (mTmpRanking.getSuppressedVisualEffects()
-                    & NotificationListenerService.SUPPRESSED_EFFECT_PEEK) != 0;
+                    & NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_OFF) != 0;
         }
         return false;
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 4dee51d..09a7bf0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -1274,7 +1274,7 @@
         }
 
         if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
-            if (shouldSupressFullScreenIntent(notification.getKey())) {
+            if (shouldSuppressFullScreenIntent(notification.getKey())) {
                 if (DEBUG) {
                     Log.d(TAG, "No Fullscreen intent: suppressed by DND: " + notification.getKey());
                 }
@@ -1301,11 +1301,11 @@
         setAreThereNotifications();
     }
 
-    private boolean shouldSupressFullScreenIntent(String key) {
+    private boolean shouldSuppressFullScreenIntent(String key) {
         if (mPowerManager.isInteractive()) {
-            return mNotificationData.shouldSuppressPeek(key);
-        } else {
             return mNotificationData.shouldSuppressScreenOn(key);
+        } else {
+            return mNotificationData.shouldSuppressScreenOff(key);
         }
     }
 
diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto
index e1dd87f..3327ec4 100644
--- a/proto/src/metrics_constants.proto
+++ b/proto/src/metrics_constants.proto
@@ -287,13 +287,14 @@
     QS_USER_TILE = 260;
     QS_BATTERY_TILE = 261;
     NOTIFICATION_ZEN_MODE_VISUAL_INTERRUPTIONS = 262;
-    ACTION_ZEN_ALLOW_PEEK = 263;
+    ACTION_ZEN_ALLOW_WHEN_SCREEN_OFF = 263;
+    // Dead
     ACTION_ZEN_ALLOW_LIGHTS = 264;
     NOTIFICATION_TOPIC_NOTIFICATION = 265;
     ACTION_DEFAULT_SMS_APP_CHANGED = 266;
     QS_COLOR_MATRIX = 267;
     QS_CUSTOM = 268;
-    ACTION_ZEN_ALLOW_SCREEN_ON = 269;
+    ACTION_ZEN_ALLOW_WHEN_SCREEN_ON = 269;
 
     // Logged when the user docks a window from recents by
     // longpressing a task and dragging it to the dock area.
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index bcb2c59..bf8e8fb 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -34,8 +34,7 @@
 import static android.service.notification.NotificationAssistantService.REASON_TOPIC_BANNED;
 import static android.service.notification.NotificationAssistantService.REASON_USER_STOPPED;
 import static android.service.notification.NotificationListenerService.HINT_HOST_DISABLE_EFFECTS;
-import static android.service.notification.NotificationListenerService.SUPPRESSED_EFFECT_LIGHTS;
-import static android.service.notification.NotificationListenerService.SUPPRESSED_EFFECT_PEEK;
+import static android.service.notification.NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_OFF;
 import static android.service.notification.NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_ON;
 import static android.service.notification.NotificationListenerService.TRIM_FULL;
 import static android.service.notification.NotificationListenerService.TRIM_LIGHT;
@@ -2679,7 +2678,7 @@
         boolean wasShowLights = mLights.remove(record.getKey());
         if ((notification.flags & Notification.FLAG_SHOW_LIGHTS) != 0 && aboveThreshold
                 && ((record.getSuppressedVisualEffects()
-                & NotificationListenerService.SUPPRESSED_EFFECT_LIGHTS) == 0)) {
+                & NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_OFF) == 0)) {
             mLights.add(record.getKey());
             updateLightsLocked();
             if (mUseAttentionLight) {
@@ -2691,7 +2690,7 @@
         }
         if (buzz || beep || blink) {
             if (((record.getSuppressedVisualEffects()
-                    & NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_ON) != 0)) {
+                    & NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_OFF) != 0)) {
                 if (DBG) Slog.v(TAG, "Suppressed SystemUI from triggering screen on");
             } else {
                 EventLogTags.writeNotificationAlert(record.getKey(),
@@ -2878,9 +2877,10 @@
     private void applyZenModeLocked(NotificationRecord record) {
         record.setIntercepted(mZenModeHelper.shouldIntercept(record));
         if (record.isIntercepted()) {
-            int suppressed = (mZenModeHelper.shouldSuppressLight() ? SUPPRESSED_EFFECT_LIGHTS : 0)
-                    | (mZenModeHelper.shouldSuppressPeek() ? SUPPRESSED_EFFECT_PEEK : 0)
-                    | (mZenModeHelper.shouldSuppressScreenOn() ? SUPPRESSED_EFFECT_SCREEN_ON : 0);
+            int suppressed = (mZenModeHelper.shouldSuppressWhenScreenOff()
+                    ? SUPPRESSED_EFFECT_SCREEN_OFF : 0)
+                    | (mZenModeHelper.shouldSuppressWhenScreenOn()
+                    ? SUPPRESSED_EFFECT_SCREEN_ON : 0);
             record.setSuppressedVisualEffects(suppressed);
         }
     }
diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java
index 7518c6e..bba0d40 100644
--- a/services/core/java/com/android/server/notification/ZenModeHelper.java
+++ b/services/core/java/com/android/server/notification/ZenModeHelper.java
@@ -35,7 +35,6 @@
 import android.content.res.Resources;
 import android.content.res.XmlResourceParser;
 import android.database.ContentObserver;
-import android.media.AudioAttributes;
 import android.media.AudioManager;
 import android.media.AudioManagerInternal;
 import android.media.AudioSystem;
@@ -150,21 +149,15 @@
         }
     }
 
-    public boolean shouldSuppressLight() {
+    public boolean shouldSuppressWhenScreenOff() {
         synchronized (mConfig) {
-            return !mConfig.allowLights;
+            return !mConfig.allowWhenScreenOff;
         }
     }
 
-    public boolean shouldSuppressPeek() {
+    public boolean shouldSuppressWhenScreenOn() {
         synchronized (mConfig) {
-            return !mConfig.allowPeek;
-        }
-    }
-
-    public boolean shouldSuppressScreenOn() {
-        synchronized (mConfig) {
-            return !mConfig.allowScreenOn;
+            return !mConfig.allowWhenScreenOn;
         }
     }
 
@@ -503,12 +496,12 @@
             return;
         }
         pw.printf("allow(calls=%s,callsFrom=%s,repeatCallers=%s,messages=%s,messagesFrom=%s,"
-                + "events=%s,reminders=%s,lights=%s,peek=%s,screenOn=%s)\n",
+                + "events=%s,reminders=%s,whenScreenOff,whenScreenOn=%s)\n",
                 config.allowCalls, ZenModeConfig.sourceToString(config.allowCallsFrom),
                 config.allowRepeatCallers, config.allowMessages,
                 ZenModeConfig.sourceToString(config.allowMessagesFrom),
-                config.allowEvents, config.allowReminders, config.allowLights, config.allowPeek,
-                config.allowScreenOn);
+                config.allowEvents, config.allowReminders, config.allowWhenScreenOff,
+                config.allowWhenScreenOn);
         pw.print(prefix); pw.print("  manualRule="); pw.println(config.manualRule);
         if (config.automaticRules.isEmpty()) return;
         final int N = config.automaticRules.size();