diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2857bf5..8839323 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -9030,6 +9030,7 @@
     <string name="notif_listener_excluded_app_title">See all apps</string>
     <string name="notif_listener_excluded_app_summary">Change notification settings for each app that can send notifications</string>
     <string name="notif_listener_excluded_app_screen_title">Apps shown on device</string>
+    <string name="notif_listener_not_migrated">This app doesn\u2019t support enhanced settings</string>
 
     <!-- Title for managing VR (virtual reality) helper services. [CHAR LIMIT=50] -->
     <string name="vr_listeners_title">VR helper services</string>
diff --git a/res/xml/accessibility_settings.xml b/res/xml/accessibility_settings.xml
index bebb336..ac51a82 100644
--- a/res/xml/accessibility_settings.xml
+++ b/res/xml/accessibility_settings.xml
@@ -44,7 +44,7 @@
             settings:searchable="true"/>
 
         <!--TODO(b/170973645): Get icon-->
-        <Preference
+        <com.android.settings.widget.PrimarySwitchPreference
             android:fragment="com.android.settings.accessibility.ToggleReduceBrightColorsPreferenceFragment"
             android:key="reduce_bright_colors_preference"
             android:persistent="false"
diff --git a/res/xml/notification_access_permission_details.xml b/res/xml/notification_access_permission_details.xml
index c4bb7f0..cec383c 100644
--- a/res/xml/notification_access_permission_details.xml
+++ b/res/xml/notification_access_permission_details.xml
@@ -62,6 +62,13 @@
         android:summary="@string/notif_listener_excluded_app_summary"
         android:fragment="com.android.settings.applications.specialaccess.notificationaccess.BridgedAppsSettings"
         settings:searchable="false"
-        settings:controller="com.android.settings.applications.specialaccess.notificationaccess.BridgedAppsPreferenceController" />
+        settings:controller="com.android.settings.applications.specialaccess.notificationaccess.BridgedAppsLinkPreferenceController" />
+
+    <com.android.settingslib.widget.FooterPreference
+        android:key="notif_listener_not_migrated"
+        android:title="@string/notif_listener_not_migrated"
+        settings:controller="com.android.settings.applications.specialaccess.notificationaccess.PreUpgradePreferenceController"
+        android:selectable="false"
+        settings:searchable="false"/>
 
 </PreferenceScreen>
\ No newline at end of file
diff --git a/src/com/android/settings/accessibility/ReduceBrightColorsPreferenceController.java b/src/com/android/settings/accessibility/ReduceBrightColorsPreferenceController.java
index bfe61b7..037969d 100644
--- a/src/com/android/settings/accessibility/ReduceBrightColorsPreferenceController.java
+++ b/src/com/android/settings/accessibility/ReduceBrightColorsPreferenceController.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2020 The Android Open Source Project
+ * Copyright (C) 2021 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.
@@ -17,17 +17,60 @@
 package com.android.settings.accessibility;
 
 import android.content.Context;
+import android.database.ContentObserver;
 import android.hardware.display.ColorDisplayManager;
+import android.net.Uri;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.UserHandle;
+import android.provider.Settings;
+import android.text.TextUtils;
+
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
 
 import com.android.settings.R;
-import com.android.settings.core.BasePreferenceController;
+import com.android.settings.core.TogglePreferenceController;
+import com.android.settings.widget.PrimarySwitchPreference;
+import com.android.settingslib.core.lifecycle.LifecycleObserver;
+import com.android.settingslib.core.lifecycle.events.OnStart;
+import com.android.settingslib.core.lifecycle.events.OnStop;
 
 /** PreferenceController that shows the Reduce Bright Colors summary */
-public class ReduceBrightColorsPreferenceController extends BasePreferenceController {
+public class ReduceBrightColorsPreferenceController extends TogglePreferenceController
+        implements LifecycleObserver, OnStart, OnStop {
+    private ContentObserver mSettingsContentObserver;
+    private PrimarySwitchPreference mPreference;
+    private final Context mContext;
 
     public ReduceBrightColorsPreferenceController(Context context,
             String preferenceKey) {
         super(context, preferenceKey);
+        mContext = context;
+        mSettingsContentObserver = new ContentObserver(new Handler(Looper.getMainLooper())){
+            @Override
+            public void onChange(boolean selfChange, Uri uri) {
+                final String path = uri == null ? null : uri.getLastPathSegment();
+                if (TextUtils.equals(path, Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED)) {
+                    updateState(mPreference);
+                }
+            }
+        };
+    }
+
+    @Override
+    public boolean isChecked() {
+        return Settings.Secure.getIntForUser(mContext.getContentResolver(),
+                Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED,
+                0,
+                UserHandle.USER_CURRENT) == 1;
+    }
+
+    @Override
+    public boolean setChecked(boolean isChecked) {
+        return Settings.Secure.putIntForUser(mContext.getContentResolver(),
+                Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED, isChecked ? 1 : 0,
+                UserHandle.USER_CURRENT);
     }
 
     @Override
@@ -37,8 +80,31 @@
     }
 
     @Override
+    public void updateState(Preference preference) {
+        super.updateState(preference);
+        refreshSummary(preference);
+    }
+
+    @Override
     public int getAvailabilityStatus() {
         return ColorDisplayManager.isColorTransformAccelerated(mContext) ? AVAILABLE
                 : UNSUPPORTED_ON_DEVICE;
     }
+
+    @Override
+    public void displayPreference(PreferenceScreen screen) {
+        super.displayPreference(screen);
+        mPreference = screen.findPreference(getPreferenceKey());
+    }
+
+    @Override
+    public void onStart() {
+        mContext.getContentResolver().registerContentObserver(Settings.Secure.getUriFor(
+                Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED),
+                false, mSettingsContentObserver, UserHandle.USER_CURRENT);
+    }
+    @Override
+    public void onStop() {
+        mContext.getContentResolver().unregisterContentObserver(mSettingsContentObserver);
+    }
 }
diff --git a/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsLinkPreferenceController.java b/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsLinkPreferenceController.java
new file mode 100644
index 0000000..1c787ba
--- /dev/null
+++ b/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsLinkPreferenceController.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2021 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.applications.specialaccess.notificationaccess;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.os.Build;
+import android.service.notification.NotificationListenerFilter;
+
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.notification.NotificationBackend;
+
+
+public class BridgedAppsLinkPreferenceController extends BasePreferenceController {
+
+    private ComponentName mCn;
+    private int mUserId;
+    private NotificationBackend mNm;
+    private NotificationListenerFilter mNlf;
+    private int mTargetSdk;
+
+    public BridgedAppsLinkPreferenceController(Context context, String key) {
+        super(context, key);
+    }
+
+
+    public BridgedAppsLinkPreferenceController setCn(ComponentName cn) {
+        mCn = cn;
+        return this;
+    }
+
+    public BridgedAppsLinkPreferenceController setUserId(int userId) {
+        mUserId = userId;
+        return this;
+    }
+
+    public BridgedAppsLinkPreferenceController setNm(NotificationBackend nm) {
+        mNm = nm;
+        return this;
+    }
+
+    public BridgedAppsLinkPreferenceController setTargetSdk(int targetSdk) {
+        mTargetSdk = targetSdk;
+        return this;
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        if (mNm.isNotificationListenerAccessGranted(mCn)) {
+            if (mTargetSdk > Build.VERSION_CODES.S) {
+                return AVAILABLE;
+            }
+
+            mNlf = mNm.getListenerFilter(mCn, mUserId);
+            if (!mNlf.areAllTypesAllowed() || !mNlf.getDisallowedPackages().isEmpty()) {
+                return AVAILABLE;
+            }
+        }
+        return DISABLED_DEPENDENT_SETTING;
+    }
+}
diff --git a/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsPreferenceController.java b/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsPreferenceController.java
index 7ff3c9c..c56f630 100644
--- a/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsPreferenceController.java
+++ b/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsPreferenceController.java
@@ -16,14 +16,11 @@
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.pm.VersionedPackage;
-import android.os.UserHandle;
 import android.service.notification.NotificationListenerFilter;
 
-import androidx.annotation.VisibleForTesting;
 import androidx.preference.CheckBoxPreference;
 import androidx.preference.Preference;
 import androidx.preference.PreferenceScreen;
-import androidx.preference.SwitchPreference;
 
 import com.android.settings.applications.AppStateBaseBridge;
 import com.android.settings.core.BasePreferenceController;
@@ -126,9 +123,6 @@
         final int N = apps.size();
         for (int i = 0; i < N; i++) {
             final AppEntry entry = apps.get(i);
-            if (!shouldAddPreference(entry)) {
-                continue;
-            }
             final String prefKey = entry.info.packageName + "|" + entry.info.uid;
             appsKeySet.add(prefKey);
             CheckBoxPreference preference = mScreen.findPreference(prefKey);
@@ -211,9 +205,4 @@
             }
         }
     }
-
-    @VisibleForTesting
-    static boolean shouldAddPreference(AppEntry app) {
-        return app != null && UserHandle.isApp(app.info.uid);
-    }
 }
diff --git a/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsSettings.java b/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsSettings.java
index d396a01..21497eb 100644
--- a/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsSettings.java
+++ b/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsSettings.java
@@ -69,7 +69,7 @@
             case MENU_SHOW_SYSTEM:
                 mShowSystem = !mShowSystem;
                 item.setTitle(mShowSystem ? R.string.menu_hide_system : R.string.menu_show_system);
-                mFilter = mShowSystem ? ApplicationsState.FILTER_ALL_ENABLED
+                mFilter = mShowSystem ? ApplicationsState.FILTER_NOT_HIDE
                         : ApplicationsState.FILTER_DOWNLOADED_AND_LAUNCHER;
 
                 use(BridgedAppsPreferenceController.class).setFilter(mFilter).rebuild();
diff --git a/src/com/android/settings/applications/specialaccess/notificationaccess/NotificationAccessDetails.java b/src/com/android/settings/applications/specialaccess/notificationaccess/NotificationAccessDetails.java
index 1ac578d..9e03657 100644
--- a/src/com/android/settings/applications/specialaccess/notificationaccess/NotificationAccessDetails.java
+++ b/src/com/android/settings/applications/specialaccess/notificationaccess/NotificationAccessDetails.java
@@ -22,6 +22,8 @@
 import android.app.NotificationManager;
 import android.app.settings.SettingsEnums;
 import android.companion.ICompanionDeviceManager;
+import android.compat.annotation.ChangeId;
+import android.compat.annotation.EnabledAfter;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
@@ -29,6 +31,7 @@
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.content.pm.ServiceInfo;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.ServiceManager;
 import android.os.UserHandle;
@@ -88,11 +91,18 @@
         mPm = getPackageManager();
         retrieveAppEntry();
         loadNotificationListenerService();
+        NotificationBackend backend = new NotificationBackend();
+        int listenerTargetSdk = Build.VERSION_CODES.S;
+        try {
+            listenerTargetSdk = mPm.getTargetSdkVersion(mComponentName.getPackageName());
+        } catch (PackageManager.NameNotFoundException e){
+            // how did we get here?
+        }
         use(ApprovalPreferenceController.class)
                 .setPkgInfo(mPackageInfo)
                 .setCn(mComponentName)
                 .setNm(context.getSystemService(NotificationManager.class))
-                .setPm(context.getPackageManager())
+                .setPm(mPm)
                 .setParent(this);
         use(HeaderPreferenceController.class)
                 .setFragment(this)
@@ -104,15 +114,27 @@
                         ServiceManager.getService(Context.COMPANION_DEVICE_SERVICE)))
                 .setCn(mComponentName)
                 .setUserId(mUserId);
+        use(PreUpgradePreferenceController.class)
+                .setNm(backend)
+                .setCn(mComponentName)
+                .setUserId(mUserId)
+                .setTargetSdk(listenerTargetSdk);
+        use(BridgedAppsLinkPreferenceController.class)
+                .setNm(backend)
+                .setCn(mComponentName)
+                .setUserId(mUserId)
+                .setTargetSdk(listenerTargetSdk);
+        final int finalListenerTargetSdk = listenerTargetSdk;
         getPreferenceControllers().forEach(controllers -> {
             controllers.forEach(controller -> {
                 if (controller instanceof TypeFilterPreferenceController) {
                     TypeFilterPreferenceController tfpc =
                             (TypeFilterPreferenceController) controller;
-                    tfpc.setNm(new NotificationBackend())
+                    tfpc.setNm(backend)
                             .setCn(mComponentName)
                             .setServiceInfo(mServiceInfo)
-                            .setUserId(mUserId);
+                            .setUserId(mUserId)
+                            .setTargetSdk(finalListenerTargetSdk);
                 }
             });
         });
@@ -154,7 +176,7 @@
             setIntentAndFinish(true /* appChanged */);
         }
         Preference apps = getPreferenceScreen().findPreference(
-                use(BridgedAppsPreferenceController.class).getPreferenceKey());
+                use(BridgedAppsLinkPreferenceController.class).getPreferenceKey());
         if (apps != null) {
 
             apps.setOnPreferenceClickListener(preference -> {
diff --git a/src/com/android/settings/applications/specialaccess/notificationaccess/PreUpgradePreferenceController.java b/src/com/android/settings/applications/specialaccess/notificationaccess/PreUpgradePreferenceController.java
new file mode 100644
index 0000000..743fd55
--- /dev/null
+++ b/src/com/android/settings/applications/specialaccess/notificationaccess/PreUpgradePreferenceController.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2021 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.applications.specialaccess.notificationaccess;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.os.Build;
+import android.service.notification.NotificationListenerFilter;
+
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.notification.NotificationBackend;
+
+public class PreUpgradePreferenceController extends BasePreferenceController {
+
+    private ComponentName mCn;
+    private int mUserId;
+    private NotificationBackend mNm;
+    private NotificationListenerFilter mNlf;
+    private int mTargetSdk;
+
+    public PreUpgradePreferenceController(Context context, String key) {
+        super(context, key);
+    }
+
+    public PreUpgradePreferenceController setCn(ComponentName cn) {
+        mCn = cn;
+        return this;
+    }
+
+    public PreUpgradePreferenceController setUserId(int userId) {
+        mUserId = userId;
+        return this;
+    }
+
+    public PreUpgradePreferenceController setNm(NotificationBackend nm) {
+        mNm = nm;
+        return this;
+    }
+
+    public PreUpgradePreferenceController setTargetSdk(int targetSdk) {
+        mTargetSdk = targetSdk;
+        return this;
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        if (mNm.isNotificationListenerAccessGranted(mCn)) {
+            mNlf = mNm.getListenerFilter(mCn, mUserId);
+
+            if (mTargetSdk > Build.VERSION_CODES.S) {
+                return CONDITIONALLY_UNAVAILABLE;
+            }
+
+            if (!mNlf.areAllTypesAllowed() || !mNlf.getDisallowedPackages().isEmpty()) {
+                return CONDITIONALLY_UNAVAILABLE;
+            }
+            return AVAILABLE;
+        } else {
+            return CONDITIONALLY_UNAVAILABLE;
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/com/android/settings/applications/specialaccess/notificationaccess/TypeFilterPreferenceController.java b/src/com/android/settings/applications/specialaccess/notificationaccess/TypeFilterPreferenceController.java
index a5ac1e1..68c342b 100644
--- a/src/com/android/settings/applications/specialaccess/notificationaccess/TypeFilterPreferenceController.java
+++ b/src/com/android/settings/applications/specialaccess/notificationaccess/TypeFilterPreferenceController.java
@@ -19,6 +19,7 @@
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.pm.ServiceInfo;
+import android.os.Build;
 import android.service.notification.NotificationListenerFilter;
 import android.service.notification.NotificationListenerService;
 import android.text.TextUtils;
@@ -41,6 +42,7 @@
     private NotificationBackend mNm;
     private NotificationListenerFilter mNlf;
     private ServiceInfo mSi;
+    private int mTargetSdk;
 
     public TypeFilterPreferenceController(Context context, String key) {
         super(context, key);
@@ -66,15 +68,26 @@
         return this;
     }
 
+    public TypeFilterPreferenceController setTargetSdk(int targetSdk) {
+        mTargetSdk = targetSdk;
+        return this;
+    }
+
     abstract protected int getType();
 
     @Override
     public int getAvailabilityStatus() {
         if (mNm.isNotificationListenerAccessGranted(mCn)) {
-            return AVAILABLE;
-        } else {
-            return DISABLED_DEPENDENT_SETTING;
+            if (mTargetSdk > Build.VERSION_CODES.S) {
+                return AVAILABLE;
+            }
+
+            mNlf = mNm.getListenerFilter(mCn, mUserId);
+            if (!mNlf.areAllTypesAllowed() || !mNlf.getDisallowedPackages().isEmpty()) {
+                return AVAILABLE;
+            }
         }
+        return DISABLED_DEPENDENT_SETTING;
     }
 
     private boolean hasFlag(int value, int flag) {
diff --git a/tests/robotests/src/com/android/settings/accessibility/ReduceBrightColorsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accessibility/ReduceBrightColorsPreferenceControllerTest.java
index 01942f0..325e6a8 100644
--- a/tests/robotests/src/com/android/settings/accessibility/ReduceBrightColorsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/ReduceBrightColorsPreferenceControllerTest.java
@@ -19,6 +19,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import android.content.Context;
+import android.provider.Settings;
 
 import androidx.test.core.app.ApplicationProvider;
 import androidx.test.ext.junit.runners.AndroidJUnit4;
@@ -31,7 +32,6 @@
 @RunWith(AndroidJUnit4.class)
 public class ReduceBrightColorsPreferenceControllerTest {
     private static final String PREF_KEY = "rbc_preference";
-
     private final Context mContext = ApplicationProvider.getApplicationContext();
     private final ReduceBrightColorsPreferenceController mController =
             new ReduceBrightColorsPreferenceController(mContext, PREF_KEY);
@@ -41,4 +41,18 @@
         assertThat(mController.getSummary().toString().contains(
                 mContext.getText(R.string.reduce_bright_colors_preference_summary))).isTrue();
     }
+
+    @Test
+    public void isChecked_reduceBrightColorsIsActivated_returnTrue() {
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED, 1);
+        assertThat(mController.isChecked()).isTrue();
+    }
+
+    @Test
+    public void isChecked_reduceBrightColorsIsNotActivated_returnFalse() {
+        Settings.Secure.putInt(mContext.getContentResolver(),
+                Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED, 0);
+        assertThat(mController.isChecked()).isFalse();
+    }
 }
diff --git a/tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsLinkPreferenceControllerTest.java b/tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsLinkPreferenceControllerTest.java
new file mode 100644
index 0000000..c594131
--- /dev/null
+++ b/tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/BridgedAppsLinkPreferenceControllerTest.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2021 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.applications.specialaccess.notificationaccess;
+
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_CONVERSATIONS;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.DISABLED_DEPENDENT_SETTING;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.os.Build;
+import android.service.notification.NotificationListenerFilter;
+
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import com.android.settings.notification.NotificationBackend;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+public class BridgedAppsLinkPreferenceControllerTest {
+
+    private Context mContext;
+    private BridgedAppsLinkPreferenceController mController;
+    @Mock
+    NotificationBackend mNm;
+    ComponentName mCn = new ComponentName("a", "b");
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = ApplicationProvider.getApplicationContext();
+
+        mController = new BridgedAppsLinkPreferenceController(mContext, "key");
+        mController.setCn(mCn);
+        mController.setNm(mNm);
+        mController.setUserId(0);
+    }
+
+    @Test
+    public void testAvailable_notGranted() {
+        when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(false);
+        mController.setTargetSdk(Build.VERSION_CODES.CUR_DEVELOPMENT + 1);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(DISABLED_DEPENDENT_SETTING);
+    }
+
+    @Test
+    public void testAvailable_lowTargetSdk_noCustomizations() {
+        when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true);
+        mController.setTargetSdk(Build.VERSION_CODES.S);
+        when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter());
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(DISABLED_DEPENDENT_SETTING);
+    }
+
+    @Test
+    public void testAvailable_lowTargetSdk_customizations() {
+        when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true);
+        mController.setTargetSdk(Build.VERSION_CODES.S);
+        NotificationListenerFilter nlf = new NotificationListenerFilter();
+        nlf.setTypes(FLAG_FILTER_TYPE_CONVERSATIONS);
+        when(mNm.getListenerFilter(mCn, 0)).thenReturn(nlf);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+    }
+
+    @Test
+    public void testAvailable_highTargetSdk_noCustomizations() {
+        when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true);
+        mController.setTargetSdk(Build.VERSION_CODES.CUR_DEVELOPMENT + 1);
+        when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter());
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+    }
+}
diff --git a/tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/PreUpgradePreferenceControllerTest.java b/tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/PreUpgradePreferenceControllerTest.java
new file mode 100644
index 0000000..d4008d4
--- /dev/null
+++ b/tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/PreUpgradePreferenceControllerTest.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2021 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.applications.specialaccess.notificationaccess;
+
+import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_CONVERSATIONS;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.os.Build;
+import android.service.notification.NotificationListenerFilter;
+
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import com.android.settings.notification.NotificationBackend;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+public class PreUpgradePreferenceControllerTest {
+
+    private Context mContext;
+    private PreUpgradePreferenceController mController;
+    @Mock
+    NotificationBackend mNm;
+    ComponentName mCn = new ComponentName("a", "b");
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = ApplicationProvider.getApplicationContext();
+
+        mController = new PreUpgradePreferenceController(mContext, "key");
+        mController.setCn(mCn);
+        mController.setNm(mNm);
+        mController.setUserId(0);
+    }
+
+    @Test
+    public void testAvailable_notGranted() {
+        when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(false);
+        mController.setTargetSdk(Build.VERSION_CODES.S);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
+    }
+
+    @Test
+    public void testAvailable_lowTargetSdk_noCustomizations() {
+        when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true);
+        mController.setTargetSdk(Build.VERSION_CODES.S);
+        when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter());
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+    }
+
+    @Test
+    public void testAvailable_lowTargetSdk_customizations() {
+        when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true);
+        mController.setTargetSdk(Build.VERSION_CODES.S);
+        NotificationListenerFilter nlf = new NotificationListenerFilter();
+        nlf.setTypes(FLAG_FILTER_TYPE_CONVERSATIONS);
+        when(mNm.getListenerFilter(mCn, 0)).thenReturn(nlf);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
+    }
+
+    @Test
+    public void testAvailable_highTargetSdk_noCustomizations() {
+        when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true);
+        mController.setTargetSdk(Build.VERSION_CODES.CUR_DEVELOPMENT + 1);
+        when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter());
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
+    }
+}
diff --git a/tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/TypeFilterPreferenceControllerTest.java b/tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/TypeFilterPreferenceControllerTest.java
index d36f775..1aa8292 100644
--- a/tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/TypeFilterPreferenceControllerTest.java
+++ b/tests/unit/src/com/android/settings/applications/specialaccess/notificationaccess/TypeFilterPreferenceControllerTest.java
@@ -20,8 +20,12 @@
 import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_ONGOING;
 import static android.service.notification.NotificationListenerService.FLAG_FILTER_TYPE_SILENT;
 
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.DISABLED_DEPENDENT_SETTING;
+
 import static com.google.common.truth.Truth.assertThat;
 
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -29,6 +33,7 @@
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.pm.ServiceInfo;
+import android.os.Build;
 import android.os.Bundle;
 import android.service.notification.NotificationListenerFilter;
 import android.service.notification.NotificationListenerService;
@@ -81,6 +86,44 @@
         mController.setNm(mNm);
         mController.setServiceInfo(mSi);
         mController.setUserId(0);
+        mController.setTargetSdk(Build.VERSION_CODES.CUR_DEVELOPMENT + 1);
+    }
+
+    @Test
+    public void testAvailable_notGranted() {
+        when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(false);
+        mController.setTargetSdk(Build.VERSION_CODES.CUR_DEVELOPMENT + 1);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(DISABLED_DEPENDENT_SETTING);
+    }
+
+    @Test
+    public void testAvailable_lowTargetSdk_noCustomizations() {
+        when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true);
+        mController.setTargetSdk(Build.VERSION_CODES.S);
+        when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter());
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(DISABLED_DEPENDENT_SETTING);
+    }
+
+    @Test
+    public void testAvailable_lowTargetSdk_customizations() {
+        when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true);
+        mController.setTargetSdk(Build.VERSION_CODES.S);
+        NotificationListenerFilter nlf = new NotificationListenerFilter();
+        nlf.setTypes(FLAG_FILTER_TYPE_CONVERSATIONS);
+        when(mNm.getListenerFilter(mCn, 0)).thenReturn(nlf);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+    }
+
+    @Test
+    public void testAvailable_highTargetSdk_noCustomizations() {
+        when(mNm.isNotificationListenerAccessGranted(any())).thenReturn(true);
+        mController.setTargetSdk(Build.VERSION_CODES.CUR_DEVELOPMENT + 1);
+        when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter());
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
     }
 
     @Test
