diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index fdc55d7..46d24ae 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -104,6 +104,7 @@
     public static class ZenModeScheduleRuleSettingsActivity extends SettingsActivity { /* empty */ }
     public static class ZenModeEventRuleSettingsActivity extends SettingsActivity { /* empty */ }
     public static class ZenModeExternalRuleSettingsActivity extends SettingsActivity { /* empty */ }
+    public static class ZenModeVisualInterruptionSettingsActivity extends SettingsActivity { /* empty */}
     public static class NotificationSettingsActivity extends SettingsActivity { /* empty */ }
     public static class NotificationAppListActivity extends SettingsActivity { /* empty */ }
     public static class AppNotificationSettingsActivity extends SettingsActivity { /* empty */ }
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 4eaabe9..b0a1120 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -92,6 +92,7 @@
 import com.android.settings.notification.ZenModePrioritySettings;
 import com.android.settings.notification.ZenModeScheduleRuleSettings;
 import com.android.settings.notification.ZenModeSettings;
+import com.android.settings.notification.ZenModeVisualInterruptionSettings;
 import com.android.settings.print.PrintJobSettingsFragment;
 import com.android.settings.print.PrintSettingsFragment;
 import com.android.settings.search.DynamicIndexableContentMonitor;
@@ -296,6 +297,7 @@
             ZenModeAutomationSettings.class.getName(),
             ZenModeScheduleRuleSettings.class.getName(),
             ZenModeEventRuleSettings.class.getName(),
+            ZenModeVisualInterruptionSettings.class.getName(),
             ProcessStatsUi.class.getName(),
             PowerUsageDetail.class.getName(),
             ProcessStatsSummary.class.getName(),
diff --git a/src/com/android/settings/notification/ZenModePrioritySettings.java b/src/com/android/settings/notification/ZenModePrioritySettings.java
index 6168e57..e3413a7 100644
--- a/src/com/android/settings/notification/ZenModePrioritySettings.java
+++ b/src/com/android/settings/notification/ZenModePrioritySettings.java
@@ -66,7 +66,8 @@
                 MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_REMINDERS, val);
                 if (DEBUG) Log.d(TAG, "onPrefChange allowReminders=" + val);
                 savePolicy(getNewPriorityCategories(val, Policy.PRIORITY_CATEGORY_REMINDERS),
-                        mPolicy.priorityCallSenders, mPolicy.priorityMessageSenders);
+                        mPolicy.priorityCallSenders, mPolicy.priorityMessageSenders,
+                        mPolicy.suppressedVisualEffects);
                 return true;
             }
         });
@@ -80,7 +81,8 @@
                 MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_EVENTS, val);
                 if (DEBUG) Log.d(TAG, "onPrefChange allowEvents=" + val);
                 savePolicy(getNewPriorityCategories(val, Policy.PRIORITY_CATEGORY_EVENTS),
-                        mPolicy.priorityCallSenders, mPolicy.priorityMessageSenders);
+                        mPolicy.priorityCallSenders, mPolicy.priorityMessageSenders,
+                        mPolicy.suppressedVisualEffects);
                 return true;
             }
         });
@@ -100,7 +102,8 @@
                         + " allowMessagesFrom=" + ZenModeConfig.sourceToString(allowMessagesFrom));
                 savePolicy(
                         getNewPriorityCategories(allowMessages, Policy.PRIORITY_CATEGORY_MESSAGES),
-                        mPolicy.priorityCallSenders, allowMessagesFrom);
+                        mPolicy.priorityCallSenders, allowMessagesFrom,
+                        mPolicy.suppressedVisualEffects);
                 return true;
             }
         });
@@ -118,7 +121,8 @@
                 if (DEBUG) Log.d(TAG, "onPrefChange allowCalls=" + allowCalls
                         + " allowCallsFrom=" + ZenModeConfig.sourceToString(allowCallsFrom));
                 savePolicy(getNewPriorityCategories(allowCalls, Policy.PRIORITY_CATEGORY_CALLS),
-                        allowCallsFrom, mPolicy.priorityMessageSenders);
+                        allowCallsFrom, mPolicy.priorityMessageSenders,
+                        mPolicy.suppressedVisualEffects);
                 return true;
             }
         });
@@ -137,7 +141,7 @@
                 int priorityCategories = getNewPriorityCategories(val,
                         NotificationManager.Policy.PRIORITY_CATEGORY_REPEAT_CALLERS);
                 savePolicy(priorityCategories, mPolicy.priorityCallSenders,
-                        mPolicy.priorityMessageSenders);
+                        mPolicy.priorityMessageSenders, mPolicy.suppressedVisualEffects);
                 return true;
             }
         });
@@ -210,8 +214,9 @@
     }
 
     private void savePolicy(int priorityCategories, int priorityCallSenders,
-            int priorityMessageSenders) {
-        mPolicy = new Policy(priorityCategories, priorityCallSenders, priorityMessageSenders);
+            int priorityMessageSenders, int suppressedVisualEffects) {
+        mPolicy = new Policy(priorityCategories, priorityCallSenders, priorityMessageSenders,
+                suppressedVisualEffects);
         NotificationManager.from(mContext).setNotificationPolicy(mPolicy);
     }
 
diff --git a/src/com/android/settings/notification/ZenModeSettings.java b/src/com/android/settings/notification/ZenModeSettings.java
index 3e32abc..39ec08c 100644
--- a/src/com/android/settings/notification/ZenModeSettings.java
+++ b/src/com/android/settings/notification/ZenModeSettings.java
@@ -37,6 +37,7 @@
 public class ZenModeSettings extends ZenModeSettingsBase implements Indexable {
     private static final String KEY_PRIORITY_SETTINGS = "priority_settings";
     private static final String KEY_AUTOMATION_SETTINGS = "automation_settings";
+    private static final String KEY_VISUAL_INTERRUPTIONS_SETTINGS = "visual_interruptions_settings";
 
     private Preference mPrioritySettings;
 
@@ -116,10 +117,12 @@
         return s;
     }
 
-    private static SparseArray<String> allKeyTitles(Context context) {
+    private static SparseArray<String> allKeyTitles() {
         final SparseArray<String> rt = new SparseArray<String>();
         rt.put(R.string.zen_mode_priority_settings_title, KEY_PRIORITY_SETTINGS);
         rt.put(R.string.zen_mode_automation_settings_title, KEY_AUTOMATION_SETTINGS);
+        rt.put(R.string.zen_mode_visual_interruptions_settings_title,
+                KEY_VISUAL_INTERRUPTIONS_SETTINGS);
         return rt;
     }
 
@@ -134,7 +137,7 @@
 
             @Override
             public List<SearchIndexableRaw> getRawDataToIndex(Context context, boolean enabled) {
-                final SparseArray<String> keyTitles = allKeyTitles(context);
+                final SparseArray<String> keyTitles = allKeyTitles();
                 final int N = keyTitles.size();
                 final List<SearchIndexableRaw> result = new ArrayList<SearchIndexableRaw>(N);
                 final Resources res = context.getResources();
diff --git a/src/com/android/settings/notification/ZenModeVisualInterruptionSettings.java b/src/com/android/settings/notification/ZenModeVisualInterruptionSettings.java
new file mode 100644
index 0000000..ba1b378
--- /dev/null
+++ b/src/com/android/settings/notification/ZenModeVisualInterruptionSettings.java
@@ -0,0 +1,126 @@
+/**
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.notification;
+
+import android.app.NotificationManager;
+import android.app.NotificationManager.Policy;
+import android.content.Context;
+import android.os.Bundle;
+import android.provider.SearchIndexableResource;
+import android.support.v14.preference.SwitchPreference;
+import android.support.v7.preference.Preference;
+import android.support.v7.preference.PreferenceScreen;
+import android.util.Log;
+
+import com.android.internal.logging.MetricsLogger;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settings.search.Indexable;
+import com.android.settings.R;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class ZenModeVisualInterruptionSettings extends ZenModeSettingsBase {
+
+    private static final String KEY_PEEK = "peek";
+    private static final String KEY_LIGHTS = "lights";
+
+    private SwitchPreference mPeek;
+    private SwitchPreference mLights;
+
+    private boolean mDisableListeners;
+    private NotificationManager.Policy mPolicy;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        addPreferencesFromResource(R.xml.zen_mode_visual_interruptions_settings);
+        final PreferenceScreen root = getPreferenceScreen();
+
+        mPolicy = NotificationManager.from(mContext).getNotificationPolicy();
+
+        mPeek = (SwitchPreference) root.findPreference(KEY_PEEK);
+        mPeek.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+            @Override
+            public boolean onPreferenceChange(Preference preference, Object newValue) {
+                if (mDisableListeners) return true;
+                final boolean val = (Boolean) newValue;
+                MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_PEEK, val);
+                if (DEBUG) Log.d(TAG, "onPrefChange suppressPeek=" + val);
+                savePolicy(getNewSuppressedEffects(val, Policy.SUPPRESSED_EFFECT_PEEK));
+                return true;
+            }
+        });
+
+        mLights = (SwitchPreference) root.findPreference(KEY_LIGHTS);
+        mLights.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+            @Override
+            public boolean onPreferenceChange(Preference preference, Object newValue) {
+                if (mDisableListeners) return true;
+                final boolean val = (Boolean) newValue;
+                MetricsLogger.action(mContext, MetricsLogger.ACTION_ZEN_ALLOW_LIGHTS, val);
+                if (DEBUG) Log.d(TAG, "onPrefChange suppressLights=" + val);
+                savePolicy(getNewSuppressedEffects(val, Policy.SUPPRESSED_EFFECT_LIGHTS));
+                return true;
+            }
+        });
+    }
+
+    @Override
+    protected int getMetricsCategory() {
+        return MetricsLogger.NOTIFICATION_ZEN_MODE_VISUAL_INTERRUPTIONS;
+    }
+
+    @Override
+    protected void onZenModeChanged() {
+        // Don't care
+    }
+
+    @Override
+    protected void onZenModeConfigChanged() {
+        mPolicy = NotificationManager.from(mContext).getNotificationPolicy();
+        updateControls();
+    }
+
+    private void updateControls() {
+        mDisableListeners = true;
+        mPeek.setChecked(isEffectSuppressed(Policy.SUPPRESSED_EFFECT_PEEK));
+        mLights.setChecked(isEffectSuppressed(Policy.SUPPRESSED_EFFECT_LIGHTS));
+        mDisableListeners = false;
+    }
+
+    private boolean isEffectSuppressed(int effect) {
+        return (mPolicy.suppressedVisualEffects & effect) != 0;
+    }
+
+    private int getNewSuppressedEffects(boolean suppress, int effectType) {
+        int effects = mPolicy.suppressedVisualEffects;
+        if (suppress) {
+            effects |= effectType;
+        } else {
+            effects &= ~effectType;
+        }
+        return effects;
+    }
+
+    private void savePolicy(int suppressedVisualEffects) {
+        mPolicy = new Policy(mPolicy.priorityCategories,
+                mPolicy.priorityCallSenders, mPolicy.priorityMessageSenders,
+                suppressedVisualEffects);
+        NotificationManager.from(mContext).setNotificationPolicy(mPolicy);
+    }
+}
diff --git a/src/com/android/settings/search/Ranking.java b/src/com/android/settings/search/Ranking.java
index 18ae1ec..1f464df 100644
--- a/src/com/android/settings/search/Ranking.java
+++ b/src/com/android/settings/search/Ranking.java
@@ -47,6 +47,7 @@
 import com.android.settings.notification.ZenModeAutomationSettings;
 import com.android.settings.notification.ZenModePrioritySettings;
 import com.android.settings.notification.ZenModeSettings;
+import com.android.settings.notification.ZenModeVisualInterruptionSettings;
 import com.android.settings.print.PrintSettingsFragment;
 import com.android.settings.sim.SimSettings;
 import com.android.settings.users.UserSettings;
@@ -129,6 +130,7 @@
         sRankMap.put(ZenModeSettings.class.getName(), RANK_NOTIFICATIONS);
         sRankMap.put(ZenModePrioritySettings.class.getName(), RANK_NOTIFICATIONS);
         sRankMap.put(ZenModeAutomationSettings.class.getName(), RANK_NOTIFICATIONS);
+        sRankMap.put(ZenModeVisualInterruptionSettings.class.getName(), RANK_NOTIFICATIONS);
 
         // Storage
         sRankMap.put(StorageSettings.class.getName(), RANK_STORAGE);
diff --git a/src/com/android/settings/search/SearchIndexableResources.java b/src/com/android/settings/search/SearchIndexableResources.java
index 6b4a947..7e669e0 100644
--- a/src/com/android/settings/search/SearchIndexableResources.java
+++ b/src/com/android/settings/search/SearchIndexableResources.java
@@ -48,6 +48,7 @@
 import com.android.settings.notification.OtherSoundSettings;
 import com.android.settings.notification.ZenModePrioritySettings;
 import com.android.settings.notification.ZenModeSettings;
+import com.android.settings.notification.ZenModeVisualInterruptionSettings;
 import com.android.settings.print.PrintSettingsFragment;
 import com.android.settings.sim.SimSettings;
 import com.android.settings.users.UserSettings;
@@ -310,6 +311,14 @@
                         R.xml.wifi_calling_settings,
                         WifiCallingSettings.class.getName(),
                         R.drawable.ic_settings_wireless));
+
+        sResMap.put(ZenModeVisualInterruptionSettings.class.getName(),
+                new SearchIndexableResource(
+                        Ranking.getRankForClassName(
+                                ZenModeVisualInterruptionSettings.class.getName()),
+                        R.xml.zen_mode_visual_interruptions_settings,
+                        ZenModeVisualInterruptionSettings.class.getName(),
+                        R.drawable.ic_settings_notifications));
     }
 
     private SearchIndexableResources() {
