diff --git a/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java b/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
index bd45884..8e0807d 100644
--- a/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
+++ b/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
@@ -29,7 +29,6 @@
 import android.service.notification.NotifyingApp;
 import android.text.TextUtils;
 import android.util.ArrayMap;
-import android.util.ArraySet;
 import android.util.IconDrawableFactory;
 import android.util.Slog;
 
@@ -56,8 +55,6 @@
 import java.util.Calendar;
 import java.util.Collections;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 /**
  * This controller displays a list of recently used apps and a "See all" button. If there is
@@ -149,9 +146,12 @@
 
     @VisibleForTesting
     void refreshUi(Context prefContext) {
-        ((PrimarySwitchPreference) mCategory.findPreference(KEY_PLACEHOLDER + 1)).setChecked(true);
-        ((PrimarySwitchPreference) mCategory.findPreference(KEY_PLACEHOLDER + 2)).setChecked(true);
-        ((PrimarySwitchPreference) mCategory.findPreference(KEY_PLACEHOLDER + 3)).setChecked(true);
+        for (int i = 1; i <= SHOW_RECENT_APP_COUNT; i++) {
+            PrimarySwitchPreference app = mCategory.findPreference(KEY_PLACEHOLDER + i);
+            if (app != null) {
+                app.setChecked(true);
+            }
+        }
         ThreadUtils.postOnBackgroundThread(() -> {
             reloadData();
             final List<NotifyingApp> recentApps = getDisplayableRecentAppList();
diff --git a/src/com/android/settings/notification/zen/ZenAccessSettings.java b/src/com/android/settings/notification/zen/ZenAccessSettings.java
index a951d83..e83983f 100644
--- a/src/com/android/settings/notification/zen/ZenAccessSettings.java
+++ b/src/com/android/settings/notification/zen/ZenAccessSettings.java
@@ -24,8 +24,11 @@
 import android.content.pm.PackageItemInfo;
 import android.content.pm.PackageManager;
 import android.os.Bundle;
+import android.os.UserHandle;
+import android.os.UserManager;
 import android.util.ArraySet;
 import android.view.View;
+import android.util.Log;
 
 import androidx.preference.PreferenceScreen;
 
@@ -92,6 +95,11 @@
     }
 
     private void reloadList() {
+        if (mContext.getSystemService(UserManager.class)
+                .isManagedProfile(UserHandle.myUserId())) {
+            Log.w(TAG, "DND access cannot be enabled in a work profile");
+            return;
+        }
         final PreferenceScreen screen = getPreferenceScreen();
         screen.removeAll();
         final ArrayList<ApplicationInfo> apps = new ArrayList<>();
diff --git a/tests/robotests/src/com/android/settings/notification/RecentNotifyingAppsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/RecentNotifyingAppsPreferenceControllerTest.java
index 983bf53..f6eb93b 100644
--- a/tests/robotests/src/com/android/settings/notification/RecentNotifyingAppsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/RecentNotifyingAppsPreferenceControllerTest.java
@@ -221,6 +221,42 @@
     }
 
     @Test
+    public void display_noCrashIfLessThan3() throws Exception {
+        List<Event> events = new ArrayList<>();
+        Event app = new Event();
+        app.mEventType = Event.NOTIFICATION_INTERRUPTION;
+        app.mPackage = "a";
+        app.mTimeStamp = System.currentTimeMillis();
+        events.add(app);
+        ApplicationsState.AppEntry app1Entry = mock(ApplicationsState.AppEntry.class);
+        app1Entry.info = mApplicationInfo;
+        app1Entry.label = "app 1";
+
+        when(mAppState.getEntry(app.getPackageName(), UserHandle.myUserId()))
+                .thenReturn(app1Entry);
+        when(mPackageManager.resolveActivity(any(Intent.class), anyInt())).thenReturn(
+                new ResolveInfo());
+
+        UsageEvents usageEvents = getUsageEvents(
+                new String[] {app.getPackageName()},
+                events);
+        when(mIUsageStatsManager.queryEventsForUser(anyLong(), anyLong(), anyInt(), anyString()))
+                .thenReturn(usageEvents);
+
+        mAppEntry.info = mApplicationInfo;
+
+        mController.displayPreference(mScreen);
+
+        verify(mCategory).setTitle(R.string.recent_notifications);
+        // Only add app1 & app2. app3 skipped because it's invalid app.
+        assertThat(mApp1.getTitle()).isEqualTo(app1Entry.label);
+
+        verify(mCategory).removePreferenceRecursively("app2");
+
+        mController.refreshUi(mContext);
+    }
+
+    @Test
     public void display_showRecentsWithInstantApp() throws Exception {
         List<Event> events = new ArrayList<>();
         Event app = new Event();
@@ -267,36 +303,13 @@
         mController.displayPreference(mScreen);
 
         assertThat(mApp1.getTitle()).isEqualTo(appEntry.label);
+        assertThat(mApp1.getSummary()).isEqualTo("Just now");
         assertThat(mApp2.getTitle()).isEqualTo(app1Entry.label);
 
         verify(mCategory).removePreferenceRecursively(mApp3.getKey());
     }
 
     @Test
-    public void display_showRecents_formatSummary() throws Exception {
-        List<Event> events = new ArrayList<>();
-        Event app = new Event();
-        app.mEventType = Event.NOTIFICATION_INTERRUPTION;
-        app.mPackage = "pkg.class";
-        app.mTimeStamp = System.currentTimeMillis();
-        events.add(app);
-        UsageEvents usageEvents = getUsageEvents(new String[] {"pkg.class"}, events);
-        when(mIUsageStatsManager.queryEventsForUser(anyLong(), anyLong(), anyInt(), anyString()))
-                .thenReturn(usageEvents);
-
-        when(mAppState.getEntry(app.getPackageName(), UserHandle.myUserId()))
-                .thenReturn(mAppEntry);
-        when(mPackageManager.resolveActivity(any(Intent.class), anyInt())).thenReturn(
-                new ResolveInfo());
-
-        mAppEntry.info = mApplicationInfo;
-
-        mController.displayPreference(mScreen);
-
-        assertThat(mApp1.getSummary()).isEqualTo("Just now");
-    }
-
-    @Test
     public void reloadData() throws Exception {
         when(mUserManager.getProfileIdsWithDisabled(0)).thenReturn(new int[] {0, 10});
 
