Merge "Fix crash when input illegal proxy port number" am: e8160af796 am: 6372ae5e93

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2255620

Change-Id: Ida3089a2375e04b653058b380c2fd9f1f56a9fcd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/res/drawable/ic_ring_volume.xml b/res/drawable/ic_ring_volume.xml
new file mode 100644
index 0000000..343fe5d
--- /dev/null
+++ b/res/drawable/ic_ring_volume.xml
@@ -0,0 +1,26 @@
+<!--
+    Copyright (C) 2022 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24"
+    android:tint="?android:attr/colorControlNormal">
+  <path
+      android:pathData="M11,7V2H13V7ZM17.6,9.85 L16.2,8.4 19.75,4.85 21.15,6.3ZM6.4,9.85 L2.85,6.3 4.25,4.85 7.8,8.4ZM12,12Q14.95,12 17.812,13.188Q20.675,14.375 22.9,16.75Q23.2,17.05 23.2,17.45Q23.2,17.85 22.9,18.15L20.6,20.4Q20.325,20.675 19.963,20.7Q19.6,20.725 19.3,20.5L16.4,18.3Q16.2,18.15 16.1,17.95Q16,17.75 16,17.5V14.65Q15.05,14.35 14.05,14.175Q13.05,14 12,14Q10.95,14 9.95,14.175Q8.95,14.35 8,14.65V17.5Q8,17.75 7.9,17.95Q7.8,18.15 7.6,18.3L4.7,20.5Q4.4,20.725 4.038,20.7Q3.675,20.675 3.4,20.4L1.1,18.15Q0.8,17.85 0.8,17.45Q0.8,17.05 1.1,16.75Q3.3,14.375 6.175,13.188Q9.05,12 12,12ZM6,15.35Q5.275,15.725 4.6,16.212Q3.925,16.7 3.2,17.3L4.2,18.3L6,16.9ZM18,15.4V16.9L19.8,18.3L20.8,17.35Q20.075,16.7 19.4,16.225Q18.725,15.75 18,15.4ZM6,15.35Q6,15.35 6,15.35Q6,15.35 6,15.35ZM18,15.4Q18,15.4 18,15.4Q18,15.4 18,15.4Z"
+      android:fillColor="?android:attr/colorPrimary"/>
+
+</vector>
\ No newline at end of file
diff --git a/res/drawable/ic_ring_volume_off.xml b/res/drawable/ic_ring_volume_off.xml
new file mode 100644
index 0000000..74f30d1
--- /dev/null
+++ b/res/drawable/ic_ring_volume_off.xml
@@ -0,0 +1,34 @@
+<!--
+    Copyright (C) 2022 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24"
+    android:tint="?android:attr/colorControlNormal">
+<path
+      android:pathData="M0.8,4.2l8.1,8.1c-2.2,0.5 -5.2,1.6 -7.8,4.4c-0.4,0.4 -0.4,1 0,1.4l2.3,2.3c0.3,0.3 0.9,0.4 1.3,0.1l2.9,-2.2C7.8,18.1 8,17.8 8,17.5v-2.9c0.9,-0.3 1.7,-0.5 2.7,-0.6l8.5,8.5l1.4,-1.4L2.2,2.8L0.8,4.2z"
+    android:fillColor="?android:attr/colorPrimary"/>
+  <path
+      android:pathData="M11,2h2v5h-2z"
+      android:fillColor="?android:attr/colorPrimary"/>
+  <path
+      android:pathData="M21.2,6.3l-1.4,-1.4l-3.6,3.6l1.4,1.4C17.6,9.8 21,6.3 21.2,6.3z"
+      android:fillColor="?android:attr/colorPrimary"/>
+  <path
+      android:pathData="M22.9,16.7c-2.8,-3 -6.2,-4.1 -8.4,-4.5l7.2,7.2l1.3,-1.3C23.3,17.7 23.3,17.1 22.9,16.7z"
+      android:fillColor="?android:attr/colorPrimary"/>
+</vector>
diff --git a/res/values/config.xml b/res/values/config.xml
index f5ad38b..8d4e63c 100755
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -628,9 +628,6 @@
     <!-- The extra value for battery tip -->
     <integer name="config_battery_extra_tip_value">12</integer>
 
-    <!-- Whether to enable the advanced vpn feature. The default is not to. -->
-    <bool name="config_advanced_vpn_enabled">false</bool>
-
     <!-- An array of uid name for which packages exempt from Wi-Fi permission check. -->
     <string-array name="config_exempt_wifi_permission_uid_name" translatable="false">
         <item>@string/config_settingsintelligence_package_name</item>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 694fa6d..28adfa5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3365,6 +3365,8 @@
     <string name="screensaver_settings_title">Screen saver</string>
     <!-- List of synonyms used in the settings search bar to find the “Screen saver”. [CHAR LIMIT=NONE] -->
     <string name="keywords_screensaver">screensaver</string>
+    <!-- Summary for screensaver unavailable when Bedtime mode is on [CHAR LIMIT=50] -->
+    <string name="screensaver_settings_when_to_dream_bedtime">Unavailable because bedtime mode is on</string>
     <!-- The title for the toggle which disables/enables screen savers [CHAR_LIMIT=30] -->
     <string name="screensaver_settings_toggle_title">Use screen saver</string>
     <!-- Display settings screen, summary fragment for screen saver options, activated when docked or asleep and charging [CHAR LIMIT=35] -->
@@ -8733,9 +8735,12 @@
     <!-- Sound: Title for the option managing alarm volume. [CHAR LIMIT=30] -->
     <string name="alarm_volume_option_title">Alarm volume</string>
 
-    <!-- Sound: Title for the option managing ring volume. [CHAR LIMIT=30] -->
+    <!-- Sound: Title for the option managing ring & notification volume. [CHAR LIMIT=30] -->
     <string name="ring_volume_option_title">Ring &amp; notification volume</string>
 
+    <!-- Sound: Title for the option managing ring volume. [CHAR LIMIT=30] -->
+    <string name="separate_ring_volume_option_title">Ring volume</string>
+
     <!-- Sound: Title for the option managing notification volume. [CHAR LIMIT=30] -->
     <string name="notification_volume_option_title">Notification volume</string>
 
diff --git a/res/xml/sound_settings.xml b/res/xml/sound_settings.xml
index f25b6ec..914ce72 100644
--- a/res/xml/sound_settings.xml
+++ b/res/xml/sound_settings.xml
@@ -72,23 +72,23 @@
         android:order="-160"
         settings:controller="com.android.settings.notification.RingVolumePreferenceController"/>
 
+    <!-- Notification volume -->
+    <com.android.settings.notification.VolumeSeekBarPreference
+        android:key="notification_volume"
+        android:icon="@drawable/ic_notifications"
+        android:title="@string/notification_volume_option_title"
+        android:order="-150"
+        settings:controller=
+            "com.android.settings.notification.NotificationVolumePreferenceController"/>
 
     <!-- Alarm volume -->
     <com.android.settings.notification.VolumeSeekBarPreference
         android:key="alarm_volume"
         android:icon="@*android:drawable/ic_audio_alarm"
         android:title="@string/alarm_volume_option_title"
-        android:order="-150"
-        settings:controller="com.android.settings.notification.AlarmVolumePreferenceController"/>
-
-    <!-- Notification volume -->
-    <com.android.settings.notification.VolumeSeekBarPreference
-        android:key="notification_volume"
-        android:icon="@drawable/ic_notifications"
-        android:title="@string/notification_volume_option_title"
         android:order="-140"
-        settings:controller="com.android.settings.notification.NotificationVolumePreferenceController"/>
-
+        settings:controller="com.android.settings.notification.AlarmVolumePreferenceController"/>
+x
     <!-- TODO(b/174964721): make this a PrimarySwitchPreference -->
     <!-- Interruptions -->
     <com.android.settingslib.RestrictedPreference
diff --git a/res/xml/vpn_settings2.xml b/res/xml/vpn_settings2.xml
index 0d374c7..08075a6 100644
--- a/res/xml/vpn_settings2.xml
+++ b/res/xml/vpn_settings2.xml
@@ -16,9 +16,4 @@
 
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
         android:title="@string/vpn_title">
-    <PreferenceCategory
-        android:key="advanced_vpn_group"/>
-
-    <PreferenceCategory
-        android:key="vpn_group"/>
 </PreferenceScreen>
diff --git a/src/com/android/settings/applications/AppStateLocaleBridge.java b/src/com/android/settings/applications/AppStateLocaleBridge.java
index 5600766..8262ce7 100644
--- a/src/com/android/settings/applications/AppStateLocaleBridge.java
+++ b/src/com/android/settings/applications/AppStateLocaleBridge.java
@@ -18,13 +18,19 @@
 import android.content.Context;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.util.ArrayMap;
 import android.util.Log;
 
+import com.android.settings.Utils;
 import com.android.settingslib.applications.ApplicationsState;
 import com.android.settingslib.applications.ApplicationsState.AppEntry;
 import com.android.settingslib.applications.ApplicationsState.AppFilter;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Creates a application filter to restrict UI display of applications.
@@ -35,20 +41,22 @@
     private static final String TAG = AppStateLocaleBridge.class.getSimpleName();
 
     private final Context mContext;
-    private final List<ResolveInfo> mListInfos;
+    private final Map<Integer, AppInfoByProfiles> mUserIdToAppInfoByProfiles = new ArrayMap<>();
 
     public AppStateLocaleBridge(Context context, ApplicationsState appState,
-            Callback callback) {
+            Callback callback, UserManager userManager) {
         super(appState, callback);
         mContext = context;
-        mListInfos = context.getPackageManager().queryIntentActivities(
-                AppLocaleUtil.LAUNCHER_ENTRY_INTENT, PackageManager.GET_META_DATA);
+        collectLocaleBridgeInfo(userManager);
     }
 
     @Override
     protected void updateExtraInfo(AppEntry app, String packageName, int uid) {
-        app.extraInfo = AppLocaleUtil.canDisplayLocaleUi(mContext, app.info.packageName, mListInfos)
-                ? Boolean.TRUE : Boolean.FALSE;
+        AppInfoByProfiles appInfoByProfiles = getAppInfo(UserHandle.getUserId(uid));
+
+        app.extraInfo = AppLocaleUtil.canDisplayLocaleUi(appInfoByProfiles.mContextAsUser,
+                app.info.packageName,
+                appInfoByProfiles.mListInfos) ? Boolean.TRUE : Boolean.FALSE;
     }
 
     @Override
@@ -56,9 +64,11 @@
         final List<AppEntry> allApps = mAppSession.getAllApps();
         for (int i = 0; i < allApps.size(); i++) {
             AppEntry app = allApps.get(i);
-            app.extraInfo =
-                    AppLocaleUtil.canDisplayLocaleUi(mContext, app.info.packageName, mListInfos)
-                    ? Boolean.TRUE : Boolean.FALSE;
+            AppInfoByProfiles appInfoByProfiles = getAppInfo(UserHandle.getUserId(app.info.uid));
+
+            app.extraInfo = AppLocaleUtil.canDisplayLocaleUi(appInfoByProfiles.mContextAsUser,
+                    app.info.packageName,
+                    appInfoByProfiles.mListInfos) ? Boolean.TRUE : Boolean.FALSE;
         }
     }
 
@@ -78,4 +88,47 @@
                     return (Boolean) entry.extraInfo;
                 }
             };
+
+    private void collectLocaleBridgeInfo(UserManager userManager) {
+        List<Integer> userIds = new ArrayList<>();
+
+        userIds.add(mContext.getUserId());
+        int workUserId = Utils.getManagedProfileId(userManager, mContext.getUserId());
+        if (workUserId != UserHandle.USER_NULL) {
+            userIds.add(workUserId);
+        }
+
+        // Separate the app information by profiles.
+        for (int userId : userIds) {
+            if (!mUserIdToAppInfoByProfiles.containsKey(userId)) {
+                mUserIdToAppInfoByProfiles.put(userId, new AppInfoByProfiles(mContext, userId));
+            }
+        }
+    }
+
+    private AppInfoByProfiles getAppInfo(int userId) {
+        AppInfoByProfiles info;
+        if (mUserIdToAppInfoByProfiles.containsKey(userId)) {
+            info = mUserIdToAppInfoByProfiles.get(userId);
+        } else {
+            info = new AppInfoByProfiles(mContext, userId);
+            mUserIdToAppInfoByProfiles.put(userId, info);
+        }
+
+        return info;
+    }
+
+    /**
+     * The app information by profiles.
+     */
+    private static class AppInfoByProfiles {
+        public final Context mContextAsUser;
+        public final List<ResolveInfo> mListInfos;
+
+        private AppInfoByProfiles(Context context, int userId) {
+            mContextAsUser = context.createContextAsUser(UserHandle.of(userId), 0);
+            mListInfos = mContextAsUser.getPackageManager().queryIntentActivities(
+                    AppLocaleUtil.LAUNCHER_ENTRY_INTENT, PackageManager.GET_META_DATA);
+        }
+    }
 }
diff --git a/src/com/android/settings/applications/manageapplications/ManageApplications.java b/src/com/android/settings/applications/manageapplications/ManageApplications.java
index 9a4d13c..5ee059e 100644
--- a/src/com/android/settings/applications/manageapplications/ManageApplications.java
+++ b/src/com/android/settings/applications/manageapplications/ManageApplications.java
@@ -1148,7 +1148,8 @@
             } else if (mManageApplications.mListType == LIST_TYPE_MEDIA_MANAGEMENT_APPS) {
                 mExtraInfoBridge = new AppStateMediaManagementAppsBridge(mContext, mState, this);
             } else if (mManageApplications.mListType == LIST_TYPE_APPS_LOCALE) {
-                mExtraInfoBridge = new AppStateLocaleBridge(mContext, mState, this);
+                mExtraInfoBridge = new AppStateLocaleBridge(mContext, mState, this,
+                        mManageApplications.mUserManager);
             } else if (mManageApplications.mListType == LIST_TYPE_BATTERY_OPTIMIZATION) {
                 mExtraInfoBridge = new AppStateAppBatteryUsageBridge(mContext, mState, this);
             } else {
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
index d65c8c7..9598019 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
@@ -168,7 +168,8 @@
     private Vibrator mVibrator;
     private boolean mIsSetupWizard;
     private boolean mIsOrientationChanged;
-    private boolean mIsCanceled;
+    @VisibleForTesting
+    boolean mIsCanceled;
     private AccessibilityManager mAccessibilityManager;
     private boolean mIsAccessibilityEnabled;
     private LottieAnimationView mIllustrationLottie;
@@ -196,7 +197,7 @@
 
     @Override
     public void onWindowFocusChanged(boolean hasFocus) {
-        if (hasFocus) {
+        if (hasFocus || mIsCanceled) {
             return;
         }
 
@@ -411,8 +412,10 @@
 
     @VisibleForTesting
     void onCancelEnrollment(@IdRes int errorMsgId) {
-        FingerprintErrorDialog.showErrorDialog(this, errorMsgId);
+        // showErrorDialog() will cause onWindowFocusChanged(false), set mIsCanceled to false
+        // before showErrorDialog() to prevent that another error dialog is triggered again.
         mIsCanceled = true;
+        FingerprintErrorDialog.showErrorDialog(this, errorMsgId);
         mIsOrientationChanged = false;
         cancelEnrollment();
         stopIconAnimation();
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintErrorDialog.java b/src/com/android/settings/biometrics/fingerprint/FingerprintErrorDialog.java
index 9f9efdc..39d35dc 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintErrorDialog.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintErrorDialog.java
@@ -72,6 +72,7 @@
                                     dialog.dismiss();
                                     Activity activity = getActivity();
                                     Intent intent = activity.getIntent();
+                                    intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
                                     intent.putExtra(KEY_STATE_CANCELED, false);
                                     activity.startActivity(intent);
                                     activity.finish();
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java b/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
index 44b3a40..c031fe6 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
@@ -669,6 +669,14 @@
                 mLaunchedConfirm = false;
                 if (resultCode == RESULT_FINISHED || resultCode == RESULT_OK) {
                     if (data != null && BiometricUtils.containsGatekeeperPasswordHandle(data)) {
+                        if (!mHasFirstEnrolled && !mIsEnrolling) {
+                            final Activity activity = getActivity();
+                            if (activity != null) {
+                                // Apply pending transition for auto adding first fingerprint case
+                                activity.overridePendingTransition(R.anim.sud_slide_next_in,
+                                        R.anim.sud_slide_next_out);
+                            }
+                        }
                         mFingerprintManager.generateChallenge(mUserId,
                                 (sensorId, userId, challenge) -> {
                                     mToken = BiometricUtils.requestGatekeeperHat(getActivity(),
diff --git a/src/com/android/settings/display/ScreenSaverPreferenceController.java b/src/com/android/settings/display/ScreenSaverPreferenceController.java
index 676a567..de1aaea 100644
--- a/src/com/android/settings/display/ScreenSaverPreferenceController.java
+++ b/src/com/android/settings/display/ScreenSaverPreferenceController.java
@@ -18,6 +18,7 @@
 
 import androidx.preference.Preference;
 
+import com.android.settings.R;
 import com.android.settings.core.PreferenceControllerMixin;
 import com.android.settings.dream.DreamSettings;
 import com.android.settingslib.core.AbstractPreferenceController;
@@ -26,9 +27,12 @@
         PreferenceControllerMixin {
 
     private static final String KEY_SCREEN_SAVER = "screensaver";
+    private final boolean mDreamsDisabledByAmbientModeSuppression;
 
     public ScreenSaverPreferenceController(Context context) {
         super(context);
+        mDreamsDisabledByAmbientModeSuppression = context.getResources().getBoolean(
+                com.android.internal.R.bool.config_dreamsDisabledByAmbientModeSuppressionConfig);
     }
 
     @Override
@@ -47,7 +51,12 @@
 
     @Override
     public void updateState(Preference preference) {
-        preference.setSummary(DreamSettings.getSummaryTextWithDreamName(mContext));
+        if (mDreamsDisabledByAmbientModeSuppression
+                && AmbientDisplayAlwaysOnPreferenceController.isAodSuppressedByBedtime(mContext)) {
+            preference.setSummary(R.string.screensaver_settings_when_to_dream_bedtime);
+        } else {
+            preference.setSummary(DreamSettings.getSummaryTextWithDreamName(mContext));
+        }
     }
 
     private boolean isSystemUser() {
diff --git a/src/com/android/settings/dream/WhenToDreamPreferenceController.java b/src/com/android/settings/dream/WhenToDreamPreferenceController.java
index 4108e85..02ae6a7 100644
--- a/src/com/android/settings/dream/WhenToDreamPreferenceController.java
+++ b/src/com/android/settings/dream/WhenToDreamPreferenceController.java
@@ -20,7 +20,10 @@
 
 import androidx.preference.Preference;
 
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.settings.R;
 import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settings.display.AmbientDisplayAlwaysOnPreferenceController;
 import com.android.settingslib.core.AbstractPreferenceController;
 import com.android.settingslib.dream.DreamBackend;
 
@@ -29,19 +32,34 @@
 
     private static final String WHEN_TO_START = "when_to_start";
     private final DreamBackend mBackend;
+    private final boolean mDreamsDisabledByAmbientModeSuppression;
 
     WhenToDreamPreferenceController(Context context) {
+        this(context, context.getResources().getBoolean(
+                com.android.internal.R.bool.config_dreamsDisabledByAmbientModeSuppressionConfig));
+    }
+
+    @VisibleForTesting
+    WhenToDreamPreferenceController(Context context,
+            boolean dreamsDisabledByAmbientModeSuppression) {
         super(context);
 
         mBackend = DreamBackend.getInstance(context);
+        mDreamsDisabledByAmbientModeSuppression = dreamsDisabledByAmbientModeSuppression;
     }
 
     @Override
     public void updateState(Preference preference) {
         super.updateState(preference);
 
-        int resId = DreamSettings.getDreamSettingDescriptionResId(mBackend.getWhenToDreamSetting());
-        preference.setSummary(preference.getContext().getString(resId));
+        if (mDreamsDisabledByAmbientModeSuppression
+                && AmbientDisplayAlwaysOnPreferenceController.isAodSuppressedByBedtime(mContext)) {
+            preference.setSummary(R.string.screensaver_settings_when_to_dream_bedtime);
+        } else {
+            final int resId = DreamSettings.getDreamSettingDescriptionResId(
+                    mBackend.getWhenToDreamSetting());
+            preference.setSummary(resId);
+        }
     }
 
     @Override
diff --git a/src/com/android/settings/network/CarrierConfigChangedReceiver.java b/src/com/android/settings/network/CarrierConfigChangedReceiver.java
index 8a6d47d..d9ff03e 100644
--- a/src/com/android/settings/network/CarrierConfigChangedReceiver.java
+++ b/src/com/android/settings/network/CarrierConfigChangedReceiver.java
@@ -32,9 +32,20 @@
             CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED;
 
     private final CountDownLatch mLatch;
+    private final boolean mIsWaitingForValidSubId;
 
-    public CarrierConfigChangedReceiver(CountDownLatch latch) {
+    /**
+     * This is the CarrierConfigChanged receiver. If it receives the carrier config changed, then it
+     * call the CountDownLatch.countDown().
+     * If the "isWaitingForValidSubId" is true, then the receiver skip the carrier config changed
+     * with the subId = -1. The receiver executes the countDown when the CarrierConfigChanged
+     * with valid subId.
+     * If the "isWaitingForValidSubId" is false, then the receiver executes the countDown when
+     * receiving any CarrierConfigChanged.
+     */
+    public CarrierConfigChangedReceiver(CountDownLatch latch, boolean isWaitingForValidSubId) {
         mLatch = latch;
+        mIsWaitingForValidSubId = isWaitingForValidSubId;
     }
 
     public void registerOn(Context context) {
@@ -53,7 +64,8 @@
     }
 
     private void checkSubscriptionIndex(Intent intent) {
-        if (intent.hasExtra(CarrierConfigManager.EXTRA_SUBSCRIPTION_INDEX)) {
+        if (intent.hasExtra(CarrierConfigManager.EXTRA_SUBSCRIPTION_INDEX)
+                || !mIsWaitingForValidSubId) {
             int subId = intent.getIntExtra(CarrierConfigManager.EXTRA_SUBSCRIPTION_INDEX, -1);
             Log.i(TAG, "subId from config changed: " + subId);
             mLatch.countDown();
diff --git a/src/com/android/settings/network/UiccSlotUtil.java b/src/com/android/settings/network/UiccSlotUtil.java
index e5323d1..4c26995 100644
--- a/src/com/android/settings/network/UiccSlotUtil.java
+++ b/src/com/android/settings/network/UiccSlotUtil.java
@@ -28,7 +28,6 @@
 import android.util.Log;
 
 import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.telephony.uicc.UiccController;
 import com.android.settingslib.utils.ThreadUtils;
 
 import com.google.common.collect.ImmutableList;
@@ -141,7 +140,8 @@
                         inactiveRemovableSlot,
                         /*removable sim's port Id*/ TelephonyManager.DEFAULT_PORT_INDEX,
                         excludedLogicalSlotIndex),
-                context);
+                context,
+                /*isWaitingForValidSubId=*/ true);
     }
 
     /**
@@ -179,7 +179,8 @@
         performSwitchToSlot(telMgr,
                 prepareUiccSlotMappings(uiccSlotMappings, /*slot is not psim*/ false,
                         physicalSlotId, port, excludedLogicalSlotIndex),
-                context);
+                context,
+                /*isWaitingForValidSubId=*/ false);
     }
 
     /**
@@ -231,7 +232,8 @@
     }
 
     private static void performSwitchToSlot(TelephonyManager telMgr,
-            Collection<UiccSlotMapping> uiccSlotMappings, Context context)
+            Collection<UiccSlotMapping> uiccSlotMappings, Context context,
+            boolean isWaitingForValidSubId)
             throws UiccSlotsException {
         CarrierConfigChangedReceiver receiver = null;
         long waitingTimeMillis =
@@ -241,7 +243,7 @@
                         DEFAULT_WAIT_AFTER_SWITCH_TIMEOUT_MILLIS);
         try {
             CountDownLatch latch = new CountDownLatch(1);
-            receiver = new CarrierConfigChangedReceiver(latch);
+            receiver = new CarrierConfigChangedReceiver(latch, isWaitingForValidSubId);
             receiver.registerOn(context);
             telMgr.setSimSlotMapping(uiccSlotMappings);
             latch.await(waitingTimeMillis, TimeUnit.MILLISECONDS);
@@ -270,6 +272,7 @@
         if (slotId == INVALID_PHYSICAL_SLOT_ID) {
             for (int i = 0; i < slots.length; i++) {
                 if (slots[i].isRemovable()
+                        && !slots[i].getIsEuicc()
                         && !slots[i].getPorts().stream().findFirst().get().isActive()
                         && slots[i].getCardStateInfo() != UiccSlotInfo.CARD_STATE_INFO_ERROR
                         && slots[i].getCardStateInfo() != UiccSlotInfo.CARD_STATE_INFO_RESTRICTED) {
@@ -410,4 +413,29 @@
                 .findFirst()
                 .orElse(INVALID_LOGICAL_SLOT_ID);
     }
+
+    /**
+     * Return whether the removable psim is enabled.
+     *
+     * @param telMgr is a TelephonyManager.
+     * @return whether the removable psim is enabled.
+     */
+    public static boolean isRemovableSimEnabled(TelephonyManager telMgr) {
+        if (telMgr == null) {
+            return false;
+        }
+        ImmutableList<UiccSlotInfo> slotInfos = UiccSlotUtil.getSlotInfos(telMgr);
+        boolean isRemovableSimEnabled =
+                slotInfos.stream()
+                        .anyMatch(
+                                slot -> slot != null
+                                        && slot.isRemovable()
+                                        && !slot.getIsEuicc()
+                                        && slot.getPorts().stream().anyMatch(
+                                                port -> port.isActive())
+                                        && slot.getCardStateInfo()
+                                                == UiccSlotInfo.CARD_STATE_INFO_PRESENT);
+        Log.i(TAG, "isRemovableSimEnabled: " + isRemovableSimEnabled);
+        return isRemovableSimEnabled;
+    }
 }
diff --git a/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java b/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java
index a878cb3..6fa803d 100644
--- a/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java
+++ b/src/com/android/settings/network/telephony/ToggleSubscriptionDialogActivity.java
@@ -24,7 +24,6 @@
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 import android.telephony.UiccCardInfo;
-import android.telephony.UiccSlotInfo;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
@@ -39,8 +38,6 @@
 import com.android.settings.network.UiccSlotUtil;
 import com.android.settings.sim.SimActivationNotifier;
 
-import com.google.common.collect.ImmutableList;
-
 import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -586,18 +583,7 @@
     }
 
     private boolean isRemovableSimEnabled() {
-        ImmutableList<UiccSlotInfo> slotInfos = UiccSlotUtil.getSlotInfos(mTelMgr);
-        boolean isRemovableSimEnabled =
-                slotInfos.stream()
-                        .anyMatch(
-                                slot -> slot != null
-                                        && slot.isRemovable()
-                                        && slot.getPorts().stream().anyMatch(
-                                                port -> port.isActive())
-                                        && slot.getCardStateInfo()
-                                                == UiccSlotInfo.CARD_STATE_INFO_PRESENT);
-        Log.i(TAG, "isRemovableSimEnabled: " + isRemovableSimEnabled);
-        return isRemovableSimEnabled;
+        return UiccSlotUtil.isRemovableSimEnabled(mTelMgr);
     }
 
     private boolean isMultipleEnabledProfilesSupported() {
diff --git a/src/com/android/settings/notification/NotificationAssistantPreferenceController.java b/src/com/android/settings/notification/NotificationAssistantPreferenceController.java
index 2c02db9..ee36273 100644
--- a/src/com/android/settings/notification/NotificationAssistantPreferenceController.java
+++ b/src/com/android/settings/notification/NotificationAssistantPreferenceController.java
@@ -141,7 +141,10 @@
     @Override
     public void updateState(Preference preference) {
         super.updateState(preference);
-        if (isNASSettingActivityAvailable()) {
+        if (mDefaultNASComponent == null) {
+            preference.setEnabled(false);
+            ((PrimarySwitchPreference) preference).setSwitchEnabled(false);
+        } else if (isNASSettingActivityAvailable()) {
             preference.setIntent(mNASSettingIntent);
         } else {
             // Cannot find settings activity from the default NAS app
diff --git a/src/com/android/settings/notification/NotificationVolumePreferenceController.java b/src/com/android/settings/notification/NotificationVolumePreferenceController.java
index 0fe0d62..322bb6c 100644
--- a/src/com/android/settings/notification/NotificationVolumePreferenceController.java
+++ b/src/com/android/settings/notification/NotificationVolumePreferenceController.java
@@ -16,26 +16,96 @@
 
 package com.android.settings.notification;
 
+import android.app.INotificationManager;
+import android.app.NotificationManager;
+import android.content.BroadcastReceiver;
+import android.content.ComponentName;
 import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
 import android.media.AudioManager;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.os.ServiceManager;
+import android.os.Vibrator;
+import android.service.notification.NotificationListenerService;
 import android.text.TextUtils;
+import android.util.Log;
 
+import androidx.lifecycle.OnLifecycleEvent;
+
+import com.android.internal.annotations.VisibleForTesting;
 import com.android.settings.R;
 import com.android.settings.Utils;
+import com.android.settingslib.core.lifecycle.Lifecycle;
 
-public class NotificationVolumePreferenceController extends
-    RingVolumePreferenceController {
+import java.util.Objects;
 
+/**
+ * Update notification volume icon in Settings in response to user adjusting volume
+ */
+public class NotificationVolumePreferenceController extends VolumeSeekBarPreferenceController {
+
+    private static final String TAG = "NotificationVolumePreferenceController";
     private static final String KEY_NOTIFICATION_VOLUME = "notification_volume";
 
+    private Vibrator mVibrator;
+    private int mRingerMode = AudioManager.RINGER_MODE_NORMAL;
+    private ComponentName mSuppressor;
+    private final RingReceiver mReceiver = new RingReceiver();
+    private final H mHandler = new H();
+    private INotificationManager mNoMan;
+
+
+    private int mMuteIcon;
+    private final int mNormalIconId =  R.drawable.ic_notifications;
+    private final int mVibrateIconId = R.drawable.ic_volume_ringer_vibrate;
+    private final int mSilentIconId = R.drawable.ic_notifications_off_24dp;
+
+    private final boolean mRingNotificationAliased;
+
+
     public NotificationVolumePreferenceController(Context context) {
-        super(context, KEY_NOTIFICATION_VOLUME);
+        this(context, KEY_NOTIFICATION_VOLUME);
+    }
+
+    public NotificationVolumePreferenceController(Context context, String key) {
+        super(context, key);
+        mVibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
+        if (mVibrator != null && !mVibrator.hasVibrator()) {
+            mVibrator = null;
+        }
+
+        mRingNotificationAliased = mContext.getResources().getBoolean(
+                com.android.internal.R.bool.config_alias_ring_notif_stream_types);
+        updateRingerMode();
+    }
+
+    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
+    @Override
+    public void onResume() {
+        super.onResume();
+        mReceiver.register(true);
+        updateEffectsSuppressor();
+        updatePreferenceIconAndSliderState();
+    }
+
+    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
+    @Override
+    public void onPause() {
+        super.onPause();
+        mReceiver.register(false);
     }
 
     @Override
     public int getAvailabilityStatus() {
+
+        // Show separate notification slider if ring/notification are not aliased by AudioManager --
+        // if they are, notification volume is controlled by RingVolumePreferenceController.
         return mContext.getResources().getBoolean(R.bool.config_show_notification_volume)
-                && !Utils.isVoiceCapable(mContext) && !mHelper.isSingleVolume()
+                && (!mRingNotificationAliased || !Utils.isVoiceCapable(mContext))
+                && !mHelper.isSingleVolume()
                 ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
     }
 
@@ -55,13 +125,152 @@
     }
 
     @Override
+    public boolean useDynamicSliceSummary() {
+        return true;
+    }
+
+    @Override
     public int getAudioStream() {
         return AudioManager.STREAM_NOTIFICATION;
     }
 
     @Override
     public int getMuteIcon() {
-        return R.drawable.ic_notifications_off_24dp;
+        return mMuteIcon;
+    }
+
+    private void updateRingerMode() {
+        final int ringerMode = mHelper.getRingerModeInternal();
+        if (mRingerMode == ringerMode) return;
+        mRingerMode = ringerMode;
+        updatePreferenceIconAndSliderState();
+    }
+
+    private void updateEffectsSuppressor() {
+        final ComponentName suppressor = NotificationManager.from(mContext).getEffectsSuppressor();
+        if (Objects.equals(suppressor, mSuppressor)) return;
+
+        if (mNoMan == null) {
+            mNoMan = INotificationManager.Stub.asInterface(
+                    ServiceManager.getService(Context.NOTIFICATION_SERVICE));
+        }
+
+        final int hints;
+        try {
+            hints = mNoMan.getHintsFromListenerNoToken();
+        } catch (android.os.RemoteException exception) {
+            Log.w(TAG, "updateEffectsSuppressor: " + exception.getLocalizedMessage());
+            return;
+        }
+
+        if (hintsMatch(hints)) {
+
+            mSuppressor = suppressor;
+            if (mPreference != null) {
+                final String text = SuppressorHelper.getSuppressionText(mContext, suppressor);
+                mPreference.setSuppressionText(text);
+            }
+        }
+    }
+
+    @VisibleForTesting
+    boolean hintsMatch(int hints) {
+        boolean allEffectsDisabled =
+                (hints & NotificationListenerService.HINT_HOST_DISABLE_EFFECTS) != 0;
+        boolean notificationEffectsDisabled =
+                (hints & NotificationListenerService.HINT_HOST_DISABLE_NOTIFICATION_EFFECTS) != 0;
+
+        return allEffectsDisabled || notificationEffectsDisabled;
+    }
+
+    private void updatePreferenceIconAndSliderState() {
+        if (mPreference != null) {
+            if (mVibrator != null && mRingerMode == AudioManager.RINGER_MODE_VIBRATE) {
+                mMuteIcon = mVibrateIconId;
+                mPreference.showIcon(mVibrateIconId);
+                mPreference.setEnabled(false);
+
+            } else if (mRingerMode == AudioManager.RINGER_MODE_SILENT
+                    || mVibrator == null && mRingerMode == AudioManager.RINGER_MODE_VIBRATE) {
+                mMuteIcon = mSilentIconId;
+                mPreference.showIcon(mSilentIconId);
+                mPreference.setEnabled(false);
+            } else { // ringmode normal: could be that we are still silent
+                mPreference.setEnabled(true);
+                if (mHelper.getStreamVolume(AudioManager.STREAM_NOTIFICATION) == 0) {
+                    // ring is in normal, but notification is in silent
+                    mMuteIcon = mSilentIconId;
+                    mPreference.showIcon(mSilentIconId);
+                } else {
+                    mPreference.showIcon(mNormalIconId);
+                }
+            }
+        }
+    }
+
+    private final class H extends Handler {
+        private static final int UPDATE_EFFECTS_SUPPRESSOR = 1;
+        private static final int UPDATE_RINGER_MODE = 2;
+        private static final int NOTIFICATION_VOLUME_CHANGED = 3;
+
+        private H() {
+            super(Looper.getMainLooper());
+        }
+
+        @Override
+        public void handleMessage(Message msg) {
+            switch (msg.what) {
+                case UPDATE_EFFECTS_SUPPRESSOR:
+                    updateEffectsSuppressor();
+                    break;
+                case UPDATE_RINGER_MODE:
+                    updateRingerMode();
+                    break;
+                case NOTIFICATION_VOLUME_CHANGED:
+                    updatePreferenceIconAndSliderState();
+                    break;
+            }
+        }
+    }
+
+    /**
+     * For notification volume icon to be accurate, we need to listen to volume change as well.
+     * That is because the icon can change from mute/vibrate to normal without ringer mode changing.
+     */
+    private class RingReceiver extends BroadcastReceiver {
+        private boolean mRegistered;
+
+        public void register(boolean register) {
+            if (mRegistered == register) return;
+            if (register) {
+                final IntentFilter filter = new IntentFilter();
+                filter.addAction(NotificationManager.ACTION_EFFECTS_SUPPRESSOR_CHANGED);
+                filter.addAction(AudioManager.INTERNAL_RINGER_MODE_CHANGED_ACTION);
+                filter.addAction(AudioManager.VOLUME_CHANGED_ACTION);
+                mContext.registerReceiver(this, filter);
+            } else {
+                mContext.unregisterReceiver(this);
+            }
+            mRegistered = register;
+        }
+
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            final String action = intent.getAction();
+            if (NotificationManager.ACTION_EFFECTS_SUPPRESSOR_CHANGED.equals(action)) {
+                mHandler.sendEmptyMessage(H.UPDATE_EFFECTS_SUPPRESSOR);
+            } else if (AudioManager.INTERNAL_RINGER_MODE_CHANGED_ACTION.equals(action)) {
+                mHandler.sendEmptyMessage(H.UPDATE_RINGER_MODE);
+            } else if (AudioManager.VOLUME_CHANGED_ACTION.equals(action)) {
+                int streamType = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, -1);
+                if (streamType == AudioManager.STREAM_NOTIFICATION) {
+                    int streamValue = intent.getIntExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE,
+                            -1);
+                    mHandler.obtainMessage(H.NOTIFICATION_VOLUME_CHANGED, streamValue, 0)
+                            .sendToTarget();
+                }
+            }
+        }
     }
 
 }
diff --git a/src/com/android/settings/notification/RingVolumePreferenceController.java b/src/com/android/settings/notification/RingVolumePreferenceController.java
index 5e7d067..a78689f 100644
--- a/src/com/android/settings/notification/RingVolumePreferenceController.java
+++ b/src/com/android/settings/notification/RingVolumePreferenceController.java
@@ -16,6 +16,7 @@
 
 package com.android.settings.notification;
 
+import android.app.INotificationManager;
 import android.app.NotificationManager;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
@@ -26,30 +27,56 @@
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
+import android.os.ServiceManager;
 import android.os.Vibrator;
+import android.service.notification.NotificationListenerService;
 import android.text.TextUtils;
+import android.util.Log;
 
 import androidx.lifecycle.OnLifecycleEvent;
 
+import com.android.internal.annotations.VisibleForTesting;
 import com.android.settings.R;
 import com.android.settings.Utils;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 
 import java.util.Objects;
 
+/**
+ * This slider can represent both ring and notification, if the corresponding streams are aliased,
+ * and only ring if the streams are not aliased.
+ */
 public class RingVolumePreferenceController extends VolumeSeekBarPreferenceController {
 
-    private static final String TAG = "RingVolumeController";
+    private static final String TAG = "RingVolumePreferenceController";
     private static final String KEY_RING_VOLUME = "ring_volume";
 
     private Vibrator mVibrator;
-    private int mRingerMode = -1;
+    private int mRingerMode = AudioManager.RINGER_MODE_NORMAL;
     private ComponentName mSuppressor;
     private final RingReceiver mReceiver = new RingReceiver();
     private final H mHandler = new H();
 
     private int mMuteIcon;
 
+    /*
+     * Whether ring and notification streams are aliased together by AudioManager.
+     * If they are, we'll present one volume control for both.
+     * If not, we'll present separate volume controls.
+     */
+    private final boolean mRingAliasNotif;
+
+    private final int mNormalIconId;
+    @VisibleForTesting
+    final int mVibrateIconId;
+    @VisibleForTesting
+    final int mSilentIconId;
+
+    @VisibleForTesting
+    final int mTitleId;
+
+    private INotificationManager mNoMan;
+
     public RingVolumePreferenceController(Context context) {
         this(context, KEY_RING_VOLUME);
     }
@@ -60,9 +87,31 @@
         if (mVibrator != null && !mVibrator.hasVibrator()) {
             mVibrator = null;
         }
+
+        mRingAliasNotif = isRingAliasNotification();
+        if (mRingAliasNotif) {
+            mTitleId = R.string.ring_volume_option_title;
+
+            mNormalIconId = R.drawable.ic_notifications;
+            mSilentIconId = R.drawable.ic_notifications_off_24dp;
+        } else {
+            mTitleId = R.string.separate_ring_volume_option_title;
+
+            mNormalIconId = R.drawable.ic_ring_volume;
+            mSilentIconId = R.drawable.ic_ring_volume_off;
+        }
+        // todo: set a distinct vibrate icon for ring vs notification
+        mVibrateIconId = R.drawable.ic_volume_ringer_vibrate;
+
         updateRingerMode();
     }
 
+    @VisibleForTesting
+    boolean isRingAliasNotification() {
+        return mContext.getResources().getBoolean(
+                com.android.internal.R.bool.config_alias_ring_notif_stream_types);
+    }
+
     @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
     @Override
     public void onResume() {
@@ -70,6 +119,7 @@
         mReceiver.register(true);
         updateEffectsSuppressor();
         updatePreferenceIcon();
+        setPreferenceTitle();
     }
 
     @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
@@ -115,7 +165,8 @@
         return mMuteIcon;
     }
 
-    private void updateRingerMode() {
+    @VisibleForTesting
+    void updateRingerMode() {
         final int ringerMode = mHelper.getRingerModeInternal();
         if (mRingerMode == ringerMode) return;
         mRingerMode = ringerMode;
@@ -125,28 +176,73 @@
     private void updateEffectsSuppressor() {
         final ComponentName suppressor = NotificationManager.from(mContext).getEffectsSuppressor();
         if (Objects.equals(suppressor, mSuppressor)) return;
-        mSuppressor = suppressor;
-        if (mPreference != null) {
-            final String text = SuppressorHelper.getSuppressionText(mContext, suppressor);
-            mPreference.setSuppressionText(text);
+
+        if (mNoMan == null) {
+            mNoMan = INotificationManager.Stub.asInterface(
+                    ServiceManager.getService(Context.NOTIFICATION_SERVICE));
         }
-        updatePreferenceIcon();
+
+        final int hints;
+        try {
+            hints = mNoMan.getHintsFromListenerNoToken();
+        } catch (android.os.RemoteException ex) {
+            Log.w(TAG, "updateEffectsSuppressor: " + ex.getMessage());
+            return;
+        }
+
+        if (hintsMatch(hints, mRingAliasNotif)) {
+            mSuppressor = suppressor;
+            if (mPreference != null) {
+                final String text = SuppressorHelper.getSuppressionText(mContext, suppressor);
+                mPreference.setSuppressionText(text);
+            }
+        }
+    }
+
+    @VisibleForTesting
+    boolean hintsMatch(int hints, boolean ringNotificationAliased) {
+        return (hints & NotificationListenerService.HINT_HOST_DISABLE_CALL_EFFECTS) != 0
+                || (hints & NotificationListenerService.HINT_HOST_DISABLE_EFFECTS) != 0
+                || ((hints & NotificationListenerService.HINT_HOST_DISABLE_NOTIFICATION_EFFECTS)
+                != 0 && ringNotificationAliased);
+    }
+
+    @VisibleForTesting
+    void setPreference(VolumeSeekBarPreference volumeSeekBarPreference) {
+        mPreference = volumeSeekBarPreference;
+    }
+
+    @VisibleForTesting
+    void setVibrator(Vibrator vibrator) {
+        mVibrator = vibrator;
     }
 
     private void updatePreferenceIcon() {
         if (mPreference != null) {
-            if (mRingerMode == AudioManager.RINGER_MODE_VIBRATE) {
-                mMuteIcon = R.drawable.ic_volume_ringer_vibrate;
-                mPreference.showIcon(R.drawable.ic_volume_ringer_vibrate);
-            } else if (mRingerMode == AudioManager.RINGER_MODE_SILENT) {
-                mMuteIcon = R.drawable.ic_notifications_off_24dp;
-                mPreference.showIcon(R.drawable.ic_notifications_off_24dp);
+            if (mRingerMode == AudioManager.RINGER_MODE_NORMAL) {
+                mPreference.showIcon(mNormalIconId);
             } else {
-                mPreference.showIcon(R.drawable.ic_notifications);
+                if (mRingerMode == AudioManager.RINGER_MODE_VIBRATE && mVibrator != null) {
+                    mMuteIcon = mVibrateIconId;
+                } else {
+                    mMuteIcon = mSilentIconId;
+                }
+                mPreference.showIcon(mMuteIcon);
             }
         }
     }
 
+    /**
+     * This slider can represent both ring and notification, or only ring.
+     * Note: This cannot be used in the constructor, as the reference to preference object would
+     * still be null.
+     */
+    private void setPreferenceTitle() {
+        if (mPreference != null) {
+            mPreference.setTitle(mTitleId);
+        }
+    }
+
     private final class H extends Handler {
         private static final int UPDATE_EFFECTS_SUPPRESSOR = 1;
         private static final int UPDATE_RINGER_MODE = 2;
diff --git a/src/com/android/settings/notification/ShowOnLockScreenNotificationPreferenceController.java b/src/com/android/settings/notification/ShowOnLockScreenNotificationPreferenceController.java
index f7dc391..1addd82 100644
--- a/src/com/android/settings/notification/ShowOnLockScreenNotificationPreferenceController.java
+++ b/src/com/android/settings/notification/ShowOnLockScreenNotificationPreferenceController.java
@@ -23,6 +23,9 @@
 import android.os.UserHandle;
 import android.provider.Settings;
 
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
 import com.android.settings.R;
 import com.android.settings.RestrictedListPreference;
 import com.android.settings.core.PreferenceControllerMixin;
@@ -34,9 +37,6 @@
 
 import java.util.ArrayList;
 
-import androidx.preference.Preference;
-import androidx.preference.PreferenceScreen;
-
 public class ShowOnLockScreenNotificationPreferenceController extends AbstractPreferenceController
         implements PreferenceControllerMixin, Preference.OnPreferenceChangeListener {
 
@@ -157,6 +157,6 @@
 
     private boolean getLockscreenSilentNotificationsEnabled() {
         return Settings.Secure.getInt(mContext.getContentResolver(),
-                Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 1) != 0;
+                Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 0) != 0;
     }
 }
diff --git a/src/com/android/settings/overlay/FeatureFactory.java b/src/com/android/settings/overlay/FeatureFactory.java
index c59b385..aff7197 100644
--- a/src/com/android/settings/overlay/FeatureFactory.java
+++ b/src/com/android/settings/overlay/FeatureFactory.java
@@ -45,7 +45,6 @@
 import com.android.settings.security.SecuritySettingsFeatureProvider;
 import com.android.settings.slices.SlicesFeatureProvider;
 import com.android.settings.users.UserFeatureProvider;
-import com.android.settings.vpn2.AdvancedVpnFeatureProvider;
 import com.android.settings.wifi.WifiTrackerLibProvider;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 
@@ -178,11 +177,6 @@
      */
     public abstract AccessibilityMetricsFeatureProvider getAccessibilityMetricsFeatureProvider();
 
-    /**
-     * Retrieves implementation for advanced vpn feature.
-     */
-    public abstract AdvancedVpnFeatureProvider getAdvancedVpnFeatureProvider();
-
     public static final class FactoryNotFoundException extends RuntimeException {
         public FactoryNotFoundException(Throwable throwable) {
             super("Unable to create factory. Did you misconfigure Proguard?", throwable);
diff --git a/src/com/android/settings/overlay/FeatureFactoryImpl.java b/src/com/android/settings/overlay/FeatureFactoryImpl.java
index 593b866..89f74de 100644
--- a/src/com/android/settings/overlay/FeatureFactoryImpl.java
+++ b/src/com/android/settings/overlay/FeatureFactoryImpl.java
@@ -71,8 +71,6 @@
 import com.android.settings.slices.SlicesFeatureProviderImpl;
 import com.android.settings.users.UserFeatureProvider;
 import com.android.settings.users.UserFeatureProviderImpl;
-import com.android.settings.vpn2.AdvancedVpnFeatureProvider;
-import com.android.settings.vpn2.AdvancedVpnFeatureProviderImpl;
 import com.android.settings.wifi.WifiTrackerLibProvider;
 import com.android.settings.wifi.WifiTrackerLibProviderImpl;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -108,7 +106,6 @@
     private SecuritySettingsFeatureProvider mSecuritySettingsFeatureProvider;
     private AccessibilitySearchFeatureProvider mAccessibilitySearchFeatureProvider;
     private AccessibilityMetricsFeatureProvider mAccessibilityMetricsFeatureProvider;
-    private AdvancedVpnFeatureProvider mAdvancedVpnFeatureProvider;
 
     @Override
     public SupportFeatureProvider getSupportFeatureProvider(Context context) {
@@ -337,12 +334,4 @@
         }
         return mAccessibilityMetricsFeatureProvider;
     }
-
-    @Override
-    public AdvancedVpnFeatureProvider getAdvancedVpnFeatureProvider() {
-        if (mAdvancedVpnFeatureProvider == null) {
-            mAdvancedVpnFeatureProvider = new AdvancedVpnFeatureProviderImpl();
-        }
-        return mAdvancedVpnFeatureProvider;
-    }
 }
diff --git a/src/com/android/settings/panel/PanelSlicesAdapter.java b/src/com/android/settings/panel/PanelSlicesAdapter.java
index 9f5ffe9..afccc78 100644
--- a/src/com/android/settings/panel/PanelSlicesAdapter.java
+++ b/src/com/android/settings/panel/PanelSlicesAdapter.java
@@ -54,7 +54,7 @@
      * Maximum number of slices allowed on the panel view.
      */
     @VisibleForTesting
-    static final int MAX_NUM_OF_SLICES = 6;
+    static final int MAX_NUM_OF_SLICES = 7;
 
     private final List<LiveData<Slice>> mSliceLiveData;
     private final int mMetricsCategory;
diff --git a/src/com/android/settings/slices/CustomSliceRegistry.java b/src/com/android/settings/slices/CustomSliceRegistry.java
index d1b169c..569a0ea 100644
--- a/src/com/android/settings/slices/CustomSliceRegistry.java
+++ b/src/com/android/settings/slices/CustomSliceRegistry.java
@@ -218,6 +218,16 @@
             .build();
 
     /**
+     * Full {@link Uri} for the Notification volume Slice.
+     */
+    public static final Uri VOLUME_NOTIFICATION_URI = new Uri.Builder()
+            .scheme(ContentResolver.SCHEME_CONTENT)
+            .authority(SettingsSliceProvider.SLICE_AUTHORITY)
+            .appendPath(SettingsSlicesContract.PATH_SETTING_ACTION)
+            .appendPath("notification_volume")
+            .build();
+
+    /**
      * Full {@link Uri} for the all volume Slices.
      */
     public static final Uri VOLUME_SLICES_URI = new Uri.Builder()
diff --git a/src/com/android/settings/sound/AudioSwitchPreferenceController.java b/src/com/android/settings/sound/AudioSwitchPreferenceController.java
index 5b70d16..38fecfc 100644
--- a/src/com/android/settings/sound/AudioSwitchPreferenceController.java
+++ b/src/com/android/settings/sound/AudioSwitchPreferenceController.java
@@ -45,6 +45,7 @@
 import com.android.settingslib.bluetooth.CachedBluetoothDevice;
 import com.android.settingslib.bluetooth.HeadsetProfile;
 import com.android.settingslib.bluetooth.HearingAidProfile;
+import com.android.settingslib.bluetooth.LeAudioProfile;
 import com.android.settingslib.bluetooth.LocalBluetoothManager;
 import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
@@ -215,6 +216,25 @@
     }
 
     /**
+     * Get LE Audio profile connected devices
+     */
+    protected List<BluetoothDevice> getConnectedLeAudioDevices() {
+        final List<BluetoothDevice> connectedDevices = new ArrayList<>();
+        final LeAudioProfile leAudioProfile = mProfileManager.getLeAudioProfile();
+        if (leAudioProfile == null) {
+            Log.d(TAG, "LeAudioProfile is null");
+            return connectedDevices;
+        }
+        final List<BluetoothDevice> devices = leAudioProfile.getConnectedDevices();
+        for (BluetoothDevice device : devices) {
+            if (device.isConnected()) {
+                connectedDevices.add(device);
+            }
+        }
+        return connectedDevices;
+    }
+
+    /**
      * get hearing aid profile connected device, exclude other devices with same hiSyncId.
      */
     protected List<BluetoothDevice> getConnectedHearingAidDevices() {
@@ -260,6 +280,24 @@
     }
 
     /**
+     * Find active LE Audio device
+     */
+    protected BluetoothDevice findActiveLeAudioDevice() {
+        final LeAudioProfile leAudioProfile = mProfileManager.getLeAudioProfile();
+
+        if (leAudioProfile != null) {
+            List<BluetoothDevice> activeDevices = leAudioProfile.getActiveDevices();
+            for (BluetoothDevice leAudioDevice : activeDevices) {
+                if (leAudioDevice != null) {
+                    return leAudioDevice;
+                }
+            }
+        }
+        Log.d(TAG, "There is no LE audio profile or no active LE audio device");
+        return null;
+    }
+
+    /**
      * Find the active device from the corresponding profile.
      *
      * @return the active device. Return null if the
diff --git a/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceController.java b/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceController.java
index 15f47cf..35cc65f 100644
--- a/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceController.java
+++ b/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceController.java
@@ -103,6 +103,7 @@
         mConnectedDevices.clear();
         mConnectedDevices.addAll(getConnectedHfpDevices());
         mConnectedDevices.addAll(getConnectedHearingAidDevices());
+        mConnectedDevices.addAll(getConnectedLeAudioDevices());
 
         final int numDevices = mConnectedDevices.size();
         if (numDevices == 0) {
@@ -181,12 +182,22 @@
 
     @Override
     public BluetoothDevice findActiveDevice() {
-        BluetoothDevice activeDevice = findActiveHearingAidDevice();
+        BluetoothDevice haActiveDevice = findActiveHearingAidDevice();
+        BluetoothDevice leAudioActiveDevice = findActiveLeAudioDevice();
         final HeadsetProfile headsetProfile = mProfileManager.getHeadsetProfile();
 
-        if (activeDevice == null && headsetProfile != null) {
-            activeDevice = headsetProfile.getActiveDevice();
+        if (haActiveDevice != null) {
+            return haActiveDevice;
         }
-        return activeDevice;
+
+        if (leAudioActiveDevice != null) {
+            return leAudioActiveDevice;
+        }
+
+        if (headsetProfile != null && headsetProfile.getActiveDevice() != null) {
+            return headsetProfile.getActiveDevice();
+        }
+
+        return null;
     }
 }
diff --git a/src/com/android/settings/sound/MediaOutputPreferenceController.java b/src/com/android/settings/sound/MediaOutputPreferenceController.java
index 4ec00e3..758f7e3 100644
--- a/src/com/android/settings/sound/MediaOutputPreferenceController.java
+++ b/src/com/android/settings/sound/MediaOutputPreferenceController.java
@@ -88,9 +88,11 @@
         // Find active device and set its name as the preference's summary
         List<BluetoothDevice> connectedA2dpDevices = getConnectedA2dpDevices();
         List<BluetoothDevice> connectedHADevices = getConnectedHearingAidDevices();
+        List<BluetoothDevice> connectedLeAudioDevices = getConnectedLeAudioDevices();
         if (mAudioManager.getMode() == AudioManager.MODE_NORMAL
                 && ((connectedA2dpDevices != null && !connectedA2dpDevices.isEmpty())
-                || (connectedHADevices != null && !connectedHADevices.isEmpty()))) {
+                || (connectedHADevices != null && !connectedHADevices.isEmpty())
+                || (connectedLeAudioDevices != null && !connectedLeAudioDevices.isEmpty()))) {
             activeDevice = findActiveDevice();
         }
         mPreference.setTitle(mContext.getString(R.string.media_output_label_title,
@@ -103,13 +105,23 @@
 
     @Override
     public BluetoothDevice findActiveDevice() {
-        BluetoothDevice activeDevice = findActiveHearingAidDevice();
+        BluetoothDevice haActiveDevice = findActiveHearingAidDevice();
+        BluetoothDevice leAudioActiveDevice = findActiveLeAudioDevice();
         final A2dpProfile a2dpProfile = mProfileManager.getA2dpProfile();
 
-        if (activeDevice == null && a2dpProfile != null) {
-            activeDevice = a2dpProfile.getActiveDevice();
+        if (haActiveDevice != null) {
+            return haActiveDevice;
         }
-        return activeDevice;
+
+        if (leAudioActiveDevice != null) {
+            return leAudioActiveDevice;
+        }
+
+        if (a2dpProfile != null && a2dpProfile.getActiveDevice() != null) {
+            return a2dpProfile.getActiveDevice();
+        }
+
+        return null;
     }
 
     /**
diff --git a/src/com/android/settings/vpn2/AdvancedVpnFeatureProvider.java b/src/com/android/settings/vpn2/AdvancedVpnFeatureProvider.java
deleted file mode 100644
index 962b6c2..0000000
--- a/src/com/android/settings/vpn2/AdvancedVpnFeatureProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2022 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.vpn2;
-
-import android.content.Context;
-
-/**
- * Feature Provider used in vpn usage
- */
-public interface AdvancedVpnFeatureProvider {
-
-    /**
-     * Returns package name of advanced vpn.
-     */
-    String getAdvancedVpnPackageName();
-
-    /**
-     * Returns {@code true} advanced vpn is supported.
-     */
-    boolean isAdvancedVpnSupported(Context context);
-
-    /**
-     * Returns the title of advanced vpn preference group.
-     */
-    String getAdvancedVpnPreferenceGroupTitle(Context context);
-
-    /**
-     * Returns the title of vpn preference group.
-     */
-    String getVpnPreferenceGroupTitle(Context context);
-
-    /**
-     * Returns {@code true} advanced vpn is removable.
-     */
-    boolean isAdvancedVpnRemovable();
-
-    /**
-     * Returns {@code true} if the disconnect dialog is enabled when advanced vpn is connected.
-     */
-    boolean isDisconnectDialogEnabled();
-}
diff --git a/src/com/android/settings/vpn2/AdvancedVpnFeatureProviderImpl.java b/src/com/android/settings/vpn2/AdvancedVpnFeatureProviderImpl.java
deleted file mode 100644
index b8f58a9..0000000
--- a/src/com/android/settings/vpn2/AdvancedVpnFeatureProviderImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2022 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.vpn2;
-
-import android.content.Context;
-
-/**
- * Feature provider implementation for advanced vpn.
- */
-public class AdvancedVpnFeatureProviderImpl implements AdvancedVpnFeatureProvider {
-    @Override
-    public String getAdvancedVpnPackageName() {
-        return null;
-    }
-
-    @Override
-    public boolean isAdvancedVpnSupported(Context context) {
-        return false;
-    }
-
-    @Override
-    public String getAdvancedVpnPreferenceGroupTitle(Context context) {
-        return null;
-    }
-
-    @Override
-    public String getVpnPreferenceGroupTitle(Context context) {
-        return null;
-    }
-
-    @Override
-    public boolean isAdvancedVpnRemovable() {
-        return true;
-    }
-
-    @Override
-    public boolean isDisconnectDialogEnabled() {
-        return true;
-    }
-}
diff --git a/src/com/android/settings/vpn2/AppManagementFragment.java b/src/com/android/settings/vpn2/AppManagementFragment.java
index d2fa5fc..d4ee5b9 100644
--- a/src/com/android/settings/vpn2/AppManagementFragment.java
+++ b/src/com/android/settings/vpn2/AppManagementFragment.java
@@ -48,7 +48,6 @@
 import com.android.settings.SettingsPreferenceFragment;
 import com.android.settings.core.SubSettingLauncher;
 import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
-import com.android.settings.overlay.FeatureFactory;
 import com.android.settingslib.RestrictedLockUtils;
 import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
 import com.android.settingslib.RestrictedPreference;
@@ -72,7 +71,6 @@
     private PackageManager mPackageManager;
     private DevicePolicyManager mDevicePolicyManager;
     private VpnManager mVpnManager;
-    private AdvancedVpnFeatureProvider mFeatureProvider;
 
     // VPN app info
     private final int mUserId = UserHandle.myUserId();
@@ -124,7 +122,6 @@
         mPackageManager = getContext().getPackageManager();
         mDevicePolicyManager = getContext().getSystemService(DevicePolicyManager.class);
         mVpnManager = getContext().getSystemService(VpnManager.class);
-        mFeatureProvider = FeatureFactory.getFactory(getContext()).getAdvancedVpnFeatureProvider();
 
         mPreferenceAlwaysOn = (RestrictedSwitchPreference) findPreference(KEY_ALWAYS_ON_VPN);
         mPreferenceLockdown = (RestrictedSwitchPreference) findPreference(KEY_LOCKDOWN_VPN);
@@ -286,16 +283,7 @@
         }
     }
 
-    @VisibleForTesting
-    void updateRestrictedViews() {
-        if (mFeatureProvider.isAdvancedVpnSupported(getContext())
-                && !mFeatureProvider.isAdvancedVpnRemovable()
-                && TextUtils.equals(mPackageName, mFeatureProvider.getAdvancedVpnPackageName())) {
-            mPreferenceForget.setVisible(false);
-        } else {
-            mPreferenceForget.setVisible(true);
-        }
-
+    private void updateRestrictedViews() {
         if (isAdded()) {
             mPreferenceAlwaysOn.checkRestrictionAndSetDisabled(UserManager.DISALLOW_CONFIG_VPN,
                     mUserId);
@@ -326,14 +314,6 @@
         }
     }
 
-    @VisibleForTesting
-    void init(String packageName, AdvancedVpnFeatureProvider featureProvider,
-            RestrictedPreference preference) {
-        mPackageName = packageName;
-        mFeatureProvider = featureProvider;
-        mPreferenceForget = preference;
-    }
-
     private String getAlwaysOnVpnPackage() {
         return mVpnManager.getAlwaysOnVpnPackageForUser(mUserId);
     }
diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java
index a91bb6c..e89785f 100644
--- a/src/com/android/settings/vpn2/VpnSettings.java
+++ b/src/com/android/settings/vpn2/VpnSettings.java
@@ -26,7 +26,6 @@
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.Intent;
-import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
 import android.net.ConnectivityManager;
@@ -43,7 +42,6 @@
 import android.os.UserManager;
 import android.security.Credentials;
 import android.security.LegacyVpnProfileStore;
-import android.text.TextUtils;
 import android.util.ArrayMap;
 import android.util.ArraySet;
 import android.util.Log;
@@ -54,7 +52,6 @@
 import androidx.annotation.VisibleForTesting;
 import androidx.preference.Preference;
 import androidx.preference.PreferenceGroup;
-import androidx.preference.PreferenceScreen;
 
 import com.android.internal.annotations.GuardedBy;
 import com.android.internal.net.LegacyVpnInfo;
@@ -62,7 +59,6 @@
 import com.android.internal.net.VpnProfile;
 import com.android.settings.R;
 import com.android.settings.RestrictedSettingsFragment;
-import com.android.settings.overlay.FeatureFactory;
 import com.android.settings.widget.GearPreference;
 import com.android.settings.widget.GearPreference.OnGearClickListener;
 import com.android.settingslib.RestrictedLockUtilsInternal;
@@ -83,12 +79,9 @@
 public class VpnSettings extends RestrictedSettingsFragment implements
         Handler.Callback, Preference.OnPreferenceClickListener {
     private static final String LOG_TAG = "VpnSettings";
-    private static final boolean DEBUG = Log.isLoggable(LOG_TAG, Log.DEBUG);
 
     private static final int RESCAN_MESSAGE = 0;
     private static final int RESCAN_INTERVAL_MS = 1000;
-    private static final String ADVANCED_VPN_GROUP_KEY = "advanced_vpn_group";
-    private static final String VPN_GROUP_KEY = "vpn_group";
 
     private static final NetworkRequest VPN_REQUEST = new NetworkRequest.Builder()
             .removeCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN)
@@ -109,9 +102,6 @@
     private LegacyVpnInfo mConnectedLegacyVpn;
 
     private boolean mUnavailable;
-    private AdvancedVpnFeatureProvider mFeatureProvider;
-    private PreferenceScreen mPreferenceScreen;
-    private boolean mIsAdvancedVpnSupported;
 
     public VpnSettings() {
         super(UserManager.DISALLOW_CONFIG_VPN);
@@ -129,14 +119,11 @@
         mUserManager = (UserManager) getSystemService(Context.USER_SERVICE);
         mConnectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
         mVpnManager = (VpnManager) getSystemService(Context.VPN_MANAGEMENT_SERVICE);
-        mFeatureProvider = FeatureFactory.getFactory(getContext()).getAdvancedVpnFeatureProvider();
-        mIsAdvancedVpnSupported = mFeatureProvider.isAdvancedVpnSupported(getContext());
 
         mUnavailable = isUiRestricted();
         setHasOptionsMenu(!mUnavailable);
 
         addPreferencesFromResource(R.xml.vpn_settings2);
-        mPreferenceScreen = getPreferenceScreen();
     }
 
     @Override
@@ -242,8 +229,7 @@
 
         // Run heavy RPCs before switching to UI thread
         final List<VpnProfile> vpnProfiles = loadVpnProfiles();
-        final List<AppVpnInfo> vpnApps = getVpnApps(context, /* includeProfiles */ true,
-                mFeatureProvider);
+        final List<AppVpnInfo> vpnApps = getVpnApps(context, /* includeProfiles */ true);
 
         final Map<String, LegacyVpnInfo> connectedLegacyVpns = getConnectedLegacyVpns();
         final Set<AppVpnInfo> connectedAppVpns = getConnectedAppVpns();
@@ -279,7 +265,7 @@
 
         private final VpnSettings mSettings;
 
-        UpdatePreferences(VpnSettings settings) {
+        public UpdatePreferences(VpnSettings settings) {
             mSettings = settings;
         }
 
@@ -346,14 +332,7 @@
             }
 
             // Trim out deleted VPN preferences
-            if (DEBUG) {
-                Log.d(LOG_TAG, "isAdvancedVpnSupported() : " + mSettings.mIsAdvancedVpnSupported);
-            }
-            if (mSettings.mIsAdvancedVpnSupported) {
-                mSettings.setShownAdvancedPreferences(updates);
-            } else {
-                mSettings.setShownPreferences(updates);
-            }
+            mSettings.setShownPreferences(updates);
         }
     }
 
@@ -364,61 +343,12 @@
 
     @VisibleForTesting @UiThread
     public void setShownPreferences(final Collection<Preference> updates) {
-        retainAllPreference(updates);
-
-        final PreferenceGroup vpnGroup = mPreferenceScreen;
-        updatePreferenceGroup(vpnGroup, updates);
-
-        // Show all new preferences on the screen
-        for (Preference pref : updates) {
-            vpnGroup.addPreference(pref);
-        }
-    }
-
-    @VisibleForTesting @UiThread
-    void setShownAdvancedPreferences(final Collection<Preference> updates) {
-        retainAllPreference(updates);
-
-        PreferenceGroup advancedVpnGroup = mPreferenceScreen.findPreference(ADVANCED_VPN_GROUP_KEY);
-        PreferenceGroup vpnGroup = mPreferenceScreen.findPreference(VPN_GROUP_KEY);
-        advancedVpnGroup.setTitle(
-                mFeatureProvider.getAdvancedVpnPreferenceGroupTitle(getContext()));
-        vpnGroup.setTitle(mFeatureProvider.getVpnPreferenceGroupTitle(getContext()));
-        updatePreferenceGroup(advancedVpnGroup, updates);
-        updatePreferenceGroup(vpnGroup, updates);
-
-        // Show all new preferences on the screen
-        for (Preference pref : updates) {
-            String packageName = "";
-            if (pref instanceof LegacyVpnPreference) {
-                LegacyVpnPreference legacyPref = (LegacyVpnPreference) pref;
-                packageName = legacyPref.getPackageName();
-            } else if (pref instanceof AppPreference) {
-                AppPreference appPref = (AppPreference) pref;
-                packageName = appPref.getPackageName();
-            }
-            if (DEBUG) {
-                Log.d(LOG_TAG, "setShownAdvancedPreferences() package name : " + packageName);
-            }
-            if (TextUtils.equals(packageName, mFeatureProvider.getAdvancedVpnPackageName())) {
-                advancedVpnGroup.addPreference(pref);
-            } else {
-                vpnGroup.addPreference(pref);
-            }
-        }
-
-        advancedVpnGroup.setVisible(advancedVpnGroup.getPreferenceCount() > 0);
-        vpnGroup.setVisible(vpnGroup.getPreferenceCount() > 0);
-    }
-
-    private void retainAllPreference(Collection<Preference> updates) {
         mLegacyVpnPreferences.values().retainAll(updates);
         mAppPreferences.values().retainAll(updates);
-    }
 
-    private void updatePreferenceGroup(PreferenceGroup vpnGroup, Collection<Preference> updates) {
         // Change {@param updates} in-place to only contain new preferences that were not already
         // added to the preference screen.
+        final PreferenceGroup vpnGroup = getPreferenceScreen();
         for (int i = vpnGroup.getPreferenceCount() - 1; i >= 0; i--) {
             Preference p = vpnGroup.getPreference(i);
             if (updates.contains(p)) {
@@ -427,6 +357,11 @@
                 vpnGroup.removePreference(p);
             }
         }
+
+        // Show any new preferences on the screen
+        for (Preference pref : updates) {
+            vpnGroup.addPreference(pref);
+        }
     }
 
     @Override
@@ -448,16 +383,14 @@
         } else if (preference instanceof AppPreference) {
             AppPreference pref = (AppPreference) preference;
             boolean connected = (pref.getState() == AppPreference.STATE_CONNECTED);
-            String vpnPackageName = pref.getPackageName();
 
-            if ((!connected) || (isAdvancedVpn(mFeatureProvider, vpnPackageName, getContext())
-                    && !mFeatureProvider.isDisconnectDialogEnabled())) {
+            if (!connected) {
                 try {
                     UserHandle user = UserHandle.of(pref.getUserId());
-                    Context userContext = getContext().createPackageContextAsUser(
-                            getContext().getPackageName(), 0 /* flags */, user);
+                    Context userContext = getActivity().createPackageContextAsUser(
+                            getActivity().getPackageName(), 0 /* flags */, user);
                     PackageManager pm = userContext.getPackageManager();
-                    Intent appIntent = pm.getLaunchIntentForPackage(vpnPackageName);
+                    Intent appIntent = pm.getLaunchIntentForPackage(pref.getPackageName());
                     if (appIntent != null) {
                         userContext.startActivityAsUser(appIntent, user);
                         return true;
@@ -537,32 +470,9 @@
             pref.setOnPreferenceClickListener(this);
             mAppPreferences.put(app, pref);
         }
-        enableAdvancedVpnGearIconIfNecessary(pref);
         return pref;
     }
 
-    private void enableAdvancedVpnGearIconIfNecessary(AppPreference pref) {
-        Context context = getContext();
-        if (!isAdvancedVpn(mFeatureProvider, pref.getPackageName(), context)) {
-            return;
-        }
-
-        boolean isEnabled = false;
-        AppOpsManager appOpsManager = getContext().getSystemService(AppOpsManager.class);
-        List<AppOpsManager.PackageOps> apps =
-                appOpsManager.getPackagesForOps(
-                        new int[] {OP_ACTIVATE_VPN, OP_ACTIVATE_PLATFORM_VPN});
-        if (apps != null) {
-            for (AppOpsManager.PackageOps pkg : apps) {
-                if (isAdvancedVpn(mFeatureProvider, pkg.getPackageName(), context)) {
-                    isEnabled = true;
-                    break;
-                }
-            }
-        }
-        pref.setOnGearClickListener(isEnabled ? mGearListener : null);
-    }
-
     @WorkerThread
     private Map<String, LegacyVpnInfo> getConnectedLegacyVpns() {
         mConnectedLegacyVpn = mVpnManager.getLegacyVpnInfo(UserHandle.myUserId());
@@ -598,15 +508,7 @@
         return result;
     }
 
-    static List<AppVpnInfo> getVpnApps(Context context, boolean includeProfiles,
-            AdvancedVpnFeatureProvider featureProvider) {
-        return getVpnApps(context, includeProfiles, featureProvider,
-                context.getSystemService(AppOpsManager.class));
-    }
-
-    @VisibleForTesting
-    static List<AppVpnInfo> getVpnApps(Context context, boolean includeProfiles,
-            AdvancedVpnFeatureProvider featureProvider, AppOpsManager aom) {
+    static List<AppVpnInfo> getVpnApps(Context context, boolean includeProfiles) {
         List<AppVpnInfo> result = Lists.newArrayList();
 
         final Set<Integer> profileIds;
@@ -619,19 +521,8 @@
             profileIds = Collections.singleton(UserHandle.myUserId());
         }
 
-        if (featureProvider.isAdvancedVpnSupported(context)) {
-            PackageManager pm = context.getPackageManager();
-            try {
-                ApplicationInfo appInfo =
-                        pm.getApplicationInfo(
-                                featureProvider.getAdvancedVpnPackageName(), /* flags= */ 0);
-                int userId = UserHandle.getUserId(appInfo.uid);
-                result.add(new AppVpnInfo(userId, featureProvider.getAdvancedVpnPackageName()));
-            } catch (PackageManager.NameNotFoundException e) {
-                Log.e(LOG_TAG, "Advanced VPN package name not found.", e);
-            }
-        }
-
+        // Fetch VPN-enabled apps from AppOps.
+        AppOpsManager aom = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
         List<AppOpsManager.PackageOps> apps =
                 aom.getPackagesForOps(new int[] {OP_ACTIVATE_VPN, OP_ACTIVATE_PLATFORM_VPN});
         if (apps != null) {
@@ -641,9 +532,6 @@
                     // Skip packages for users outside of our profile group.
                     continue;
                 }
-                if (isAdvancedVpn(featureProvider, pkg.getPackageName(), context)) {
-                    continue;
-                }
                 // Look for a MODE_ALLOWED permission to activate VPN.
                 boolean allowed = false;
                 for (AppOpsManager.OpEntry op : pkg.getOps()) {
@@ -662,12 +550,6 @@
         return result;
     }
 
-    private static boolean isAdvancedVpn(AdvancedVpnFeatureProvider featureProvider,
-            String packageName, Context context) {
-        return featureProvider.isAdvancedVpnSupported(context)
-                && TextUtils.equals(packageName, featureProvider.getAdvancedVpnPackageName());
-    }
-
     private static List<VpnProfile> loadVpnProfiles() {
         final ArrayList<VpnProfile> result = Lists.newArrayList();
 
@@ -680,10 +562,4 @@
         }
         return result;
     }
-
-    @VisibleForTesting
-    void init(PreferenceScreen preferenceScreen, AdvancedVpnFeatureProvider featureProvider) {
-        mPreferenceScreen = preferenceScreen;
-        mFeatureProvider = featureProvider;
-    }
 }
diff --git a/tests/robotests/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrollingTest.java b/tests/robotests/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrollingTest.java
index b808319..a7b7501 100644
--- a/tests/robotests/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrollingTest.java
+++ b/tests/robotests/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrollingTest.java
@@ -151,6 +151,16 @@
     }
 
     @Test
+    public void fingerprintUdfpsOverlayEnrollment_loseFocusWithCancelFlag_shouldNotCancelAgain() {
+        initializeActivityFor(TYPE_UDFPS_OPTICAL);
+
+        mActivity.mIsCanceled = true;
+        mActivity.onWindowFocusChanged(true);
+
+        verify(mActivity, never()).onCancelEnrollment(anyInt());
+    }
+
+    @Test
     public void fingerprintSfpsEnroll_PlaysAllAnimationsAssetsCorrectly() {
         initializeActivityFor(TYPE_POWER_BUTTON);
 
diff --git a/tests/robotests/src/com/android/settings/dream/WhenToDreamPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/dream/WhenToDreamPreferenceControllerTest.java
index 3305cde..458c5c6 100644
--- a/tests/robotests/src/com/android/settings/dream/WhenToDreamPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/dream/WhenToDreamPreferenceControllerTest.java
@@ -16,15 +16,24 @@
 
 package com.android.settings.dream;
 
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.anyInt;
+import static org.mockito.Mockito.anyString;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import android.content.Context;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.os.PowerManager;
 
 import androidx.preference.Preference;
 import androidx.test.core.app.ApplicationProvider;
 
+import com.android.settings.R;
+import com.android.settings.display.AmbientDisplayAlwaysOnPreferenceController;
 import com.android.settingslib.dream.DreamBackend;
 import com.android.settingslib.dream.DreamBackend.WhenToDream;
 
@@ -38,32 +47,64 @@
 
 @RunWith(RobolectricTestRunner.class)
 public class WhenToDreamPreferenceControllerTest {
+    private static final String TEST_PACKAGE = "com.android.test";
 
     private WhenToDreamPreferenceController mController;
     private Context mContext;
     @Mock
     private DreamBackend mBackend;
+    @Mock
+    private PowerManager mPowerManager;
+    @Mock
+    private PackageManager mPackageManager;
+    @Mock
+    private ApplicationInfo mApplicationInfo;
 
     @Before
-    public void setup() {
+    public void setup() throws Exception {
         MockitoAnnotations.initMocks(this);
-        mContext = ApplicationProvider.getApplicationContext();
-        mController = new WhenToDreamPreferenceController(mContext);
+        mContext = spy(ApplicationProvider.getApplicationContext());
+        mController = new WhenToDreamPreferenceController(mContext, true);
         ReflectionHelpers.setField(mController, "mBackend", mBackend);
+        when(mContext.getSystemService(PowerManager.class)).thenReturn(mPowerManager);
+        when(mPowerManager.isAmbientDisplaySuppressedForTokenByApp(anyString(), anyInt()))
+                .thenReturn(false);
+
+        mApplicationInfo.uid = 1;
+        when(mContext.getString(
+                com.android.internal.R.string.config_defaultWellbeingPackage)).thenReturn(
+                TEST_PACKAGE);
+
+        when(mContext.getPackageManager()).thenReturn(mPackageManager);
+        when(mPackageManager.getApplicationInfo(TEST_PACKAGE, /* flag= */ 0)).thenReturn(
+                mApplicationInfo);
     }
 
     @Test
-    public void updateSummary() {
+    public void testUpdateSummary() {
         // Don't have to test the other settings because DreamSettings tests that all
         // @WhenToDream values map to the correct ResId
         final @WhenToDream int testSetting = DreamBackend.WHILE_CHARGING;
         final Preference mockPref = mock(Preference.class);
         when(mockPref.getContext()).thenReturn(mContext);
         when(mBackend.getWhenToDreamSetting()).thenReturn(testSetting);
-        final String expectedString =
-                mContext.getString(DreamSettings.getDreamSettingDescriptionResId(testSetting));
+        final int expectedResId = DreamSettings.getDreamSettingDescriptionResId(testSetting);
 
         mController.updateState(mockPref);
-        verify(mockPref).setSummary(expectedString);
+        verify(mockPref).setSummary(expectedResId);
+    }
+
+    @Test
+    public void testBedtimeModeSuppression() {
+        final Preference mockPref = mock(Preference.class);
+        when(mockPref.getContext()).thenReturn(mContext);
+        when(mBackend.getWhenToDreamSetting()).thenReturn(DreamBackend.WHILE_CHARGING);
+        when(mPowerManager.isAmbientDisplaySuppressedForTokenByApp(anyString(), anyInt()))
+                .thenReturn(true);
+
+        assertTrue(AmbientDisplayAlwaysOnPreferenceController.isAodSuppressedByBedtime(mContext));
+
+        mController.updateState(mockPref);
+        verify(mockPref).setSummary(R.string.screensaver_settings_when_to_dream_bedtime);
     }
 }
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationAssistantPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/NotificationAssistantPreferenceControllerTest.java
index b594667..1dac399 100644
--- a/tests/robotests/src/com/android/settings/notification/NotificationAssistantPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/NotificationAssistantPreferenceControllerTest.java
@@ -226,4 +226,14 @@
                 .setNASMigrationDoneAndResetDefault(eq(10), anyBoolean());
     }
 
+    @Test
+    public void testNASUnavailable_settingDisabled() throws Exception {
+        when(mBackend.getDefaultNotificationAssistant()).thenReturn(null);
+        mPreferenceController.getDefaultNASIntent();
+        mPreferenceController.updateState(mPreference);
+
+        verify(mPreference, times(1)).setSwitchEnabled(eq(false));
+        assertFalse(mPreference.isEnabled());
+    }
+
 }
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationVolumePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/NotificationVolumePreferenceControllerTest.java
index fe4744f..96b9e62 100644
--- a/tests/robotests/src/com/android/settings/notification/NotificationVolumePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/NotificationVolumePreferenceControllerTest.java
@@ -22,10 +22,14 @@
 import static org.mockito.Mockito.when;
 
 import android.content.Context;
+import android.content.res.Resources;
 import android.media.AudioManager;
 import android.os.Vibrator;
+import android.service.notification.NotificationListenerService;
 import android.telephony.TelephonyManager;
 
+import com.android.internal.R;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -46,6 +50,8 @@
     private AudioManager mAudioManager;
     @Mock
     private Vibrator mVibrator;
+    @Mock
+    private Resources mResources;
 
     private Context mContext;
     private NotificationVolumePreferenceController mController;
@@ -57,6 +63,8 @@
         when(mContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn(mTelephonyManager);
         when(mContext.getSystemService(Context.AUDIO_SERVICE)).thenReturn(mAudioManager);
         when(mContext.getSystemService(Context.VIBRATOR_SERVICE)).thenReturn(mVibrator);
+        when(mContext.getResources()).thenReturn(mResources);
+
         mController = new NotificationVolumePreferenceController(mContext);
         mController.setAudioHelper(mHelper);
     }
@@ -76,15 +84,50 @@
     }
 
     @Test
-    public void isAvailable_voiceCapable_shouldReturnFalse() {
+    public void isAvailable_voiceCapable_aliasedWithRing_shouldReturnFalse() {
+        when(mResources.getBoolean(
+                com.android.settings.R.bool.config_show_notification_volume)).thenReturn(true);
+        when(mResources.getBoolean(R.bool.config_alias_ring_notif_stream_types)).thenReturn(true);
+
+        NotificationVolumePreferenceController controller =
+                new NotificationVolumePreferenceController(mContext);
         when(mHelper.isSingleVolume()).thenReturn(false);
         when(mTelephonyManager.isVoiceCapable()).thenReturn(true);
 
+        assertThat(controller.isAvailable()).isFalse();
+    }
+
+    /**
+     * With the introduction of ring-notification volume separation, voice-capable devices could now
+     * display the notification volume slider.
+     */
+    @Test
+    public void isAvailable_voiceCapable_separatedFromRing_shouldReturnTrue() {
+        when(mResources.getBoolean(
+                com.android.settings.R.bool.config_show_notification_volume)).thenReturn(true);
+        when(mResources.getBoolean(R.bool.config_alias_ring_notif_stream_types)).thenReturn(false);
+
+        NotificationVolumePreferenceController controller =
+                new NotificationVolumePreferenceController(mContext);
+
+        when(mHelper.isSingleVolume()).thenReturn(false);
+        when(mTelephonyManager.isVoiceCapable()).thenReturn(true);
+
+        assertThat(controller.isAvailable()).isTrue();
+    }
+
+    @Test
+    public void isAvailable_notShowNotificationVolume_shouldReturnFalse() {
+        when(mResources.getBoolean(
+                com.android.settings.R.bool.config_show_notification_volume)).thenReturn(false);
+
         assertThat(mController.isAvailable()).isFalse();
     }
 
     @Test
     public void isAvailable_notSingleVolume_notVoiceCapable_shouldReturnTrue() {
+        when(mResources.getBoolean(
+                com.android.settings.R.bool.config_show_notification_volume)).thenReturn(true);
         when(mHelper.isSingleVolume()).thenReturn(false);
         when(mTelephonyManager.isVoiceCapable()).thenReturn(false);
 
@@ -107,4 +150,24 @@
     public void isPublicSlice_returnTrue() {
         assertThat(mController.isPublicSlice()).isTrue();
     }
+
+    @Test
+    public void setHintsRing_DoesNotMatch() {
+        assertThat(mController.hintsMatch(
+                NotificationListenerService.HINT_HOST_DISABLE_CALL_EFFECTS)).isFalse();
+    }
+
+    @Test
+    public void setHintsAll_Matches() {
+        assertThat(mController.hintsMatch(NotificationListenerService.HINT_HOST_DISABLE_EFFECTS))
+                .isTrue();
+    }
+
+    @Test
+    public void setHintNotification_Matches() {
+        assertThat(mController
+                .hintsMatch(NotificationListenerService.HINT_HOST_DISABLE_NOTIFICATION_EFFECTS))
+                .isTrue();
+    }
+
 }
diff --git a/tests/robotests/src/com/android/settings/notification/RingVolumePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/RingVolumePreferenceControllerTest.java
index 5e484a3..02757d5 100644
--- a/tests/robotests/src/com/android/settings/notification/RingVolumePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/RingVolumePreferenceControllerTest.java
@@ -18,15 +18,20 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
+import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
 
 import android.app.NotificationManager;
 import android.content.ComponentName;
 import android.content.Context;
+import android.content.res.Resources;
 import android.media.AudioManager;
 import android.os.Vibrator;
+import android.service.notification.NotificationListenerService;
 import android.telephony.TelephonyManager;
 
+import com.android.settings.R;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -51,8 +56,13 @@
     private NotificationManager mNotificationManager;
     @Mock
     private ComponentName mSuppressor;
+    @Mock
+    private Resources mResources;
+    @Mock
+    private VolumeSeekBarPreference mPreference;
 
     private Context mContext;
+
     private RingVolumePreferenceController mController;
 
     @Before
@@ -63,8 +73,9 @@
         shadowContext.setSystemService(Context.AUDIO_SERVICE, mAudioManager);
         shadowContext.setSystemService(Context.VIBRATOR_SERVICE, mVibrator);
         shadowContext.setSystemService(Context.NOTIFICATION_SERVICE, mNotificationManager);
-        mContext = RuntimeEnvironment.application;
+        mContext = spy(RuntimeEnvironment.application);
         when(mNotificationManager.getEffectsSuppressor()).thenReturn(mSuppressor);
+        when(mContext.getResources()).thenReturn(mResources);
         mController = new RingVolumePreferenceController(mContext);
         mController.setAudioHelper(mHelper);
     }
@@ -109,4 +120,92 @@
     public void isPublicSlice_returnTrue() {
         assertThat(mController.isPublicSlice()).isTrue();
     }
+
+    // todo: verify that the title change is displayed, by examining the underlying preference
+    @Test
+    public void ringNotificationStreamsNotAliased_sliderTitleSetToRingOnly() {
+        when(mResources.getBoolean(
+                com.android.internal.R.bool.config_alias_ring_notif_stream_types))
+                .thenReturn(false);
+        final RingVolumePreferenceController controller =
+                new RingVolumePreferenceController(mContext);
+
+        int expectedTitleId = R.string.separate_ring_volume_option_title;
+
+        assertThat(controller.mTitleId).isEqualTo(expectedTitleId);
+    }
+
+    @Test
+    public void ringNotificationStreamsAliased_sliderTitleIncludesBothRingNotification() {
+
+        when(mResources.getBoolean(
+                com.android.internal.R.bool.config_alias_ring_notif_stream_types)).thenReturn(true);
+        final RingVolumePreferenceController control = new RingVolumePreferenceController(mContext);
+
+        int expectedTitleId = R.string.ring_volume_option_title;
+
+        assertThat(control.mTitleId).isEqualTo(expectedTitleId);
+    }
+
+    @Test
+    public void setHintsRing_aliased_Matches() {
+        assertThat(mController.hintsMatch(
+                NotificationListenerService.HINT_HOST_DISABLE_CALL_EFFECTS, true)).isTrue();
+    }
+
+    @Test
+    public void setHintsRingNotification_aliased_Matches() {
+        assertThat(mController.hintsMatch(NotificationListenerService.HINT_HOST_DISABLE_EFFECTS,
+                true)).isTrue();
+    }
+
+    @Test
+    public void setHintNotification_aliased_Matches() {
+        assertThat(mController
+                .hintsMatch(NotificationListenerService.HINT_HOST_DISABLE_NOTIFICATION_EFFECTS,
+                true)).isTrue();
+    }
+
+    @Test
+    public void setHintsRing_unaliased_Matches() {
+        assertThat(mController.hintsMatch(
+                NotificationListenerService.HINT_HOST_DISABLE_CALL_EFFECTS, false)).isTrue();
+    }
+
+    @Test
+    public void setHintsRingNotification_unaliased_Matches() {
+        assertThat(mController.hintsMatch(NotificationListenerService.HINT_HOST_DISABLE_EFFECTS,
+                false)).isTrue();
+    }
+
+    @Test
+    public void setHintNotification_unaliased_doesNotMatch() {
+        assertThat(mController
+                .hintsMatch(NotificationListenerService.HINT_HOST_DISABLE_NOTIFICATION_EFFECTS,
+                        false)).isFalse();
+    }
+
+    @Test
+    public void setRingerModeToVibrate_butNoVibratorAvailable_iconIsSilent() {
+        when(mHelper.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_VIBRATE);
+
+        mController.setPreference(mPreference);
+        mController.setVibrator(null);
+        mController.updateRingerMode();
+
+        assertThat(mController.getMuteIcon()).isEqualTo(mController.mSilentIconId);
+    }
+
+    @Test
+    public void setRingerModeToVibrate_VibratorAvailable_iconIsVibrate() {
+        when(mHelper.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_VIBRATE);
+        when(mVibrator.hasVibrator()).thenReturn(true);
+
+        mController.setPreference(mPreference);
+        mController.setVibrator(mVibrator);
+        mController.updateRingerMode();
+
+        assertThat(mController.getMuteIcon()).isEqualTo(mController.mVibrateIconId);
+    }
+
 }
diff --git a/tests/robotests/src/com/android/settings/notification/ShowOnLockscreenNotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/ShowOnLockscreenNotificationPreferenceControllerTest.java
index 496897f..567c7ff 100644
--- a/tests/robotests/src/com/android/settings/notification/ShowOnLockscreenNotificationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/ShowOnLockscreenNotificationPreferenceControllerTest.java
@@ -28,6 +28,8 @@
 import android.content.Context;
 import android.provider.Settings;
 
+import androidx.preference.PreferenceScreen;
+
 import com.android.settings.R;
 import com.android.settings.RestrictedListPreference;
 import com.android.settings.testutils.shadow.ShadowRestrictedLockUtilsInternal;
@@ -42,11 +44,8 @@
 import org.robolectric.Robolectric;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
-import org.robolectric.Shadows;
 import org.robolectric.annotation.Config;
 
-import androidx.preference.PreferenceScreen;
-
 @RunWith(RobolectricTestRunner.class)
 @Config(shadows = {ShadowUserManager.class, ShadowRestrictedLockUtilsInternal.class})
 public class ShowOnLockscreenNotificationPreferenceControllerTest {
@@ -94,7 +93,7 @@
         assertThat(mPreference.getValue()).isEqualTo(
                 String.valueOf(R.string.lock_screen_notifs_show_none));
 
-        assertThat(mPreference.getSummary())
+        assertThat(mPreference.getSummary().toString())
                 .isEqualTo(mContext.getString(R.string.lock_screen_notifs_show_none));
     }
 
@@ -111,7 +110,7 @@
 
         assertThat(mPreference.getValue()).isEqualTo(
                 String.valueOf(R.string.lock_screen_notifs_show_alerting));
-        assertThat(mPreference.getSummary())
+        assertThat(mPreference.getSummary().toString())
                 .isEqualTo(mContext.getString(R.string.lock_screen_notifs_show_alerting));
     }
 
@@ -128,20 +127,20 @@
 
         assertThat(mPreference.getValue()).isEqualTo(
                 String.valueOf(R.string.lock_screen_notifs_show_all));
-        assertThat(mPreference.getSummary())
+        assertThat(mPreference.getSummary().toString())
                 .isEqualTo(mContext.getString(R.string.lock_screen_notifs_show_all));
     }
 
     @Test
-    public void updateState_allNotifsOnLockscreen_isDefault() {
+    public void updateState_alertingNotifsOnLockscreen_isDefault() {
         // settings don't exist
 
         mController.displayPreference(mScreen);
 
         assertThat(mPreference.getValue()).isEqualTo(
-                String.valueOf(R.string.lock_screen_notifs_show_all));
-        assertThat(mPreference.getSummary())
-                .isEqualTo(mContext.getString(R.string.lock_screen_notifs_show_all));
+                String.valueOf(R.string.lock_screen_notifs_show_alerting));
+        assertThat(mPreference.getSummary().toString())
+                .isEqualTo(mContext.getString(R.string.lock_screen_notifs_show_alerting));
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/notification/SoundSettingsTest.java b/tests/robotests/src/com/android/settings/notification/SoundSettingsTest.java
index c2ea6e7..9e84883 100644
--- a/tests/robotests/src/com/android/settings/notification/SoundSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/notification/SoundSettingsTest.java
@@ -35,6 +35,7 @@
 import com.android.settings.testutils.shadow.ShadowDeviceConfig;
 import com.android.settings.testutils.shadow.ShadowUserManager;
 
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.robolectric.RobolectricTestRunner;
@@ -44,8 +45,6 @@
 
 import java.util.List;
 
-import org.junit.Ignore;
-
 @RunWith(RobolectricTestRunner.class)
 public class SoundSettingsTest {
 
@@ -86,4 +85,19 @@
 
         assertThat(settings.mHandler.hasMessages(SoundSettings.STOP_SAMPLE)).isTrue();
     }
+
+    @Test
+    public void notificationVolume_isBetweenRingAndAlarm() {
+        final Context context = spy(RuntimeEnvironment.application);
+        final SoundSettings settings = new SoundSettings();
+        final int xmlId = settings.getPreferenceScreenResId();
+        final List<String> keys = XmlTestUtils.getKeysFromPreferenceXml(context, xmlId);
+
+        int ring = keys.indexOf("ring_volume");
+        int notification = keys.indexOf("notification_volume");
+        int alarm = keys.indexOf("alarm_volume");
+
+        assertThat(ring < notification).isTrue();
+        assertThat(notification < alarm).isTrue();
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java
index b04a2cd..77ddfbd 100644
--- a/tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java
@@ -53,12 +53,12 @@
 import com.android.settingslib.bluetooth.BluetoothEventManager;
 import com.android.settingslib.bluetooth.HeadsetProfile;
 import com.android.settingslib.bluetooth.HearingAidProfile;
+import com.android.settingslib.bluetooth.LeAudioProfile;
 import com.android.settingslib.bluetooth.LocalBluetoothManager;
 import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
@@ -74,7 +74,6 @@
 import java.util.List;
 
 @RunWith(RobolectricTestRunner.class)
-@Ignore
 @Config(shadows = {
         ShadowAudioManager.class,
         ShadowBluetoothUtils.class,
@@ -102,6 +101,8 @@
     private HeadsetProfile mHeadsetProfile;
     @Mock
     private HearingAidProfile mHearingAidProfile;
+    @Mock
+    private LeAudioProfile mLeAudioProfile;
 
     private Context mContext;
     private PreferenceScreen mScreen;
@@ -117,6 +118,7 @@
     private AudioSwitchPreferenceController mController;
     private List<BluetoothDevice> mProfileConnectedDevices;
     private List<BluetoothDevice> mHearingAidActiveDevices;
+    private List<BluetoothDevice> mLeAudioActiveDevices;
     private List<BluetoothDevice> mEmptyDevices;
     private ShadowPackageManager mPackageManager;
 
@@ -136,6 +138,7 @@
         when(mLocalBluetoothProfileManager.getA2dpProfile()).thenReturn(mA2dpProfile);
         when(mLocalBluetoothProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile);
         when(mLocalBluetoothProfileManager.getHeadsetProfile()).thenReturn(mHeadsetProfile);
+        when(mLocalBluetoothProfileManager.getLeAudioProfile()).thenReturn(mLeAudioProfile);
         mPackageManager = Shadow.extract(mContext.getPackageManager());
         mPackageManager.setSystemFeature(PackageManager.FEATURE_BLUETOOTH, true);
 
@@ -156,6 +159,7 @@
         mPreference = new ListPreference(mContext);
         mProfileConnectedDevices = new ArrayList<>();
         mHearingAidActiveDevices = new ArrayList<>(2);
+        mLeAudioActiveDevices = new ArrayList<>();
         mEmptyDevices = new ArrayList<>(2);
 
         when(mScreen.getPreferenceManager()).thenReturn(mock(PreferenceManager.class));
@@ -391,6 +395,55 @@
         assertThat(mEmptyDevices).containsExactly(mBluetoothDevice, mLeftBluetoothHapDevice);
     }
 
+    @Test
+    public void getConnectedLeAudioDevices_connectedLeAudioDevice_shouldAddDeviceToList() {
+        mEmptyDevices.clear();
+        mProfileConnectedDevices.clear();
+        mProfileConnectedDevices.add(mBluetoothDevice);
+        when(mLeAudioProfile.getConnectedDevices()).thenReturn(mProfileConnectedDevices);
+
+        mEmptyDevices.addAll(mController.getConnectedLeAudioDevices());
+
+        assertThat(mEmptyDevices).containsExactly(mBluetoothDevice);
+    }
+
+    @Test
+    public void getConnectedLeAudioDevices_disconnectedLeAudioDevice_shouldNotAddDeviceToList() {
+        BluetoothDevice connectdBtLeAduioDevice =
+                spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_2));
+        when(connectdBtLeAduioDevice.isConnected()).thenReturn(true);
+        BluetoothDevice disonnectdBtLeAduioDevice =
+                spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_3));
+        when(disonnectdBtLeAduioDevice.isConnected()).thenReturn(false);
+        mEmptyDevices.clear();
+        mProfileConnectedDevices.clear();
+        mProfileConnectedDevices.add(mBluetoothDevice);
+        mProfileConnectedDevices.add(connectdBtLeAduioDevice);
+        mProfileConnectedDevices.add(disonnectdBtLeAduioDevice);
+        when(mLeAudioProfile.getConnectedDevices()).thenReturn(mProfileConnectedDevices);
+
+        mEmptyDevices.addAll(mController.getConnectedLeAudioDevices());
+
+        assertThat(mEmptyDevices).containsExactly(mBluetoothDevice, connectdBtLeAduioDevice);
+    }
+
+    @Test
+    public void findActiveLeAudioDevice_noActiveDevice_returnNull() {
+        mLeAudioActiveDevices.clear();
+        when(mLeAudioProfile.getActiveDevices()).thenReturn(mLeAudioActiveDevices);
+
+        assertThat(mController.findActiveLeAudioDevice()).isNull();
+    }
+
+    @Test
+    public void findActiveLeAudioDevice_withActiveDevice_returnActiveDevice() {
+        mLeAudioActiveDevices.clear();
+        mLeAudioActiveDevices.add(mBluetoothDevice);
+        when(mLeAudioProfile.getActiveDevices()).thenReturn(mLeAudioActiveDevices);
+
+        assertThat(mController.findActiveLeAudioDevice()).isEqualTo(mBluetoothDevice);
+    }
+
     private class AudioSwitchPreferenceControllerTestable extends
             AudioSwitchPreferenceController {
         AudioSwitchPreferenceControllerTestable(Context context, String key) {
diff --git a/tests/robotests/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceControllerTest.java
index 2580bfd..7543b5f 100644
--- a/tests/robotests/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceControllerTest.java
@@ -16,6 +16,7 @@
 
 package com.android.settings.sound;
 
+import static android.media.AudioSystem.DEVICE_OUT_BLE_HEADSET;
 import static android.media.AudioSystem.DEVICE_OUT_BLUETOOTH_SCO;
 import static android.media.AudioSystem.DEVICE_OUT_HEARING_AID;
 
@@ -46,19 +47,18 @@
 import com.android.settingslib.bluetooth.BluetoothEventManager;
 import com.android.settingslib.bluetooth.HeadsetProfile;
 import com.android.settingslib.bluetooth.HearingAidProfile;
+import com.android.settingslib.bluetooth.LeAudioProfile;
 import com.android.settingslib.bluetooth.LocalBluetoothManager;
 import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
-import org.robolectric.Shadows;
 import org.robolectric.annotation.Config;
 import org.robolectric.shadows.ShadowBluetoothDevice;
 
@@ -66,7 +66,6 @@
 import java.util.List;
 
 @RunWith(RobolectricTestRunner.class)
-@Ignore
 @Config(shadows = {
         ShadowAudioManager.class,
         ShadowBluetoothUtils.class,
@@ -78,10 +77,12 @@
     private static final String TEST_DEVICE_NAME_2 = "Test_HFP_BT_Device_NAME_2";
     private static final String TEST_HAP_DEVICE_NAME_1 = "Test_HAP_BT_Device_NAME_1";
     private static final String TEST_HAP_DEVICE_NAME_2 = "Test_HAP_BT_Device_NAME_2";
+    private static final String TEST_LE_AUDIO_DEVICE_NAME_1 = "Test_LE_AUDIO_Device_NAME_1";
     private static final String TEST_DEVICE_ADDRESS_1 = "00:A1:A1:A1:A1:A1";
     private static final String TEST_DEVICE_ADDRESS_2 = "00:B2:B2:B2:B2:B2";
     private static final String TEST_DEVICE_ADDRESS_3 = "00:C3:C3:C3:C3:C3";
     private static final String TEST_DEVICE_ADDRESS_4 = "00:D4:D4:D4:D4:D4";
+    private static final String TEST_DEVICE_ADDRESS_5 = "00:E5:E5:E5:E5:E5";
     private final static long HISYNCID1 = 10;
     private final static long HISYNCID2 = 11;
 
@@ -96,6 +97,8 @@
     @Mock
     private HearingAidProfile mHearingAidProfile;
     @Mock
+    private LeAudioProfile mLeAudioProfile;
+    @Mock
     private AudioSwitchPreferenceController.AudioSwitchCallback mAudioSwitchPreferenceCallback;
 
     private Context mContext;
@@ -113,6 +116,7 @@
     private HandsFreeProfileOutputPreferenceController mController;
     private List<BluetoothDevice> mProfileConnectedDevices;
     private List<BluetoothDevice> mHearingAidActiveDevices;
+    private List<BluetoothDevice> mLeAudioActiveDevices;
 
     @Before
     public void setUp() {
@@ -129,24 +133,29 @@
         when(mLocalBluetoothManager.getProfileManager()).thenReturn(mLocalBluetoothProfileManager);
         when(mLocalBluetoothProfileManager.getHeadsetProfile()).thenReturn(mHeadsetProfile);
         when(mLocalBluetoothProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile);
+        when(mLocalBluetoothProfileManager.getLeAudioProfile()).thenReturn(mLeAudioProfile);
 
         mBluetoothManager = mContext.getSystemService(BluetoothManager.class);
         mBluetoothAdapter = mBluetoothManager.getAdapter();
 
         mBluetoothDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_1));
         when(mBluetoothDevice.getName()).thenReturn(TEST_DEVICE_NAME_1);
+        when(mBluetoothDevice.getAlias()).thenReturn(TEST_DEVICE_NAME_1);
         when(mBluetoothDevice.isConnected()).thenReturn(true);
 
         mSecondBluetoothDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_2));
         when(mSecondBluetoothDevice.getName()).thenReturn(TEST_DEVICE_NAME_2);
+        when(mSecondBluetoothDevice.getAlias()).thenReturn(TEST_DEVICE_NAME_2);
         when(mSecondBluetoothDevice.isConnected()).thenReturn(true);
 
         mLeftBluetoothHapDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_3));
         when(mLeftBluetoothHapDevice.getName()).thenReturn(TEST_HAP_DEVICE_NAME_1);
+        when(mLeftBluetoothHapDevice.getAlias()).thenReturn(TEST_HAP_DEVICE_NAME_1);
         when(mLeftBluetoothHapDevice.isConnected()).thenReturn(true);
 
         mRightBluetoothHapDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_4));
         when(mRightBluetoothHapDevice.getName()).thenReturn(TEST_HAP_DEVICE_NAME_2);
+        when(mRightBluetoothHapDevice.getAlias()).thenReturn(TEST_HAP_DEVICE_NAME_2);
         when(mRightBluetoothHapDevice.isConnected()).thenReturn(true);
 
         mController = new HandsFreeProfileOutputPreferenceController(mContext, TEST_KEY);
@@ -154,6 +163,7 @@
         mPreference = new ListPreference(mContext);
         mProfileConnectedDevices = new ArrayList<>();
         mHearingAidActiveDevices = new ArrayList<>(2);
+        mLeAudioActiveDevices = new ArrayList<>();
 
         when(mScreen.getPreferenceManager()).thenReturn(mock(PreferenceManager.class));
         when(mScreen.getContext()).thenReturn(mContext);
@@ -245,7 +255,6 @@
      * Preference summary should be the activated device name
      */
     @Test
-    @Ignore
     public void updateState_oneHeadsetsAvailableAndActivated_shouldSetDeviceName() {
         mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
         mShadowAudioManager.setOutputDevice(DEVICE_OUT_BLUETOOTH_SCO);
@@ -267,7 +276,6 @@
      * Preference summary should be the activated device name
      */
     @Test
-    @Ignore
     public void updateState_moreThanOneHfpBtDevicesAreAvailable_shouldSetActivatedDeviceName() {
         mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
         mShadowAudioManager.setOutputDevice(DEVICE_OUT_BLUETOOTH_SCO);
@@ -328,7 +336,6 @@
      * Preference summary should be the activated device name
      */
     @Test
-    @Ignore
     public void updateState_oneHapBtDeviceAreAvailable_shouldSetActivatedDeviceName() {
         mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
         mShadowAudioManager.setOutputDevice(DEVICE_OUT_HEARING_AID);
@@ -353,7 +360,6 @@
      * Preference summary should be the activated device name
      */
     @Test
-    @Ignore
     public void updateState_moreThanOneHapBtDevicesAreAvailable_shouldSetActivatedDeviceName() {
         mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
         mShadowAudioManager.setOutputDevice(DEVICE_OUT_HEARING_AID);
@@ -382,7 +388,6 @@
      * ConnectedDevice should not contain second HAP device with same HisyncId
      */
     @Test
-    @Ignore
     public void updateState_hapBtDeviceWithSameId_shouldSetActivatedDeviceName() {
         mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
         mShadowAudioManager.setOutputDevice(DEVICE_OUT_HEARING_AID);
@@ -416,7 +421,6 @@
      * ConnectedDevice should not contain second HAP device with same HisyncId
      */
     @Test
-    @Ignore
     public void updateState_hapBtDeviceWithSameIdButDifferentOrder_shouldSetActivatedDeviceName() {
         mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
         mShadowAudioManager.setOutputDevice(DEVICE_OUT_HEARING_AID);
@@ -449,7 +453,6 @@
      * ConnectedDevice should contain both HAP device with different HisyncId
      */
     @Test
-    @Ignore
     public void updateState_hapBtDeviceWithDifferentId_shouldSetActivatedDeviceName() {
         mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
         mShadowAudioManager.setOutputDevice(DEVICE_OUT_HEARING_AID);
@@ -474,6 +477,25 @@
     }
 
     @Test
+    public void updateState_leAudioDeviceActive_shouldSetActivatedDeviceName() {
+        mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
+        mShadowAudioManager.setOutputDevice(DEVICE_OUT_BLE_HEADSET);
+        when(mBluetoothDevice.getName()).thenReturn(TEST_LE_AUDIO_DEVICE_NAME_1);
+        when(mBluetoothDevice.getAlias()).thenReturn(TEST_LE_AUDIO_DEVICE_NAME_1);
+        mProfileConnectedDevices.clear();
+        mProfileConnectedDevices.add(mBluetoothDevice);
+        mLeAudioActiveDevices.clear();
+        mLeAudioActiveDevices.add(mBluetoothDevice);
+        when(mLeAudioProfile.getConnectedDevices()).thenReturn(mProfileConnectedDevices);
+        when(mLeAudioProfile.getActiveDevices()).thenReturn(mLeAudioActiveDevices);
+
+        mController.updateState(mPreference);
+
+        assertThat(mPreference.isVisible()).isTrue();
+        assertThat(mPreference.getSummary()).isEqualTo(mBluetoothDevice.getName());
+    }
+
+    @Test
     public void findActiveDevice_onlyHeadsetDeviceActive_returnHeadsetDevice() {
         when(mLocalBluetoothProfileManager.getHearingAidProfile()).thenReturn(null);
         when(mHeadsetProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
@@ -489,12 +511,60 @@
         assertThat(mController.findActiveDevice()).isNull();
     }
 
+    @Test
+    public void findActiveDevice_allProfilesWithActiveDevice_returnHADevice() {
+        BluetoothDevice btLeDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_5));
+        when(btLeDevice.getName()).thenReturn(TEST_LE_AUDIO_DEVICE_NAME_1);
+        mController.mConnectedDevices.clear();
+        mController.mConnectedDevices.add(mBluetoothDevice);
+        mController.mConnectedDevices.add(mLeftBluetoothHapDevice);
+        mController.mConnectedDevices.add(btLeDevice);
+        mLeAudioActiveDevices.clear();
+        mLeAudioActiveDevices.add(btLeDevice);
+        mHearingAidActiveDevices.clear();
+        mHearingAidActiveDevices.add(mLeftBluetoothHapDevice);
+        when(mHearingAidProfile.getActiveDevices()).thenReturn(mHearingAidActiveDevices);
+        when(mHearingAidProfile.getHiSyncId(mLeftBluetoothHapDevice)).thenReturn(HISYNCID1);
+        when(mHeadsetProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+        when(mLeAudioProfile.getActiveDevices()).thenReturn(mLeAudioActiveDevices);
+
+        assertThat(mController.findActiveDevice()).isEqualTo(mLeftBluetoothHapDevice);
+    }
+
+    @Test
+    public void findActiveDevice_headsetDeviceAndLeAudioDeviceActive_returnLeAudioDevice() {
+        BluetoothDevice btLeDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_5));
+        when(btLeDevice.getName()).thenReturn(TEST_LE_AUDIO_DEVICE_NAME_1);
+        mLeAudioActiveDevices.clear();
+        mLeAudioActiveDevices.add(btLeDevice);
+        mHearingAidActiveDevices.clear();
+        when(mHearingAidProfile.getActiveDevices()).thenReturn(mHearingAidActiveDevices);
+        when(mHeadsetProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+        when(mLeAudioProfile.getActiveDevices()).thenReturn(mLeAudioActiveDevices);
+
+        assertThat(mController.findActiveDevice()).isEqualTo(btLeDevice);
+    }
+
+    @Test
+    public void findActiveDevice_onlyLeAudioDeviceActive_returnLeAudioDevice() {
+        BluetoothDevice btLeDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_5));
+        when(btLeDevice.getName()).thenReturn(TEST_LE_AUDIO_DEVICE_NAME_1);
+        mLeAudioActiveDevices.clear();
+        mLeAudioActiveDevices.add(btLeDevice);
+        mHearingAidActiveDevices.clear();
+        when(mHearingAidProfile.getActiveDevices()).thenReturn(mHearingAidActiveDevices);
+        when(mHeadsetProfile.getActiveDevice()).thenReturn(null);
+        when(mLeAudioProfile.getActiveDevices()).thenReturn(mLeAudioActiveDevices);
+
+        assertThat(mController.findActiveDevice()).isEqualTo(btLeDevice);
+    }
+
+
     /**
      * One Bluetooth devices are available, and select the device.
      * Preference summary should be device name.
      */
     @Test
-    @Ignore
     public void onPreferenceChange_toBtDevice_shouldSetBtDeviceName() {
         mController.mConnectedDevices.clear();
         mController.mConnectedDevices.add(mBluetoothDevice);
@@ -509,16 +579,10 @@
      * Preference summary should be second device name.
      */
     @Test
-    @Ignore
     public void onPreferenceChange_toBtDevices_shouldSetSecondBtDeviceName() {
-        ShadowBluetoothDevice shadowBluetoothDevice;
-        BluetoothDevice secondBluetoothDevice;
-        secondBluetoothDevice = mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_2);
-        shadowBluetoothDevice = Shadows.shadowOf(secondBluetoothDevice);
-        shadowBluetoothDevice.setName(TEST_DEVICE_NAME_2);
         mController.mConnectedDevices.clear();
         mController.mConnectedDevices.add(mBluetoothDevice);
-        mController.mConnectedDevices.add(secondBluetoothDevice);
+        mController.mConnectedDevices.add(mSecondBluetoothDevice);
 
         mController.onPreferenceChange(mPreference, TEST_DEVICE_ADDRESS_2);
 
diff --git a/tests/robotests/src/com/android/settings/sound/MediaOutputPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/sound/MediaOutputPreferenceControllerTest.java
index 10471cb..036d58c 100644
--- a/tests/robotests/src/com/android/settings/sound/MediaOutputPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/sound/MediaOutputPreferenceControllerTest.java
@@ -16,6 +16,7 @@
 
 package com.android.settings.sound;
 
+import static android.media.AudioSystem.DEVICE_OUT_BLE_HEADSET;
 import static android.media.AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP;
 import static android.media.AudioSystem.DEVICE_OUT_EARPIECE;
 import static android.media.AudioSystem.DEVICE_OUT_HEARING_AID;
@@ -56,13 +57,13 @@
 import com.android.settingslib.bluetooth.A2dpProfile;
 import com.android.settingslib.bluetooth.BluetoothEventManager;
 import com.android.settingslib.bluetooth.HearingAidProfile;
+import com.android.settingslib.bluetooth.LeAudioProfile;
 import com.android.settingslib.bluetooth.LocalBluetoothManager;
 import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
 import com.android.settingslib.media.MediaOutputConstants;
 
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
@@ -79,7 +80,6 @@
 import java.util.List;
 
 @RunWith(RobolectricTestRunner.class)
-@Ignore
 @Config(shadows = {
         ShadowAudioManager.class,
         ShadowBluetoothUtils.class,
@@ -91,10 +91,12 @@
     private static final String TEST_DEVICE_NAME_2 = "Test_A2DP_BT_Device_NAME_2";
     private static final String TEST_HAP_DEVICE_NAME_1 = "Test_HAP_BT_Device_NAME_1";
     private static final String TEST_HAP_DEVICE_NAME_2 = "Test_HAP_BT_Device_NAME_2";
+    private static final String TEST_LE_AUDIO_DEVICE_NAME_1 = "Test_LE_AUDIO_Device_NAME_1";
     private static final String TEST_DEVICE_ADDRESS_1 = "00:A1:A1:A1:A1:A1";
     private static final String TEST_DEVICE_ADDRESS_2 = "00:B2:B2:B2:B2:B2";
     private static final String TEST_DEVICE_ADDRESS_3 = "00:C3:C3:C3:C3:C3";
     private static final String TEST_DEVICE_ADDRESS_4 = "00:D4:D4:D4:D4:D4";
+    private static final String TEST_DEVICE_ADDRESS_5 = "00:E5:E5:E5:E5:E5";
     private static final String TEST_PACKAGE_NAME = "com.test.packagename";
     private static final String TEST_APPLICATION_LABEL = "APP Test Label";
 
@@ -109,6 +111,8 @@
     @Mock
     private HearingAidProfile mHearingAidProfile;
     @Mock
+    private LeAudioProfile mLeAudioProfile;
+    @Mock
     private AudioSwitchPreferenceController.AudioSwitchCallback mAudioSwitchPreferenceCallback;
     @Mock
     private MediaSessionManager mMediaSessionManager;
@@ -130,6 +134,7 @@
     private MediaOutputPreferenceController mController;
     private List<BluetoothDevice> mProfileConnectedDevices;
     private List<BluetoothDevice> mHearingAidActiveDevices;
+    private List<BluetoothDevice> mLeAudioActiveDevices;
     private List<MediaController> mMediaControllers = new ArrayList<>();
     private MediaController.PlaybackInfo mPlaybackInfo;
     private PlaybackState mPlaybackState;
@@ -170,12 +175,14 @@
         when(mLocalBluetoothManager.getProfileManager()).thenReturn(mLocalBluetoothProfileManager);
         when(mLocalBluetoothProfileManager.getA2dpProfile()).thenReturn(mA2dpProfile);
         when(mLocalBluetoothProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile);
+        when(mLocalBluetoothProfileManager.getLeAudioProfile()).thenReturn(mLeAudioProfile);
 
         mBluetoothManager = mContext.getSystemService(BluetoothManager.class);
         mBluetoothAdapter = mBluetoothManager.getAdapter();
 
         mBluetoothDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_1));
         when(mBluetoothDevice.getName()).thenReturn(TEST_DEVICE_NAME_1);
+        when(mBluetoothDevice.getAlias()).thenReturn(TEST_DEVICE_NAME_1);
         when(mBluetoothDevice.isConnected()).thenReturn(true);
 
         mSecondBluetoothDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_2));
@@ -184,6 +191,7 @@
 
         mLeftBluetoothHapDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_3));
         when(mLeftBluetoothHapDevice.getName()).thenReturn(TEST_HAP_DEVICE_NAME_1);
+        when(mLeftBluetoothHapDevice.getAlias()).thenReturn(TEST_HAP_DEVICE_NAME_1);
         when(mLeftBluetoothHapDevice.isConnected()).thenReturn(true);
 
         mRightBluetoothHapDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_4));
@@ -195,6 +203,7 @@
         mPreference = new Preference(mContext);
         mProfileConnectedDevices = new ArrayList<>();
         mHearingAidActiveDevices = new ArrayList<>(2);
+        mLeAudioActiveDevices = new ArrayList<>();
 
         when(mScreen.getPreferenceManager()).thenReturn(mock(PreferenceManager.class));
         when(mScreen.getContext()).thenReturn(mContext);
@@ -234,7 +243,6 @@
      * Preference summary should be device's name
      */
     @Test
-    @Ignore
     public void updateState_withActiveBtDevice_setActivatedDeviceName() {
         mShadowAudioManager.setOutputDevice(DEVICE_OUT_BLUETOOTH_A2DP);
         mAudioManager.setMode(AudioManager.MODE_NORMAL);
@@ -254,7 +262,6 @@
      * Preference summary should be device's name
      */
     @Test
-    @Ignore
     public void updateState_withActiveHADevice_setActivatedDeviceName() {
         mShadowAudioManager.setOutputDevice(DEVICE_OUT_HEARING_AID);
         mAudioManager.setMode(AudioManager.MODE_NORMAL);
@@ -270,6 +277,24 @@
     }
 
     @Test
+    public void updateState_withActiveLeAudioDevice_setActivatedDeviceName() {
+        mShadowAudioManager.setOutputDevice(DEVICE_OUT_BLE_HEADSET);
+        mAudioManager.setMode(AudioManager.MODE_NORMAL);
+        when(mBluetoothDevice.getAlias()).thenReturn(TEST_LE_AUDIO_DEVICE_NAME_1);
+        mProfileConnectedDevices.clear();
+        mProfileConnectedDevices.add(mBluetoothDevice);
+        mProfileConnectedDevices.add(mSecondBluetoothDevice);
+        mLeAudioActiveDevices.clear();
+        mLeAudioActiveDevices.add(mBluetoothDevice);
+        when(mLeAudioProfile.getConnectedDevices()).thenReturn(mProfileConnectedDevices);
+        when(mLeAudioProfile.getActiveDevices()).thenReturn(mLeAudioActiveDevices);
+
+        assertThat(mPreference.getSummary()).isNull();
+        mController.updateState(mPreference);
+        assertThat(mPreference.getSummary()).isEqualTo(TEST_LE_AUDIO_DEVICE_NAME_1);
+    }
+
+    @Test
     public void updateState_noActiveLocalPlayback_noTitle() {
         mPlaybackState = new PlaybackState.Builder()
                 .setState(PlaybackState.STATE_NONE, 0, 1)
@@ -350,6 +375,49 @@
         assertThat(mController.findActiveDevice()).isNull();
     }
 
+    @Test
+    public void findActiveDevice_allProfilesWithActiveDevice_returnHADevice() {
+        BluetoothDevice btLeDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_5));
+        when(btLeDevice.getName()).thenReturn(TEST_LE_AUDIO_DEVICE_NAME_1);
+        mLeAudioActiveDevices.clear();
+        mLeAudioActiveDevices.add(btLeDevice);
+        mHearingAidActiveDevices.clear();
+        mHearingAidActiveDevices.add(mLeftBluetoothHapDevice);
+        when(mHearingAidProfile.getActiveDevices()).thenReturn(mHearingAidActiveDevices);
+        when(mA2dpProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+        when(mLeAudioProfile.getActiveDevices()).thenReturn(mLeAudioActiveDevices);
+
+        assertThat(mController.findActiveDevice()).isEqualTo(mLeftBluetoothHapDevice);
+    }
+
+    @Test
+    public void findActiveDevice_a2dpDeviceAndLeAudioDeviceActive_returnLeAudioDevice() {
+        BluetoothDevice btLeDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_5));
+        when(btLeDevice.getName()).thenReturn(TEST_LE_AUDIO_DEVICE_NAME_1);
+        mLeAudioActiveDevices.clear();
+        mLeAudioActiveDevices.add(btLeDevice);
+        mHearingAidActiveDevices.clear();
+        when(mHearingAidProfile.getActiveDevices()).thenReturn(mHearingAidActiveDevices);
+        when(mA2dpProfile.getActiveDevice()).thenReturn(mBluetoothDevice);
+        when(mLeAudioProfile.getActiveDevices()).thenReturn(mLeAudioActiveDevices);
+
+        assertThat(mController.findActiveDevice()).isEqualTo(btLeDevice);
+    }
+
+    @Test
+    public void findActiveDevice_onlyLeAudioDeviceActive_returnLeAudioDevice() {
+        BluetoothDevice btLeDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_5));
+        when(btLeDevice.getName()).thenReturn(TEST_LE_AUDIO_DEVICE_NAME_1);
+        mLeAudioActiveDevices.clear();
+        mLeAudioActiveDevices.add(btLeDevice);
+        mHearingAidActiveDevices.clear();
+        when(mHearingAidProfile.getActiveDevices()).thenReturn(mHearingAidActiveDevices);
+        when(mA2dpProfile.getActiveDevice()).thenReturn(null);
+        when(mLeAudioProfile.getActiveDevices()).thenReturn(mLeAudioActiveDevices);
+
+        assertThat(mController.findActiveDevice()).isEqualTo(btLeDevice);
+    }
+
     private void initPackage() {
         mShadowPackageManager = Shadows.shadowOf(mContext.getPackageManager());
         mAppInfo = new ApplicationInfo();
diff --git a/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java b/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java
index 2f24832..518aee9 100644
--- a/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java
+++ b/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java
@@ -47,7 +47,6 @@
 import com.android.settings.security.SecuritySettingsFeatureProvider;
 import com.android.settings.slices.SlicesFeatureProvider;
 import com.android.settings.users.UserFeatureProvider;
-import com.android.settings.vpn2.AdvancedVpnFeatureProvider;
 import com.android.settings.wifi.WifiTrackerLibProvider;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 
@@ -88,7 +87,6 @@
     public SecuritySettingsFeatureProvider securitySettingsFeatureProvider;
     public AccessibilitySearchFeatureProvider mAccessibilitySearchFeatureProvider;
     public AccessibilityMetricsFeatureProvider mAccessibilityMetricsFeatureProvider;
-    public AdvancedVpnFeatureProvider mAdvancedVpnFeatureProvider;
 
     /**
      * Call this in {@code @Before} method of the test class to use fake factory.
@@ -138,7 +136,6 @@
         securitySettingsFeatureProvider = mock(SecuritySettingsFeatureProvider.class);
         mAccessibilitySearchFeatureProvider = mock(AccessibilitySearchFeatureProvider.class);
         mAccessibilityMetricsFeatureProvider = mock(AccessibilityMetricsFeatureProvider.class);
-        mAdvancedVpnFeatureProvider = mock(AdvancedVpnFeatureProvider.class);
     }
 
     @Override
@@ -275,9 +272,4 @@
     public AccessibilityMetricsFeatureProvider getAccessibilityMetricsFeatureProvider() {
         return mAccessibilityMetricsFeatureProvider;
     }
-
-    @Override
-    public AdvancedVpnFeatureProvider getAdvancedVpnFeatureProvider() {
-        return mAdvancedVpnFeatureProvider;
-    }
 }
diff --git a/tests/unit/src/com/android/settings/network/UiccSlotUtilTest.java b/tests/unit/src/com/android/settings/network/UiccSlotUtilTest.java
index 4282b3e6..9a2c611 100644
--- a/tests/unit/src/com/android/settings/network/UiccSlotUtilTest.java
+++ b/tests/unit/src/com/android/settings/network/UiccSlotUtilTest.java
@@ -638,6 +638,106 @@
         assertThat(testExcludedLogicalSlotIndex).isEqualTo(verifyExcludedLogicalSlotIndex);
     }
 
+    @Test
+    public void isRemovableSimEnabled_noPsim_returnsFalse() {
+        when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
+                oneSimSlotDeviceActiveEsim());
+
+        boolean testSlot = UiccSlotUtil.isRemovableSimEnabled(mTelephonyManager);
+
+        assertThat(testSlot).isFalse();
+    }
+
+    @Test
+    public void isRemovableSimEnabled_activeRemovableEsimAndInactivePsim_returnsFalse() {
+        when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
+                twoSimSlotsDeviceActiveRemovableEsimInactivePsim());
+
+        boolean testSlot = UiccSlotUtil.isRemovableSimEnabled(mTelephonyManager);
+
+        assertThat(testSlot).isFalse();
+    }
+
+    @Test
+    public void isRemovableSimEnabled_activeRemovableEsimAndActivePsim_returnsTrue() {
+        when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
+                twoSimSlotsDeviceActivePsimActiveRemovableEsim());
+
+        boolean testSlot = UiccSlotUtil.isRemovableSimEnabled(mTelephonyManager);
+
+        assertThat(testSlot).isTrue();
+    }
+
+    @Test
+    public void isRemovableSimEnabled_inactiveRemovableEsimAndActivePsim_returnsTrue() {
+        when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
+                twoSimSlotsDeviceInactiveRemovableEsimActivePsim());
+
+        boolean testSlot = UiccSlotUtil.isRemovableSimEnabled(mTelephonyManager);
+
+        assertThat(testSlot).isTrue();
+    }
+
+    @Test
+    public void isRemovableSimEnabled_twoActiveRemovableEsimsAndInactivePsim_returnsFalse() {
+        when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
+                twoSimSlotsDeviceTwoActiveRemovableEsimsInactivePsim());
+
+        boolean testSlot = UiccSlotUtil.isRemovableSimEnabled(mTelephonyManager);
+
+        assertThat(testSlot).isFalse();
+    }
+
+    @Test
+    public void isRemovableSimEnabled_oneActiveOneInactiveRemovableEsimActivePsim_returnsTrue() {
+        when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
+                twoSimSlotsDeviceOneActiveOneInactiveRemovableEsimsActivePsim());
+
+        boolean testSlot = UiccSlotUtil.isRemovableSimEnabled(mTelephonyManager);
+
+        assertThat(testSlot).isTrue();
+    }
+
+    @Test
+    public void isRemovableSimEnabled_activePsim_returnsTrue() {
+        when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
+                oneSimSlotDeviceActivePsim());
+
+        boolean testSlot = UiccSlotUtil.isRemovableSimEnabled(mTelephonyManager);
+
+        assertThat(testSlot).isTrue();
+    }
+
+    @Test
+    public void isRemovableSimEnabled_inactivePsim_returnsFalse() {
+        when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
+                oneSimSlotDeviceinactivePsim());
+
+        boolean testSlot = UiccSlotUtil.isRemovableSimEnabled(mTelephonyManager);
+
+        assertThat(testSlot).isFalse();
+    }
+
+    @Test
+    public void isRemovableSimEnabled_activeEsimAndActivePsim_returnsTrue() {
+        when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
+                twoSimSlotsDeviceActivePsimActiveEsim());
+
+        boolean testSlot = UiccSlotUtil.isRemovableSimEnabled(mTelephonyManager);
+
+        assertThat(testSlot).isTrue();
+    }
+
+    @Test
+    public void isRemovableSimEnabled_activeEsimAndInactivePsim_returnsFalse() {
+        when(mTelephonyManager.getUiccSlotsInfo()).thenReturn(
+                twoSimSlotsDeviceInactivePsimActiveEsim());
+
+        boolean testSlot = UiccSlotUtil.isRemovableSimEnabled(mTelephonyManager);
+
+        assertThat(testSlot).isFalse();
+    }
+
     private void compareTwoUiccSlotMappings(Collection<UiccSlotMapping> testUiccSlotMappings,
             Collection<UiccSlotMapping> verifyUiccSlotMappings) {
         assertThat(testUiccSlotMappings.size()).isEqualTo(verifyUiccSlotMappings.size());
@@ -792,6 +892,10 @@
         return new UiccSlotInfo[]{createUiccSlotInfo(true, false, 1, true)};
     }
 
+    private UiccSlotInfo[] oneSimSlotDeviceinactivePsim() {
+        return new UiccSlotInfo[]{createUiccSlotInfo(false, true, -1, false)};
+    }
+
     private UiccSlotInfo[] twoSimSlotsDeviceActivePsimActiveEsim() {
         return new UiccSlotInfo[]{
                 createUiccSlotInfo(false, true, 0, true),
@@ -810,6 +914,30 @@
                 createUiccSlotInfo(true, true, 1, true)};
     }
 
+    private UiccSlotInfo[] twoSimSlotsDeviceActiveRemovableEsimInactivePsim() {
+        return new UiccSlotInfo[]{
+                createUiccSlotInfo(true, true, 0, true),
+                createUiccSlotInfo(false, true, -1, false)};
+    }
+
+    private UiccSlotInfo[] twoSimSlotsDeviceInactiveRemovableEsimActivePsim() {
+        return new UiccSlotInfo[]{
+                createUiccSlotInfo(true, true, -1, false),
+                createUiccSlotInfo(false, true, 0, true)};
+    }
+
+    private UiccSlotInfo[] twoSimSlotsDeviceTwoActiveRemovableEsimsInactivePsim() {
+        return new UiccSlotInfo[]{
+                createUiccSlotInfoForRemovableEsimMep(0, true, 1, true),
+                createUiccSlotInfo(false, true, -1, false)};
+    }
+
+    private UiccSlotInfo[] twoSimSlotsDeviceOneActiveOneInactiveRemovableEsimsActivePsim() {
+        return new UiccSlotInfo[]{
+                createUiccSlotInfoForRemovableEsimMep(1, true, -1, false),
+                createUiccSlotInfo(false, true, 0, true)};
+    }
+
     private UiccSlotInfo[] twoSimSlotsDeviceActiveEsimActivePsim() {
         return new UiccSlotInfo[]{
                 createUiccSlotInfo(true, false, 0, true),
@@ -872,4 +1000,20 @@
                                 logicalSlotIdx2 /* logicalSlotIdx */,
                                 isActiveEsim2 /* isActive */)));
     }
+
+    private UiccSlotInfo createUiccSlotInfoForRemovableEsimMep(int logicalSlotIdx1,
+            boolean isActiveEsim1, int logicalSlotIdx2, boolean isActiveEsim2) {
+        return new UiccSlotInfo(
+                true, /* isEuicc */
+                "123", /* cardId */
+                CARD_STATE_INFO_PRESENT, /* cardStateInfo */
+                true, /* isExtendApduSupported */
+                true, /* isRemovable */
+                Arrays.asList(
+                        new UiccPortInfo("" /* iccId */, 0 /* portIdx */,
+                                logicalSlotIdx1 /* logicalSlotIdx */, isActiveEsim1 /* isActive */),
+                        new UiccPortInfo("" /* iccId */, 1 /* portIdx */,
+                                logicalSlotIdx2 /* logicalSlotIdx */,
+                                isActiveEsim2 /* isActive */)));
+    }
 }
diff --git a/tests/unit/src/com/android/settings/testutils/FakeFeatureFactory.java b/tests/unit/src/com/android/settings/testutils/FakeFeatureFactory.java
index f565075..717de79 100644
--- a/tests/unit/src/com/android/settings/testutils/FakeFeatureFactory.java
+++ b/tests/unit/src/com/android/settings/testutils/FakeFeatureFactory.java
@@ -45,7 +45,6 @@
 import com.android.settings.security.SecuritySettingsFeatureProvider;
 import com.android.settings.slices.SlicesFeatureProvider;
 import com.android.settings.users.UserFeatureProvider;
-import com.android.settings.vpn2.AdvancedVpnFeatureProvider;
 import com.android.settings.wifi.WifiTrackerLibProvider;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 
@@ -83,7 +82,6 @@
     public SecuritySettingsFeatureProvider securitySettingsFeatureProvider;
     public AccessibilitySearchFeatureProvider mAccessibilitySearchFeatureProvider;
     public AccessibilityMetricsFeatureProvider mAccessibilityMetricsFeatureProvider;
-    public AdvancedVpnFeatureProvider mAdvancedVpnFeatureProvider;
 
     /**
      * Call this in {@code @Before} method of the test class to use fake factory.
@@ -124,7 +122,6 @@
         securitySettingsFeatureProvider = mock(SecuritySettingsFeatureProvider.class);
         mAccessibilitySearchFeatureProvider = mock(AccessibilitySearchFeatureProvider.class);
         mAccessibilityMetricsFeatureProvider = mock(AccessibilityMetricsFeatureProvider.class);
-        mAdvancedVpnFeatureProvider = mock(AdvancedVpnFeatureProvider.class);
     }
 
     @Override
@@ -261,9 +258,4 @@
     public AccessibilityMetricsFeatureProvider getAccessibilityMetricsFeatureProvider() {
         return mAccessibilityMetricsFeatureProvider;
     }
-
-    @Override
-    public AdvancedVpnFeatureProvider getAdvancedVpnFeatureProvider() {
-        return mAdvancedVpnFeatureProvider;
-    }
 }
diff --git a/tests/unit/src/com/android/settings/vpn2/AppManagementFragmentTest.java b/tests/unit/src/com/android/settings/vpn2/AppManagementFragmentTest.java
deleted file mode 100644
index 80bb393..0000000
--- a/tests/unit/src/com/android/settings/vpn2/AppManagementFragmentTest.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2022 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.vpn2;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.when;
-
-import android.content.Context;
-import android.os.Looper;
-
-import androidx.test.annotation.UiThreadTest;
-import androidx.test.core.app.ApplicationProvider;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-
-import com.android.settings.testutils.FakeFeatureFactory;
-import com.android.settingslib.RestrictedPreference;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.junit.MockitoJUnit;
-import org.mockito.junit.MockitoRule;
-
-@RunWith(AndroidJUnit4.class)
-public class AppManagementFragmentTest {
-    private static final String FAKE_PACKAGE_NAME = "com.fake.package.name";
-    private static final String ADVANCED_VPN_GROUP_PACKAGE_NAME = "com.advanced.package.name";
-
-    @Rule
-    public final MockitoRule mMockitoRule = MockitoJUnit.rule();
-
-    private AppManagementFragment mFragment;
-    private Context mContext;
-    private FakeFeatureFactory mFakeFeatureFactory;
-    private RestrictedPreference mPreferenceForget;
-
-    @Before
-    @UiThreadTest
-    public void setUp() {
-        if (Looper.myLooper() == null) {
-            Looper.prepare();
-        }
-
-        mFragment = spy(new AppManagementFragment());
-        mContext = spy(ApplicationProvider.getApplicationContext());
-        mPreferenceForget = new RestrictedPreference(mContext);
-
-        mFakeFeatureFactory = FakeFeatureFactory.setupForTest();
-        mFragment.init(ADVANCED_VPN_GROUP_PACKAGE_NAME,
-                mFakeFeatureFactory.getAdvancedVpnFeatureProvider(), mPreferenceForget);
-        when(mFakeFeatureFactory.mAdvancedVpnFeatureProvider.getAdvancedVpnPackageName())
-                .thenReturn(ADVANCED_VPN_GROUP_PACKAGE_NAME);
-        when(mFakeFeatureFactory.mAdvancedVpnFeatureProvider.isAdvancedVpnSupported(any()))
-                .thenReturn(true);
-    }
-
-    @Test
-    public void updateRestrictedViews_isAdvancedVpn_hidesForgetPreference() {
-        when(mFakeFeatureFactory.mAdvancedVpnFeatureProvider.isAdvancedVpnRemovable())
-                .thenReturn(false);
-        mFragment.updateRestrictedViews();
-        assertThat(mPreferenceForget.isVisible()).isFalse();
-    }
-
-    @Test
-    public void updateRestrictedViews_isNotAdvancedVpn_showsForgetPreference() {
-        when(mFakeFeatureFactory.mAdvancedVpnFeatureProvider.isAdvancedVpnRemovable())
-                .thenReturn(false);
-        mFragment.init(FAKE_PACKAGE_NAME,
-                mFakeFeatureFactory.getAdvancedVpnFeatureProvider(), mPreferenceForget);
-        mFragment.updateRestrictedViews();
-        assertThat(mPreferenceForget.isVisible()).isTrue();
-    }
-
-    @Test
-    public void updateRestrictedViews_isAdvancedVpnRemovable_showsForgetPreference() {
-        when(mFakeFeatureFactory.mAdvancedVpnFeatureProvider.isAdvancedVpnRemovable())
-                .thenReturn(true);
-        mFragment.init(FAKE_PACKAGE_NAME,
-                mFakeFeatureFactory.getAdvancedVpnFeatureProvider(), mPreferenceForget);
-        mFragment.updateRestrictedViews();
-        assertThat(mPreferenceForget.isVisible()).isTrue();
-    }
-}
diff --git a/tests/unit/src/com/android/settings/vpn2/VpnSettingsTest.java b/tests/unit/src/com/android/settings/vpn2/VpnSettingsTest.java
deleted file mode 100644
index 953a524..0000000
--- a/tests/unit/src/com/android/settings/vpn2/VpnSettingsTest.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Copyright (C) 2022 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.vpn2;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.app.AppOpsManager;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.os.Looper;
-import android.os.UserHandle;
-import android.text.TextUtils;
-import android.util.ArraySet;
-
-import androidx.preference.Preference;
-import androidx.preference.PreferenceCategory;
-import androidx.preference.PreferenceGroup;
-import androidx.preference.PreferenceManager;
-import androidx.preference.PreferenceScreen;
-import androidx.test.annotation.UiThreadTest;
-import androidx.test.core.app.ApplicationProvider;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-
-import com.android.settings.testutils.FakeFeatureFactory;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnit;
-import org.mockito.junit.MockitoRule;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-@RunWith(AndroidJUnit4.class)
-public class VpnSettingsTest {
-    private static final int USER_ID_1 = UserHandle.USER_NULL;
-    private static final String VPN_GROUP_KEY = "vpn_group";
-    private static final String VPN_GROUP_TITLE = "vpn_group_title";
-    private static final String VPN_PACKAGE_NAME = "vpn.package.name";
-    private static final String VPN_LAUNCH_INTENT = "vpn.action";
-    private static final String ADVANCED_VPN_GROUP_KEY = "advanced_vpn_group";
-    private static final String ADVANCED_VPN_GROUP_TITLE = "advanced_vpn_group_title";
-    private static final String ADVANCED_VPN_PACKAGE_NAME = "advanced.vpn.package.name";
-    private static final String ADVANCED_VPN_LAUNCH_INTENT = "advanced.vpn.action";
-
-    private final Intent mVpnIntent = new Intent().setAction(VPN_LAUNCH_INTENT);
-    private final Intent mAdvancedVpnIntent = new Intent().setAction(ADVANCED_VPN_LAUNCH_INTENT);
-
-    @Rule
-    public final MockitoRule mMockitoRule = MockitoJUnit.rule();
-
-    @Mock
-    private AppOpsManager mAppOpsManager;
-    @Mock
-    private PackageManager mPackageManager;
-
-    private VpnSettings mVpnSettings;
-    private Context mContext;
-    private PreferenceManager mPreferenceManager;
-    private PreferenceScreen mPreferenceScreen;
-    private PreferenceGroup mAdvancedVpnGroup;
-    private PreferenceGroup mVpnGroup;
-    private FakeFeatureFactory mFakeFeatureFactory;
-
-    @Before
-    @UiThreadTest
-    public void setUp() throws PackageManager.NameNotFoundException {
-        if (Looper.myLooper() == null) {
-            Looper.prepare();
-        }
-
-        mVpnSettings = spy(new VpnSettings());
-        mContext = spy(ApplicationProvider.getApplicationContext());
-        mAdvancedVpnGroup = spy(new PreferenceCategory(mContext));
-        mVpnGroup = spy(new PreferenceCategory(mContext));
-        mAdvancedVpnGroup.setKey(ADVANCED_VPN_GROUP_KEY);
-        mVpnGroup.setKey(VPN_GROUP_KEY);
-        mPreferenceManager = new PreferenceManager(mContext);
-        mPreferenceScreen = mPreferenceManager.createPreferenceScreen(mContext);
-        mPreferenceScreen.addPreference(mAdvancedVpnGroup);
-        mPreferenceScreen.addPreference(mVpnGroup);
-        mFakeFeatureFactory = FakeFeatureFactory.setupForTest();
-        mVpnSettings.init(mPreferenceScreen, mFakeFeatureFactory.getAdvancedVpnFeatureProvider());
-
-        when(mVpnSettings.getContext()).thenReturn(mContext);
-        when(mFakeFeatureFactory.mAdvancedVpnFeatureProvider
-                .getAdvancedVpnPreferenceGroupTitle(mContext)).thenReturn(ADVANCED_VPN_GROUP_TITLE);
-        when(mFakeFeatureFactory.mAdvancedVpnFeatureProvider.getVpnPreferenceGroupTitle(mContext))
-                .thenReturn(VPN_GROUP_TITLE);
-        when(mFakeFeatureFactory.mAdvancedVpnFeatureProvider.getAdvancedVpnPackageName())
-                .thenReturn(ADVANCED_VPN_PACKAGE_NAME);
-        when(mFakeFeatureFactory.mAdvancedVpnFeatureProvider.isAdvancedVpnSupported(any()))
-                .thenReturn(true);
-        when(mContext.getPackageManager()).thenReturn(mPackageManager);
-        doReturn(mContext).when(mContext).createContextAsUser(any(), anyInt());
-        doReturn(mContext).when(mContext).createPackageContextAsUser(any(), anyInt(), any());
-        doReturn(mPreferenceManager).when(mVpnGroup).getPreferenceManager();
-        doReturn(mPreferenceManager).when(mAdvancedVpnGroup).getPreferenceManager();
-    }
-
-    @Test
-    public void setShownAdvancedPreferences_hasGeneralVpn_returnsVpnCountAs1() {
-        Set<Preference> updates = new ArraySet<>();
-        AppPreference pref =
-                spy(new AppPreference(mContext, USER_ID_1, VPN_PACKAGE_NAME));
-        updates.add(pref);
-
-        mVpnSettings.setShownAdvancedPreferences(updates);
-
-        assertThat(mVpnGroup.getPreferenceCount()).isEqualTo(1);
-        assertThat(mVpnGroup.isVisible()).isTrue();
-        assertThat(mAdvancedVpnGroup.isVisible()).isFalse();
-    }
-
-    @Test
-    public void setShownAdvancedPreferences_hasAdvancedVpn_returnsAdvancedVpnCountAs1() {
-        Set<Preference> updates = new ArraySet<>();
-        AppPreference pref =
-                spy(new AppPreference(mContext, USER_ID_1, ADVANCED_VPN_PACKAGE_NAME));
-        updates.add(pref);
-
-        mVpnSettings.setShownAdvancedPreferences(updates);
-
-        assertThat(mAdvancedVpnGroup.getPreferenceCount()).isEqualTo(1);
-        assertThat(mAdvancedVpnGroup.isVisible()).isTrue();
-        assertThat(mVpnGroup.isVisible()).isFalse();
-    }
-
-    @Test
-    public void setShownAdvancedPreferences_noVpn_returnsEmpty() {
-        Set<Preference> updates = new ArraySet<>();
-
-        mVpnSettings.setShownAdvancedPreferences(updates);
-
-        assertThat(mAdvancedVpnGroup.getPreferenceCount()).isEqualTo(0);
-        assertThat(mVpnGroup.getPreferenceCount()).isEqualTo(0);
-        assertThat(mAdvancedVpnGroup.isVisible()).isFalse();
-        assertThat(mVpnGroup.isVisible()).isFalse();
-    }
-
-    @Test
-    public void getVpnApps_isAdvancedVpn_returnsOne() throws Exception {
-        ApplicationInfo info = new ApplicationInfo();
-        info.uid = 1111;
-        when(mPackageManager.getApplicationInfo(anyString(), anyInt())).thenReturn(info);
-
-        assertThat(VpnSettings.getVpnApps(mContext, /* includeProfiles= */ false,
-                mFakeFeatureFactory.getAdvancedVpnFeatureProvider(),
-                mAppOpsManager).size()).isEqualTo(1);
-    }
-
-    @Test
-    public void getVpnApps_isNotAdvancedVpn_returnsEmpty() {
-        int uid = 1111;
-        List<AppOpsManager.OpEntry> opEntries = new ArrayList<>();
-        List<AppOpsManager.PackageOps> apps = new ArrayList<>();
-        AppOpsManager.PackageOps packageOps =
-                new AppOpsManager.PackageOps(VPN_PACKAGE_NAME, uid, opEntries);
-        apps.add(packageOps);
-        when(mAppOpsManager.getPackagesForOps((int[]) any())).thenReturn(apps);
-        when(mFakeFeatureFactory.mAdvancedVpnFeatureProvider.isAdvancedVpnSupported(any()))
-                .thenReturn(false);
-
-        assertThat(VpnSettings.getVpnApps(mContext, /* includeProfiles= */ false,
-                mFakeFeatureFactory.getAdvancedVpnFeatureProvider(),
-                mAppOpsManager)).isEmpty();
-    }
-
-    @Test
-    public void clickVpn_VpnConnected_doesNotStartVpnLaunchIntent()
-            throws PackageManager.NameNotFoundException {
-        Set<Preference> updates = new ArraySet<>();
-        AppPreference pref = spy(new AppPreference(mContext, USER_ID_1, VPN_PACKAGE_NAME));
-        pref.setState(AppPreference.STATE_CONNECTED);
-        updates.add(pref);
-        when(mContext.createPackageContextAsUser(any(), anyInt(), any())).thenReturn(mContext);
-        when(mContext.getPackageManager()).thenReturn(mPackageManager);
-        when(mPackageManager.getLaunchIntentForPackage(any())).thenReturn(mVpnIntent);
-        ArgumentCaptor<Intent> captor = ArgumentCaptor.forClass(Intent.class);
-        doNothing().when(mContext).startActivityAsUser(captor.capture(), any());
-        mVpnSettings.setShownPreferences(updates);
-
-        mVpnSettings.onPreferenceClick(pref);
-
-        verify(mContext, never()).startActivityAsUser(any(), any());
-    }
-
-    @Test
-    public void clickVpn_VpnDisconnected_startsVpnLaunchIntent()
-            throws PackageManager.NameNotFoundException {
-        Set<Preference> updates = new ArraySet<>();
-        AppPreference pref = spy(new AppPreference(mContext, USER_ID_1, VPN_PACKAGE_NAME));
-        pref.setState(AppPreference.STATE_DISCONNECTED);
-        updates.add(pref);
-        when(mContext.createPackageContextAsUser(any(), anyInt(), any())).thenReturn(mContext);
-        when(mContext.getPackageManager()).thenReturn(mPackageManager);
-        when(mPackageManager.getLaunchIntentForPackage(any())).thenReturn(mVpnIntent);
-        ArgumentCaptor<Intent> captor = ArgumentCaptor.forClass(Intent.class);
-        doNothing().when(mContext).startActivityAsUser(captor.capture(), any());
-        mVpnSettings.setShownPreferences(updates);
-
-        mVpnSettings.onPreferenceClick(pref);
-
-        verify(mContext).startActivityAsUser(captor.capture(), any());
-        assertThat(TextUtils.equals(captor.getValue().getAction(),
-                VPN_LAUNCH_INTENT)).isTrue();
-    }
-
-    @Test
-    public void clickAdvancedVpn_VpnConnectedDisconnectDialogDisabled_startsAppLaunchIntent()
-            throws PackageManager.NameNotFoundException {
-        Set<Preference> updates = new ArraySet<>();
-        AppPreference pref =
-                spy(new AppPreference(mContext, USER_ID_1, ADVANCED_VPN_PACKAGE_NAME));
-        pref.setState(AppPreference.STATE_CONNECTED);
-        updates.add(pref);
-        when(mFakeFeatureFactory.mAdvancedVpnFeatureProvider.isDisconnectDialogEnabled())
-                .thenReturn(false);
-        when(mContext.createPackageContextAsUser(any(), anyInt(), any())).thenReturn(mContext);
-        when(mContext.getPackageManager()).thenReturn(mPackageManager);
-        when(mPackageManager.getLaunchIntentForPackage(any())).thenReturn(mAdvancedVpnIntent);
-        ArgumentCaptor<Intent> captor = ArgumentCaptor.forClass(Intent.class);
-        doNothing().when(mContext).startActivityAsUser(captor.capture(), any());
-        mVpnSettings.setShownAdvancedPreferences(updates);
-
-        mVpnSettings.onPreferenceClick(pref);
-
-        verify(mContext).startActivityAsUser(captor.capture(), any());
-        assertThat(TextUtils.equals(captor.getValue().getAction(),
-                ADVANCED_VPN_LAUNCH_INTENT)).isTrue();
-    }
-
-    @Test
-    public void clickAdvancedVpn_VpnConnectedDisconnectDialogEnabled_doesNotStartAppLaunchIntent()
-            throws PackageManager.NameNotFoundException {
-        Set<Preference> updates = new ArraySet<>();
-        AppPreference pref =
-                spy(new AppPreference(mContext, USER_ID_1, ADVANCED_VPN_PACKAGE_NAME));
-        pref.setState(AppPreference.STATE_CONNECTED);
-        updates.add(pref);
-        when(mFakeFeatureFactory.mAdvancedVpnFeatureProvider.isDisconnectDialogEnabled())
-                .thenReturn(true);
-        when(mContext.createPackageContextAsUser(any(), anyInt(), any())).thenReturn(mContext);
-        when(mContext.getPackageManager()).thenReturn(mPackageManager);
-        when(mPackageManager.getLaunchIntentForPackage(any())).thenReturn(mAdvancedVpnIntent);
-        ArgumentCaptor<Intent> captor = ArgumentCaptor.forClass(Intent.class);
-        doNothing().when(mContext).startActivityAsUser(captor.capture(), any());
-        mVpnSettings.setShownAdvancedPreferences(updates);
-
-        mVpnSettings.onPreferenceClick(pref);
-
-        verify(mContext, never()).startActivityAsUser(any(), any());
-    }
-}