diff --git a/res/values/strings.xml b/res/values/strings.xml
index 430c0d4..681bc4e 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7071,10 +7071,10 @@
      summary on the channel page-->
 
     <!-- [CHAR LIMIT=100] Notification Importance: min importance level description -->
-    <string name="notification_importance_min">No sound or visual interruption</string>
+    <string name="notification_importance_min">Show silently and minimize</string>
 
     <!-- [CHAR LIMIT=100] Notification Importance: low importance level description -->
-    <string name="notification_importance_low">No sound</string>
+    <string name="notification_importance_low">Show silently</string>
 
     <!-- [CHAR LIMIT=100] Notification Importance: normal importance level description -->
     <string name="notification_importance_default">Make sound</string>
diff --git a/src/com/android/settings/notification/AppNotificationSettings.java b/src/com/android/settings/notification/AppNotificationSettings.java
index 14ccf23..78139dc 100644
--- a/src/com/android/settings/notification/AppNotificationSettings.java
+++ b/src/com/android/settings/notification/AppNotificationSettings.java
@@ -19,10 +19,8 @@
 import android.app.NotificationChannel;
 import android.app.NotificationChannelGroup;
 import android.content.Context;
-import android.content.Intent;
 import android.os.AsyncTask;
-import android.os.Bundle;
-import android.provider.Settings;
+import android.support.v14.preference.SwitchPreference;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceCategory;
 import android.support.v7.preference.PreferenceGroup;
@@ -32,9 +30,8 @@
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.internal.widget.LockPatternUtils;
 import com.android.settings.R;
-import com.android.settings.Utils;
-import com.android.settings.applications.AppInfoBase;
-import com.android.settings.widget.MasterSwitchPreference;
+import com.android.settings.widget.MasterCheckBoxPreference;
+import com.android.settingslib.RestrictedSwitchPreference;
 import com.android.settingslib.core.AbstractPreferenceController;
 
 import java.util.ArrayList;
@@ -179,17 +176,37 @@
                 groupCategory.setKey(group.getId());
                 populateGroupToggle(groupCategory, group);
             }
-
-            final List<NotificationChannel> channels = group.getChannels();
-            Collections.sort(channels, mChannelComparator);
-            int N = channels.size();
-            for (int i = 0; i < N; i++) {
-                final NotificationChannel channel = channels.get(i);
-                populateSingleChannelPrefs(groupCategory, channel, group.isBlocked());
+            if (!group.isBlocked()) {
+                final List<NotificationChannel> channels = group.getChannels();
+                Collections.sort(channels, mChannelComparator);
+                int N = channels.size();
+                for (int i = 0; i < N; i++) {
+                    final NotificationChannel channel = channels.get(i);
+                    populateSingleChannelPrefs(groupCategory, channel, group.isBlocked());
+                }
             }
         }
     }
 
+    protected void populateGroupToggle(final PreferenceGroup parent,
+            NotificationChannelGroup group) {
+        RestrictedSwitchPreference preference = new RestrictedSwitchPreference(getPrefContext());
+        preference.setTitle(R.string.notification_switch_label);
+        preference.setEnabled(mSuspendedAppsAdmin == null
+                && isChannelGroupBlockable(group));
+        preference.setChecked(!group.isBlocked());
+        preference.setOnPreferenceClickListener(preference1 -> {
+            final boolean allowGroup = ((SwitchPreference) preference1).isChecked();
+            group.setBlocked(!allowGroup);
+            mBackend.updateChannelGroup(mAppRow.pkg, mAppRow.uid, group);
+
+            onGroupBlockStateChanged(group);
+            return true;
+        });
+
+        parent.addPreference(preference);
+    }
+
     private Comparator<NotificationChannelGroup> mChannelGroupComparator =
             new Comparator<NotificationChannelGroup>() {
 
@@ -204,4 +221,37 @@
                     return left.getId().compareTo(right.getId());
                 }
             };
+
+    protected void onGroupBlockStateChanged(NotificationChannelGroup group) {
+        if (group == null) {
+            return;
+        }
+        PreferenceGroup groupGroup = (
+                PreferenceGroup) getPreferenceScreen().findPreference(group.getId());
+
+        if (groupGroup != null) {
+            if (group.isBlocked()) {
+                List<Preference> toRemove = new ArrayList<>();
+                int childCount = groupGroup.getPreferenceCount();
+                for (int i = 0; i < childCount; i++) {
+                    Preference pref = groupGroup.getPreference(i);
+                    if (pref instanceof MasterCheckBoxPreference) {
+                        toRemove.add(pref);
+                    }
+                }
+                for (Preference pref : toRemove) {
+                    groupGroup.removePreference(pref);
+                }
+            } else {
+                final List<NotificationChannel> channels = group.getChannels();
+                Collections.sort(channels, mChannelComparator);
+                int N = channels.size();
+                for (int i = 0; i < N; i++) {
+                    final NotificationChannel channel = channels.get(i);
+                    populateSingleChannelPrefs(groupGroup, channel, group.isBlocked());
+                }
+            }
+        }
+    }
+
 }
diff --git a/src/com/android/settings/notification/BlockPreferenceController.java b/src/com/android/settings/notification/BlockPreferenceController.java
index 6b65b0f..8b27098 100644
--- a/src/com/android/settings/notification/BlockPreferenceController.java
+++ b/src/com/android/settings/notification/BlockPreferenceController.java
@@ -103,6 +103,10 @@
                 mChannel.setImportance(importance);
                 saveChannel();
             }
+            if (mBackend.onlyHasDefaultChannel(mAppRow.pkg, mAppRow.uid)) {
+                mAppRow.banned = blocked;
+                mBackend.setNotificationsEnabledForPackage(mAppRow.pkg, mAppRow.uid, !blocked);
+            }
         } else if (mChannelGroup != null && mChannelGroup.getGroup() != null) {
             mChannelGroup.setBlocked(blocked);
             mBackend.updateChannelGroup(mAppRow.pkg, mAppRow.uid, mChannelGroup.getGroup());
diff --git a/src/com/android/settings/notification/NotificationAppPreference.java b/src/com/android/settings/notification/NotificationAppPreference.java
new file mode 100644
index 0000000..a6bcdd6
--- /dev/null
+++ b/src/com/android/settings/notification/NotificationAppPreference.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2018 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.content.Context;
+import android.support.v7.preference.PreferenceViewHolder;
+import android.text.TextUtils;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.ProgressBar;
+import android.widget.Switch;
+
+import com.android.settings.R;
+import com.android.settingslib.RestrictedLockUtils;
+import com.android.settingslib.TwoTargetPreference;
+
+/**
+ * Shows an app icon, title and summary. Has a second switch touch target.
+ */
+public class NotificationAppPreference extends TwoTargetPreference {
+
+    private int mProgress;
+    private boolean mProgressVisible;
+    private Switch mSwitch;
+    private boolean mChecked;
+    private boolean mEnableSwitch = true;
+
+    public NotificationAppPreference(Context context) {
+        super(context);
+        setLayoutResource(R.layout.preference_app);
+    }
+
+    public NotificationAppPreference(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        setLayoutResource(R.layout.preference_app);
+    }
+
+    @Override
+    protected int getSecondTargetResId() {
+        return R.layout.preference_widget_master_switch;
+    }
+
+    public void setProgress(int amount) {
+        mProgress = amount;
+        mProgressVisible = true;
+        notifyChanged();
+    }
+
+    @Override
+    public void onBindViewHolder(PreferenceViewHolder view) {
+        super.onBindViewHolder(view);
+
+        view.findViewById(R.id.summary_container)
+                .setVisibility(TextUtils.isEmpty(getSummary()) ? View.GONE : View.VISIBLE);
+        final ProgressBar progress = (ProgressBar) view.findViewById(android.R.id.progress);
+        if (mProgressVisible) {
+            progress.setProgress(mProgress);
+            progress.setVisibility(View.VISIBLE);
+        } else {
+            progress.setVisibility(View.GONE);
+        }
+
+        final View widgetView = view.findViewById(android.R.id.widget_frame);
+        if (widgetView != null) {
+            widgetView.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    if (mSwitch != null && !mSwitch.isEnabled()) {
+                        return;
+                    }
+                    setChecked(!mChecked);
+                    if (!callChangeListener(mChecked)) {
+                        setChecked(!mChecked);
+                    } else {
+                        persistBoolean(mChecked);
+                    }
+                }
+            });
+        }
+
+        mSwitch = (Switch) view.findViewById(R.id.switchWidget);
+        if (mSwitch != null) {
+            mSwitch.setContentDescription(getTitle());
+            mSwitch.setChecked(mChecked);
+            mSwitch.setEnabled(mEnableSwitch);
+        }
+    }
+
+    public boolean isChecked() {
+        return mSwitch != null && mChecked;
+    }
+
+    public void setChecked(boolean checked) {
+        mChecked = checked;
+        if (mSwitch != null) {
+            mSwitch.setChecked(checked);
+        }
+    }
+
+    public void setSwitchEnabled(boolean enabled) {
+        mEnableSwitch = enabled;
+        if (mSwitch != null) {
+            mSwitch.setEnabled(enabled);
+        }
+    }
+
+    /**
+     * If admin is not null, disables the switch.
+     * Otherwise, keep it enabled.
+     */
+    public void setDisabledByAdmin(RestrictedLockUtils.EnforcedAdmin admin) {
+        setSwitchEnabled(admin == null);
+    }
+
+    public Switch getSwitch() {
+        return mSwitch;
+    }
+}
diff --git a/src/com/android/settings/notification/NotificationBackend.java b/src/com/android/settings/notification/NotificationBackend.java
index e047efa..d205fb4 100644
--- a/src/com/android/settings/notification/NotificationBackend.java
+++ b/src/com/android/settings/notification/NotificationBackend.java
@@ -15,6 +15,9 @@
  */
 package com.android.settings.notification;
 
+import static android.app.NotificationManager.IMPORTANCE_NONE;
+import static android.app.NotificationManager.IMPORTANCE_UNSPECIFIED;
+
 import android.app.INotificationManager;
 import android.app.NotificationChannel;
 import android.app.NotificationChannelGroup;
@@ -101,6 +104,12 @@
 
     public boolean setNotificationsEnabledForPackage(String pkg, int uid, boolean enabled) {
         try {
+            if (onlyHasDefaultChannel(pkg, uid)) {
+                NotificationChannel defaultChannel =
+                        getChannel(pkg, uid, NotificationChannel.DEFAULT_CHANNEL_ID);
+                defaultChannel.setImportance(enabled ? IMPORTANCE_UNSPECIFIED : IMPORTANCE_NONE);
+                updateChannel(pkg, uid, defaultChannel);
+            }
             sINM.setNotificationsEnabledForPackage(pkg, uid, enabled);
             return true;
         } catch (Exception e) {
diff --git a/src/com/android/settings/notification/NotificationSettingsBase.java b/src/com/android/settings/notification/NotificationSettingsBase.java
index 18b77bc..09789f3 100644
--- a/src/com/android/settings/notification/NotificationSettingsBase.java
+++ b/src/com/android/settings/notification/NotificationSettingsBase.java
@@ -74,6 +74,7 @@
 import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 
@@ -252,30 +253,6 @@
         return null;
     }
 
-    protected void populateGroupToggle(final PreferenceGroup parent,
-            NotificationChannelGroup group) {
-        RestrictedSwitchPreference preference = new RestrictedSwitchPreference(getPrefContext());
-        preference.setTitle(R.string.notification_switch_label);
-        preference.setEnabled(mSuspendedAppsAdmin == null
-                && isChannelGroupBlockable(group));
-        preference.setChecked(!group.isBlocked());
-        preference.setOnPreferenceClickListener(preference1 -> {
-            final boolean allowGroup = ((SwitchPreference) preference1).isChecked();
-            group.setBlocked(!allowGroup);
-            mBackend.updateChannelGroup(mAppRow.pkg, mAppRow.uid, group);
-
-            for (int i = 0; i < parent.getPreferenceCount(); i++) {
-                Preference pref = parent.getPreference(i);
-                if (pref instanceof MasterSwitchPreference) {
-                    ((MasterSwitchPreference) pref).setSwitchEnabled(allowGroup);
-                }
-            }
-            return true;
-        });
-
-        parent.addPreference(preference);
-    }
-
     protected Preference populateSingleChannelPrefs(PreferenceGroup parent,
             final NotificationChannel channel, final boolean groupBlocked) {
         MasterCheckBoxPreference channelPref = new MasterCheckBoxPreference(
diff --git a/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java b/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
index 3240ae0..279dcd3 100644
--- a/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
+++ b/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
@@ -21,6 +21,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageManager;
+import android.os.Bundle;
 import android.os.UserHandle;
 import android.service.notification.NotifyingApp;
 import android.support.annotation.VisibleForTesting;
@@ -32,6 +33,7 @@
 import android.util.ArraySet;
 import android.util.IconDrawableFactory;
 import android.util.Log;
+import android.widget.Switch;
 
 import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
@@ -40,6 +42,7 @@
 import com.android.settings.applications.InstalledAppCounter;
 import com.android.settings.core.PreferenceControllerMixin;
 import com.android.settings.widget.AppPreference;
+import com.android.settings.widget.MasterSwitchPreference;
 import com.android.settingslib.applications.AppUtils;
 import com.android.settingslib.applications.ApplicationsState;
 import com.android.settingslib.core.AbstractPreferenceController;
@@ -197,13 +200,13 @@
 
         // Rebind prefs/avoid adding new prefs if possible. Adding/removing prefs causes jank.
         // Build a cached preference pool
-        final Map<String, Preference> appPreferences = new ArrayMap<>();
+        final Map<String, NotificationAppPreference> appPreferences = new ArrayMap<>();
         int prefCount = mCategory.getPreferenceCount();
         for (int i = 0; i < prefCount; i++) {
             final Preference pref = mCategory.getPreference(i);
             final String key = pref.getKey();
             if (!TextUtils.equals(key, KEY_SEE_ALL)) {
-                appPreferences.put(key, pref);
+                appPreferences.put(key, (NotificationAppPreference) pref);
             }
         }
         final int recentAppsCount = recentApps.size();
@@ -218,9 +221,9 @@
             }
 
             boolean rebindPref = true;
-            Preference pref = appPreferences.remove(pkgName);
+            NotificationAppPreference pref = appPreferences.remove(pkgName);
             if (pref == null) {
-                pref = new AppPreference(prefContext);
+                pref = new NotificationAppPreference(prefContext);
                 rebindPref = false;
             }
             pref.setKey(pkgName);
@@ -229,13 +232,23 @@
             pref.setSummary(Utils.formatRelativeTime(mContext,
                     System.currentTimeMillis() - app.getLastNotified(), false));
             pref.setOrder(i);
-            pref.setOnPreferenceClickListener(preference -> {
-                AppInfoBase.startAppInfoFragment(AppNotificationSettings.class,
-                        R.string.notifications_title, pkgName, appEntry.info.uid, mHost,
-                        1001 /*RequestCode */,
-                        MetricsProto.MetricsEvent.MANAGE_APPLICATIONS_NOTIFICATIONS);
-                    return true;
+            Bundle args = new Bundle();
+            args.putString(AppInfoBase.ARG_PACKAGE_NAME, pkgName);
+            args.putInt(AppInfoBase.ARG_PACKAGE_UID, appEntry.info.uid);
+
+            pref.setIntent(Utils.onBuildStartFragmentIntent(mHost.getActivity(),
+                    AppNotificationSettings.class.getName(), args, null,
+                    R.string.notifications_title, null, false,
+                    MetricsProto.MetricsEvent.MANAGE_APPLICATIONS_NOTIFICATIONS));
+            pref.setOnPreferenceChangeListener((preference, newValue) -> {
+                boolean blocked = !(Boolean) newValue;
+                mNotificationBackend.setNotificationsEnabledForPackage(
+                        pkgName, appEntry.info.uid, !blocked);
+                return true;
             });
+            pref.setChecked(
+                    !mNotificationBackend.getNotificationsBanned(pkgName, appEntry.info.uid));
+
             if (!rebindPref) {
                 mCategory.addPreference(pref);
             }
diff --git a/tests/robotests/src/com/android/settings/notification/BlockPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/BlockPreferenceControllerTest.java
index d6df612..7327d01 100644
--- a/tests/robotests/src/com/android/settings/notification/BlockPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/BlockPreferenceControllerTest.java
@@ -29,7 +29,9 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.times;
@@ -238,19 +240,26 @@
     @Test
     public void testOnSwitchChanged_channel_default() throws Exception {
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
+        appRow.pkg = "pkg";
         NotificationChannel channel =
                 new NotificationChannel(DEFAULT_CHANNEL_ID, "a", IMPORTANCE_UNSPECIFIED);
+        when(mBackend.onlyHasDefaultChannel(anyString(), anyInt())).thenReturn(true);
         mController.onResume(appRow, channel, null, null);
         mController.updateState(mPreference);
 
         mController.onSwitchChanged(null, false);
         assertEquals(IMPORTANCE_NONE, channel.getImportance());
+        assertTrue(appRow.banned);
 
         mController.onSwitchChanged(null, true);
         assertEquals(IMPORTANCE_UNSPECIFIED, channel.getImportance());
+        assertFalse(appRow.banned);
 
         verify(mBackend, times(2)).updateChannel(any(), anyInt(), any());
 
+        // 2 calls for onSwitchChanged + once when calling updateState originally
+        verify(mBackend, times(3)).setNotificationsEnabledForPackage(
+                anyString(), anyInt(), anyBoolean());
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationAppPreferenceTest.java b/tests/robotests/src/com/android/settings/notification/NotificationAppPreferenceTest.java
new file mode 100644
index 0000000..dc8ee13
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/notification/NotificationAppPreferenceTest.java
@@ -0,0 +1,239 @@
+/*
+ * Copyright (C) 2018 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 static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+import android.content.Context;
+import android.support.v7.preference.Preference;
+import android.support.v7.preference.PreferenceViewHolder;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.Switch;
+
+import com.android.settings.R;
+import com.android.settings.TestConfig;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settingslib.RestrictedLockUtils;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+
+
+@RunWith(SettingsRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class NotificationAppPreferenceTest {
+
+    private Context mContext;
+
+    @Before
+    public void setUp() {
+        mContext = RuntimeEnvironment.application;
+    }
+
+    @Test
+    public void createNewPreference_shouldSetLayout() {
+        final NotificationAppPreference preference = new NotificationAppPreference(mContext);
+        assertThat(preference.getWidgetLayoutResource()).isEqualTo(
+                R.layout.preference_widget_master_switch);
+    }
+
+    @Test
+    public void setChecked_shouldUpdateButtonCheckedState() {
+        final NotificationAppPreference preference = new NotificationAppPreference(mContext);
+        final LayoutInflater inflater = LayoutInflater.from(mContext);
+        final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
+                inflater.inflate(R.layout.preference_app, null));
+        final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
+        inflater.inflate(R.layout.preference_widget_master_switch, widgetView, true);
+        final Switch toggle = (Switch) holder.findViewById(R.id.switchWidget);
+        preference.onBindViewHolder(holder);
+
+        preference.setChecked(true);
+        assertThat(toggle.isChecked()).isTrue();
+
+        preference.setChecked(false);
+        assertThat(toggle.isChecked()).isFalse();
+    }
+
+    @Test
+    public void setSwitchEnabled_shouldUpdateButtonEnabledState() {
+        final NotificationAppPreference preference = new NotificationAppPreference(mContext);
+        final LayoutInflater inflater = LayoutInflater.from(mContext);
+        final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
+                inflater.inflate(R.layout.preference_app, null));
+        final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
+        inflater.inflate(R.layout.preference_widget_master_switch, widgetView, true);
+        final Switch toggle = (Switch) holder.findViewById(R.id.switchWidget);
+        preference.onBindViewHolder(holder);
+
+        preference.setSwitchEnabled(true);
+        assertThat(toggle.isEnabled()).isTrue();
+
+        preference.setSwitchEnabled(false);
+        assertThat(toggle.isEnabled()).isFalse();
+    }
+
+    @Test
+    public void setSwitchEnabled_shouldUpdateButtonEnabledState_beforeViewBound() {
+        final NotificationAppPreference preference = new NotificationAppPreference(mContext);
+        final LayoutInflater inflater = LayoutInflater.from(mContext);
+        final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
+                inflater.inflate(R.layout.preference_app, null));
+        final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
+        inflater.inflate(R.layout.preference_widget_master_switch, widgetView, true);
+        final Switch toggle = (Switch) holder.findViewById(R.id.switchWidget);
+
+        preference.setSwitchEnabled(false);
+        preference.onBindViewHolder(holder);
+        assertThat(toggle.isEnabled()).isFalse();
+    }
+
+    @Test
+    public void clickWidgetView_shouldToggleButton() {
+        final NotificationAppPreference preference = new NotificationAppPreference(mContext);
+        final LayoutInflater inflater = LayoutInflater.from(mContext);
+        final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
+                inflater.inflate(R.layout.preference_app, null));
+        final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
+        inflater.inflate(R.layout.preference_widget_master_switch, widgetView, true);
+        final Switch toggle = (Switch) holder.findViewById(R.id.switchWidget);
+        preference.onBindViewHolder(holder);
+
+        widgetView.performClick();
+        assertThat(toggle.isChecked()).isTrue();
+
+        widgetView.performClick();
+        assertThat(toggle.isChecked()).isFalse();
+    }
+
+    @Test
+    public void clickWidgetView_shouldNotToggleButtonIfDisabled() {
+        final NotificationAppPreference preference = new NotificationAppPreference(mContext);
+        final LayoutInflater inflater = LayoutInflater.from(mContext);
+        final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
+                inflater.inflate(R.layout.preference_app, null));
+        final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
+        inflater.inflate(R.layout.preference_widget_master_switch, widgetView, true);
+        final Switch toggle = (Switch) holder.findViewById(R.id.switchWidget);
+        preference.onBindViewHolder(holder);
+        toggle.setEnabled(false);
+
+        widgetView.performClick();
+        assertThat(toggle.isChecked()).isFalse();
+    }
+
+    @Test
+    public void clickWidgetView_shouldNotifyPreferenceChanged() {
+        final NotificationAppPreference preference = new NotificationAppPreference(mContext);
+        final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
+                LayoutInflater.from(mContext).inflate(R.layout.preference_app, null));
+        final View widgetView = holder.findViewById(android.R.id.widget_frame);
+        final Preference.OnPreferenceChangeListener
+                listener = mock(Preference.OnPreferenceChangeListener.class);
+        preference.setOnPreferenceChangeListener(listener);
+        preference.onBindViewHolder(holder);
+
+        preference.setChecked(false);
+        widgetView.performClick();
+        verify(listener).onPreferenceChange(preference, true);
+
+        preference.setChecked(true);
+        widgetView.performClick();
+        verify(listener).onPreferenceChange(preference, false);
+    }
+
+    @Test
+    public void setDisabledByAdmin_hasEnforcedAdmin_shouldDisableButton() {
+        final NotificationAppPreference preference = new NotificationAppPreference(mContext);
+        final LayoutInflater inflater = LayoutInflater.from(mContext);
+        final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
+                inflater.inflate(R.layout.preference_app, null));
+        final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
+        inflater.inflate(R.layout.preference_widget_master_switch, widgetView, true);
+        final Switch toggle = (Switch) holder.findViewById(R.id.switchWidget);
+        toggle.setEnabled(true);
+        preference.onBindViewHolder(holder);
+
+        preference.setDisabledByAdmin(mock(RestrictedLockUtils.EnforcedAdmin.class));
+        assertThat(toggle.isEnabled()).isFalse();
+    }
+
+    @Test
+    public void setDisabledByAdmin_noEnforcedAdmin_shouldEnableButton() {
+        final NotificationAppPreference preference = new NotificationAppPreference(mContext);
+        final LayoutInflater inflater = LayoutInflater.from(mContext);
+        final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
+                inflater.inflate(R.layout.preference_app, null));
+        final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
+        inflater.inflate(R.layout.preference_widget_master_switch, widgetView, true);
+        final Switch toggle = (Switch) holder.findViewById(R.id.switchWidget);
+        toggle.setEnabled(false);
+        preference.onBindViewHolder(holder);
+
+        preference.setDisabledByAdmin(null);
+        assertThat(toggle.isEnabled()).isTrue();
+    }
+
+    @Test
+    public void onBindViewHolder_toggleButtonShouldHaveContentDescription() {
+        final NotificationAppPreference preference = new NotificationAppPreference(mContext);
+        final LayoutInflater inflater = LayoutInflater.from(mContext);
+        final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
+                inflater.inflate(R.layout.preference_app, null));
+        final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
+        inflater.inflate(R.layout.preference_widget_master_switch, widgetView, true);
+        final Switch toggle = (Switch) holder.findViewById(R.id.switchWidget);
+        final String label = "TestButton";
+        preference.setTitle(label);
+
+        preference.onBindViewHolder(holder);
+
+        assertThat(toggle.getContentDescription()).isEqualTo(label);
+    }
+
+    @Test
+    public void setSummary_showSummaryContainer() {
+        final NotificationAppPreference preference = new NotificationAppPreference(mContext);
+        View rootView = View.inflate(mContext, R.layout.preference_app, null /* parent */);
+        PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(rootView);
+        preference.setSummary("test");
+        preference.onBindViewHolder(holder);
+
+        assertThat(holder.findViewById(R.id.summary_container).getVisibility())
+                .isEqualTo(View.VISIBLE);
+    }
+
+    @Test
+    public void noSummary_hideSummaryContainer() {
+        final NotificationAppPreference preference = new NotificationAppPreference(mContext);
+        View rootView = View.inflate(mContext, R.layout.preference_app, null /* parent */);
+        PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(rootView);
+        preference.setSummary(null);
+        preference.onBindViewHolder(holder);
+
+        assertThat(holder.findViewById(R.id.summary_container).getVisibility())
+                .isEqualTo(View.GONE);
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/notification/RecentNotifyingAppsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/RecentNotifyingAppsPreferenceControllerTest.java
index a25bb00..1aa963d 100644
--- a/tests/robotests/src/com/android/settings/notification/RecentNotifyingAppsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/RecentNotifyingAppsPreferenceControllerTest.java
@@ -31,7 +31,9 @@
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import android.app.Activity;
 import android.app.Application;
+import android.app.Fragment;
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.ApplicationInfo;
@@ -90,6 +92,10 @@
     private ApplicationInfo mApplicationInfo;
     @Mock
     private NotificationBackend mBackend;
+    @Mock
+    private Fragment mHost;
+    @Mock
+    private Activity mActivity;
 
     private Context mContext;
     private RecentNotifyingAppsPreferenceController mController;
@@ -102,7 +108,7 @@
         doReturn(mPackageManager).when(mContext).getPackageManager();
 
         mController = new RecentNotifyingAppsPreferenceController(
-                mContext, mBackend, mAppState, null);
+                mContext, mBackend, mAppState, mHost);
         when(mScreen.findPreference(anyString())).thenReturn(mCategory);
 
         when(mScreen.findPreference(RecentNotifyingAppsPreferenceController.KEY_SEE_ALL))
@@ -110,6 +116,7 @@
         when(mScreen.findPreference(RecentNotifyingAppsPreferenceController.KEY_DIVIDER))
                 .thenReturn(mDivider);
         when(mCategory.getContext()).thenReturn(mContext);
+        when(mHost.getActivity()).thenReturn(mActivity);
     }
 
     @Test
