Merge "Import translations. DO NOT MERGE ANYWHERE"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 199fe5a..476d487 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -178,6 +178,7 @@
                   android:exported="true"
                   android:enabled="false"
                   android:configChanges="orientation|keyboard|keyboardHidden|screenSize|screenLayout|smallestScreenSize"
+                  android:knownActivityEmbeddingCerts="@array/config_known_host_certs"
                   android:permission="android.permission.LAUNCH_MULTI_PANE_SETTINGS_DEEP_LINK">
             <intent-filter>
                 <action android:name="android.settings.SETTINGS_EMBED_DEEP_LINK_ACTIVITY" />
@@ -224,6 +225,7 @@
         <activity android:name=".SubSettings"
                   android:exported="false"
                   android:theme="@style/Theme.SubSettings"
+                  android:knownActivityEmbeddingCerts="@array/config_known_host_certs"
                   android:taskAffinity="com.android.settings.root" />
 
         <activity android:name=".Settings$CreateShortcutActivity"
@@ -333,6 +335,7 @@
         <activity android:name=".search.SearchResultTrampoline"
                   android:theme="@android:style/Theme.NoDisplay"
                   android:excludeFromRecents="true"
+                  android:knownActivityEmbeddingCerts="@array/config_known_host_certs"
                   android:exported="true">
             <intent-filter>
                 <action android:name="com.android.settings.SEARCH_RESULT_TRAMPOLINE" />
@@ -1628,6 +1631,7 @@
             android:excludeFromRecents="true"
             android:theme="@android:style/Theme.NoDisplay"
             android:exported="true"
+            android:knownActivityEmbeddingCerts="@array/config_known_host_certs"
             android:permission="android.permission.MODIFY_PHONE_STATE">
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
diff --git a/res/drawable/ic_event.xml b/res/drawable/ic_event.xml
index a82d754..1bc8f2c 100644
--- a/res/drawable/ic_event.xml
+++ b/res/drawable/ic_event.xml
@@ -30,5 +30,5 @@
         android:height="@dimen/dashboard_tile_foreground_image_size"
         android:start="@dimen/dashboard_tile_foreground_image_inset"
         android:top="@dimen/dashboard_tile_foreground_image_inset"
-        android:drawable="@drawable/ic_event_white" />
+        android:drawable="@drawable/ic_event_shape" />
 </layer-list>
diff --git a/res/drawable/ic_event_white.xml b/res/drawable/ic_event_shape.xml
similarity index 94%
rename from res/drawable/ic_event_white.xml
rename to res/drawable/ic_event_shape.xml
index d80429b..25a8ded 100644
--- a/res/drawable/ic_event_white.xml
+++ b/res/drawable/ic_event_shape.xml
@@ -20,6 +20,6 @@
         android:viewportHeight="24.0">
 
     <path
-        android:fillColor="#FFFFFFFF"
+        android:fillColor="@color/settingslib_colorSurface"
         android:pathData="M17.0,12.0l-5.0,0.0l0.0,5.0l5.0,0.0l0.0,-5.0zM16.0,1.0l0.0,2.0L8.0,3.0L8.0,1.0L6.0,1.0l0.0,2.0L5.0,3.0c-1.11,0.0 -1.9,0.9 -1.99,2.0L3.0,19.0c0.0,1.0 0.89,2.0 2.0,2.0l14.0,0.0c1.1,0.0 2.0,-0.9 2.0,-2.0L21.0,5.0c0.0,-1.1 -0.9,-2.0 -2.0,-2.0l-1.0,0.0L18.0,1.0l-2.0,0.0zm3.0,18.0L5.0,19.0L5.0,8.0l14.0,0.0l0.0,11.0z"/>
 </vector>
diff --git a/res/drawable/ic_timelapse.xml b/res/drawable/ic_timelapse.xml
index ba97bae..8bf1488 100644
--- a/res/drawable/ic_timelapse.xml
+++ b/res/drawable/ic_timelapse.xml
@@ -30,5 +30,5 @@
         android:height="@dimen/dashboard_tile_foreground_image_size"
         android:start="@dimen/dashboard_tile_foreground_image_inset"
         android:top="@dimen/dashboard_tile_foreground_image_inset"
-        android:drawable="@drawable/ic_timelapse_white" />
+        android:drawable="@drawable/ic_timelapse_shape" />
 </layer-list>
diff --git a/res/drawable/ic_timelapse_white.xml b/res/drawable/ic_timelapse_shape.xml
similarity index 94%
rename from res/drawable/ic_timelapse_white.xml
rename to res/drawable/ic_timelapse_shape.xml
index f287747..6475e0b 100644
--- a/res/drawable/ic_timelapse_white.xml
+++ b/res/drawable/ic_timelapse_shape.xml
@@ -20,6 +20,6 @@
         android:viewportHeight="24.0">
 
     <path
-        android:fillColor="#FFFFFFFF"
+        android:fillColor="@color/settingslib_colorSurface"
         android:pathData="M16.24,7.76C15.07,6.59 13.54,6.0 12.0,6.0l0.0,6.0l-4.24,4.24c2.34,2.34 6.14,2.34 8.49,0.0 2.34,-2.34 2.34,-6.14 -0.01,-8.48zM12.0,2.0C6.48,2.0 2.0,6.48 2.0,12.0s4.48,10.0 10.0,10.0 10.0,-4.48 10.0,-10.0S17.52,2.0 12.0,2.0zm0.0,18.0c-4.42,0.0 -8.0,-3.58 -8.0,-8.0s3.58,-8.0 8.0,-8.0 8.0,3.58 8.0,8.0 -3.58,8.0 -8.0,8.0z"/>
 </vector>
diff --git a/res/layout/setup_choose_lock_generic_biometrics_header.xml b/res/layout/setup_choose_lock_generic_biometrics_header.xml
deleted file mode 100644
index daeeedd..0000000
--- a/res/layout/setup_choose_lock_generic_biometrics_header.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-    Copyright (C) 2016 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.
--->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-    style="@style/SudDescription.Glif"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
-    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
-    android:paddingTop="@dimen/sud_description_glif_margin_top"
-    android:paddingBottom="@dimen/sud_description_glif_margin_bottom_lists"
-    android:text="@string/lock_settings_picker_biometrics_added_security_message" />
diff --git a/res/layout/setup_choose_lock_generic_header.xml b/res/layout/setup_choose_lock_generic_header.xml
deleted file mode 100644
index 7ec16d2..0000000
--- a/res/layout/setup_choose_lock_generic_header.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-    Copyright (C) 2016 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.
--->
-
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-    style="@style/SudDescription.Glif"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
-    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
-    android:paddingTop="@dimen/sud_description_glif_margin_top"
-    android:paddingBottom="@dimen/sud_description_glif_margin_bottom_lists"
-    android:text="@string/setup_lock_settings_picker_message" />
diff --git a/res/values/config.xml b/res/values/config.xml
index ef786be..ee727bc 100755
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -704,4 +704,10 @@
 
     <!-- Whether to display Cloned Apps page in Settings (Settings > Apps > Cloned Apps).-->
     <bool name="config_cloned_apps_page_enabled">false</bool>
+
+    <!-- Certificates of apps which are allowed to use activity embedding with Settings.-->
+    <string-array name="config_known_host_certs" translatable="false">
+        <item></item>
+    </string-array>
+
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 0216d28..c9bd044 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -147,7 +147,7 @@
     <string name="bluetooth_call_title">Audio during calls</string>
     <!-- Bluetooth audio output settings. Title of the option managing media audio path. [CHAR LIMIT=30] -->
     <string name="bluetooth_media_title">Media</string>
-    <!-- Bluetooth audio output settings. Title of the option managing system sounds related audio path. [CHAR LIMIT=30] -->
+    <!-- Bluetooth audio output settings. Title of the option managing system sounds related audio path. [CHAR LIMIT=60] -->
     <string name="bluetooth_system_sounds_title">Notifications and other system sounds</string>
     <!-- Description for text in accessibility hearing aids footer. [CHAR LIMIT=NONE] -->
     <string name="bluetooth_audio_routing_footer_summary">By default, audio output is determined by individual apps</string>
@@ -5272,7 +5272,7 @@
     <!-- Title for usage time that full charge lasts. [CHAR LIMIT=60] -->
     <string name="battery_full_charge_last">Full charge lasts about</string>
     <!-- Description for text in battery footer. [CHAR LIMIT=NONE] -->
-    <string name="battery_footer_summary">Battery usage data is approximate and can change based on usage.</string>
+    <string name="battery_footer_summary">Remaining battery life is approximate and can change based on usage</string>
     <!-- Title for battery usage amount by this app. [CHAR LIMIT=80] -->
     <string name="battery_detail_power_usage">Battery usage</string>
 
@@ -7611,8 +7611,8 @@
     <!-- Configure lock screen: Title for the option of unlocking directly to home. [CHAR LIMIT=30] -->
     <string name="lockscreen_bypass_title">Skip lock screen</string>
 
-    <!-- Configure lock screen: Summary for the option of unlocking directly to home. [CHAR LIMIT=100] -->
-    <string name="lockscreen_bypass_summary">After unlocking, go directly to last used screen</string>
+    <!-- Configure lock screen: Summary for the option of unlocking directly to home. [CHAR LIMIT=150] -->
+    <string name="lockscreen_bypass_summary">After unlocking, go directly to last used screen. Notifications won’t show on lock screen. Swipe down from top to see them.</string>
 
     <!-- Configure lock screen: Search keywords for the option of unlocking directly to home. [CHAR LIMIT=100] -->
     <string name="keywords_lockscreen_bypass">Lock screen, Lockscreen, Skip, Bypass</string>
diff --git a/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizardActivity.java b/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizardActivity.java
index 8626c52..57047f9 100644
--- a/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizardActivity.java
+++ b/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizardActivity.java
@@ -30,7 +30,6 @@
 import com.android.settings.search.actionbar.SearchMenuController;
 import com.android.settings.support.actionbar.HelpResourceProvider;
 import com.android.settingslib.core.instrumentation.Instrumentable;
-import com.android.settingslib.transition.SettingsTransitionHelper;
 
 import com.google.android.setupcompat.util.WizardManagerHelper;
 import com.google.android.setupdesign.util.ThemeHelper;
@@ -84,7 +83,6 @@
                         : Instrumentable.METRICS_CATEGORY_UNKNOWN)
                 .setExtras(SetupWizardUtils.copyLifecycleExtra(getIntent().getExtras(),
                         new Bundle()))
-                .setTransitionType(SettingsTransitionHelper.TransitionType.TRANSITION_FADE)
                 .launch();
         return true;
     }
diff --git a/src/com/android/settings/applications/AppStoreUtil.java b/src/com/android/settings/applications/AppStoreUtil.java
index b18a68f..b73b14a 100644
--- a/src/com/android/settings/applications/AppStoreUtil.java
+++ b/src/com/android/settings/applications/AppStoreUtil.java
@@ -53,7 +53,8 @@
             // so we choose to ignore this when supplied by a non-system app.
             String originatingPackageName = source.getOriginatingPackageName();
             String initiatingPackageName = source.getInitiatingPackageName();
-            if (originatingPackageName != null && initiatingPackageName != null) {
+            if (originatingPackageName != null && initiatingPackageName != null
+                    && !initiatingPackageName.equals("com.android.shell")) {
                 ApplicationInfo ai = context.getPackageManager().getApplicationInfo(
                         initiatingPackageName, 0);
                 if ((ai.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
diff --git a/src/com/android/settings/applications/credentials/CredentialManagerPreferenceController.java b/src/com/android/settings/applications/credentials/CredentialManagerPreferenceController.java
index 3ec7782..4c80f54 100644
--- a/src/com/android/settings/applications/credentials/CredentialManagerPreferenceController.java
+++ b/src/com/android/settings/applications/credentials/CredentialManagerPreferenceController.java
@@ -325,9 +325,9 @@
             icon = mIconFactory.getBadgedIcon(appInfo, getUser());
         }
 
-        // If there is no title then don't show anything.
+        // If there is no title then show the package manager.
         if (TextUtils.isEmpty(title)) {
-            return null;
+            title = firstServiceInfo.packageName;
         }
 
         return addProviderPreference(
diff --git a/src/com/android/settings/bluetooth/HearingDeviceAudioRoutingBasePreferenceController.java b/src/com/android/settings/bluetooth/HearingDeviceAudioRoutingBasePreferenceController.java
index 84412da..e93863a 100644
--- a/src/com/android/settings/bluetooth/HearingDeviceAudioRoutingBasePreferenceController.java
+++ b/src/com/android/settings/bluetooth/HearingDeviceAudioRoutingBasePreferenceController.java
@@ -20,24 +20,20 @@
 import android.content.Context;
 import android.media.AudioAttributes;
 import android.media.AudioDeviceAttributes;
-import android.media.AudioDeviceInfo;
-import android.media.AudioManager;
 import android.media.audiopolicy.AudioProductStrategy;
 import android.util.Log;
 
-import androidx.annotation.IntDef;
-import androidx.annotation.VisibleForTesting;
 import androidx.preference.ListPreference;
 import androidx.preference.Preference;
 
 import com.android.settings.core.BasePreferenceController;
 import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+import com.android.settingslib.bluetooth.HearingAidAudioRoutingConstants;
+import com.android.settingslib.bluetooth.HearingAidAudioRoutingHelper;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.primitives.Ints;
 
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -49,16 +45,21 @@
         BasePreferenceController implements Preference.OnPreferenceChangeListener {
 
     private static final String TAG = "HARoutingBasePreferenceController";
+    private static final boolean DEBUG = false;
 
-    private static final AudioDeviceAttributes DEVICE_SPEAKER_OUT = new AudioDeviceAttributes(
-            AudioDeviceAttributes.ROLE_OUTPUT, AudioDeviceInfo.TYPE_BUILTIN_SPEAKER, "");
-
-    private final AudioManager mAudioManager;
+    private final HearingAidAudioRoutingHelper mHelper;
 
     public HearingDeviceAudioRoutingBasePreferenceController(Context context,
             String preferenceKey) {
         super(context, preferenceKey);
-        mAudioManager = mContext.getSystemService(AudioManager.class);
+        mHelper = new HearingAidAudioRoutingHelper(context);
+    }
+
+    @VisibleForTesting
+    public HearingDeviceAudioRoutingBasePreferenceController(Context context,
+            String preferenceKey, HearingAidAudioRoutingHelper helper) {
+        super(context, preferenceKey);
+        mHelper = helper;
     }
 
     @Override
@@ -77,48 +78,46 @@
 
     @Override
     public boolean onPreferenceChange(Preference preference, Object newValue) {
-        final ListPreference listPreference = (ListPreference) preference;
         final Integer routingValue = Ints.tryParse((String) newValue);
-        final AudioDeviceAttributes hearingDeviceAttribute = new AudioDeviceAttributes(
-                AudioDeviceAttributes.ROLE_OUTPUT,
-                AudioDeviceInfo.TYPE_HEARING_AID,
-                getHearingDevice().getAddress());
-        final List<AudioProductStrategy> supportedStrategies = getSupportedStrategies(
-                getSupportedAttributeList());
-
-        boolean status = false;
-        if (routingValue != null) {
-            switch (routingValue) {
-                case RoutingValue.AUTO:
-                    status = removePreferredDeviceForStrategies(supportedStrategies);
-                    break;
-                case RoutingValue.HEARING_DEVICE:
-                    removePreferredDeviceForStrategies(supportedStrategies);
-                    status = setPreferredDeviceForStrategies(supportedStrategies,
-                            hearingDeviceAttribute);
-                    break;
-                case RoutingValue.DEVICE_SPEAKER:
-                    removePreferredDeviceForStrategies(supportedStrategies);
-                    status = setPreferredDeviceForStrategies(supportedStrategies,
-                            DEVICE_SPEAKER_OUT);
-                    break;
-                default:
-                    throw new IllegalArgumentException("Unexpected routingValue: " + routingValue);
-            }
-        }
-        if (!status) {
-            Log.w(TAG, "routingMode: " + listPreference.getKey() + "routingValue: " + routingValue
-                    + " fail to configure AudioProductStrategy");
-        }
 
         saveRoutingValue(mContext, routingValue);
-        updateState(listPreference);
+        trySetAudioRoutingConfig(getSupportedAttributeList(), getHearingDevice(), routingValue);
+
         return true;
     }
 
+    private void trySetAudioRoutingConfig(int[] audioAttributes,
+            CachedBluetoothDevice hearingDevice,
+            @HearingAidAudioRoutingConstants.RoutingValue int routingValue) {
+        final List<AudioProductStrategy> supportedStrategies = mHelper.getSupportedStrategies(
+                audioAttributes);
+        final AudioDeviceAttributes hearingDeviceAttributes =
+                mHelper.getMatchedHearingDeviceAttributes(hearingDevice);
+        if (hearingDeviceAttributes == null) {
+            if (DEBUG) {
+                Log.d(TAG,
+                        "Can not find expected AudioDeviceAttributes to config audio routing "
+                                + "maybe device is offline: "
+                                + hearingDevice.getDevice().getAnonymizedAddress());
+            }
+            return;
+        }
+
+        final boolean status = mHelper.setPreferredDeviceRoutingStrategies(supportedStrategies,
+                hearingDeviceAttributes, routingValue);
+
+        if (!status) {
+            final List<String> strategiesName = supportedStrategies.stream()
+                    .map(AudioProductStrategy::getName)
+                    .collect(Collectors.toList());
+            Log.w(TAG, "routingMode: " + strategiesName + " routingValue: " + routingValue
+                    + " fail to configure AudioProductStrategy");
+        }
+    }
+
     /**
-     * Gets a list of usage value defined in {@link AudioAttributes} that is used to configure
-     * audio routing via {@link AudioProductStrategy}.
+     * Gets a list of usage values defined in {@link AudioAttributes} that are used to identify
+     * {@link AudioProductStrategy} to configure audio routing.
      */
     protected abstract int[] getSupportedAttributeList();
 
@@ -129,77 +128,19 @@
     protected abstract CachedBluetoothDevice getHearingDevice();
 
     /**
-     * Saves the {@link RoutingValue}.
+     * Saves the routing value.
      *
      * @param context the valid context used to get the {@link ContentResolver}
-     * @param routingValue the value defined in {@link RoutingValue}
+     * @param routingValue one of the value defined in
+     *                     {@link HearingAidAudioRoutingConstants.RoutingValue}
      */
     protected abstract void saveRoutingValue(Context context, int routingValue);
 
     /**
-     * Restores the {@link RoutingValue} and used to reflect status on ListPreference.
+     * Restores the routing value and used to reflect status on ListPreference.
      *
      * @param context the valid context used to get the {@link ContentResolver}
-     * @return one of {@link RoutingValue}
+     * @return one of the value defined in {@link HearingAidAudioRoutingConstants.RoutingValue}
      */
     protected abstract int restoreRoutingValue(Context context);
-
-    private List<AudioProductStrategy> getSupportedStrategies(int[] attributeSdkUsageList) {
-        final List<AudioAttributes> audioAttrList = new ArrayList<>(attributeSdkUsageList.length);
-        for (int attributeSdkUsage : attributeSdkUsageList) {
-            audioAttrList.add(new AudioAttributes.Builder().setUsage(attributeSdkUsage).build());
-        }
-
-        final List<AudioProductStrategy> allStrategies = getAudioProductStrategies();
-        final List<AudioProductStrategy> supportedStrategies = new ArrayList<>();
-        for (AudioProductStrategy strategy : allStrategies) {
-            for (AudioAttributes audioAttr : audioAttrList) {
-                if (strategy.supportsAudioAttributes(audioAttr)) {
-                    supportedStrategies.add(strategy);
-                }
-            }
-        }
-
-        return supportedStrategies.stream().distinct().collect(Collectors.toList());
-    }
-
-    @VisibleForTesting
-    List<AudioProductStrategy> getAudioProductStrategies() {
-        return AudioManager.getAudioProductStrategies();
-    }
-
-    @VisibleForTesting
-    boolean setPreferredDeviceForStrategies(List<AudioProductStrategy> strategies,
-            AudioDeviceAttributes audioDevice) {
-        boolean status = true;
-        for (AudioProductStrategy strategy : strategies) {
-            status &= mAudioManager.setPreferredDeviceForStrategy(strategy, audioDevice);
-        }
-
-        return status;
-    }
-
-    @VisibleForTesting
-    boolean removePreferredDeviceForStrategies(List<AudioProductStrategy> strategies) {
-        boolean status = true;
-        for (AudioProductStrategy strategy : strategies) {
-            status &= mAudioManager.removePreferredDeviceForStrategy(strategy);
-        }
-
-        return status;
-    }
-
-    @Retention(RetentionPolicy.SOURCE)
-    @IntDef({
-            RoutingValue.AUTO,
-            RoutingValue.HEARING_DEVICE,
-            RoutingValue.DEVICE_SPEAKER,
-    })
-
-    @VisibleForTesting
-    protected @interface RoutingValue {
-        int AUTO = 0;
-        int HEARING_DEVICE = 1;
-        int DEVICE_SPEAKER = 2;
-    }
 }
diff --git a/src/com/android/settings/bluetooth/HearingDeviceCallRoutingPreferenceController.java b/src/com/android/settings/bluetooth/HearingDeviceCallRoutingPreferenceController.java
index 8daa738..ea5ba8b 100644
--- a/src/com/android/settings/bluetooth/HearingDeviceCallRoutingPreferenceController.java
+++ b/src/com/android/settings/bluetooth/HearingDeviceCallRoutingPreferenceController.java
@@ -17,10 +17,10 @@
 package com.android.settings.bluetooth;
 
 import android.content.Context;
-import android.media.AudioAttributes;
 import android.provider.Settings;
 
 import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+import com.android.settingslib.bluetooth.HearingAidAudioRoutingConstants;
 
 /**
  * The controller of the hearing device call routing list preference.
@@ -45,9 +45,7 @@
 
     @Override
     protected int[] getSupportedAttributeList() {
-        return new int[]{
-                AudioAttributes.USAGE_VOICE_COMMUNICATION,
-                AudioAttributes.USAGE_VOICE_COMMUNICATION_SIGNALLING};
+        return HearingAidAudioRoutingConstants.CALL_ROUTING_ATTRIBUTES;
     }
 
     @Override
@@ -64,6 +62,7 @@
     @Override
     protected int restoreRoutingValue(Context context) {
         return Settings.Secure.getInt(context.getContentResolver(),
-                Settings.Secure.HEARING_AID_CALL_ROUTING, RoutingValue.AUTO);
+                Settings.Secure.HEARING_AID_CALL_ROUTING,
+                HearingAidAudioRoutingConstants.RoutingValue.AUTO);
     }
 }
diff --git a/src/com/android/settings/bluetooth/HearingDeviceMediaRoutingPreferenceController.java b/src/com/android/settings/bluetooth/HearingDeviceMediaRoutingPreferenceController.java
index 4e61346..1ea36c7 100644
--- a/src/com/android/settings/bluetooth/HearingDeviceMediaRoutingPreferenceController.java
+++ b/src/com/android/settings/bluetooth/HearingDeviceMediaRoutingPreferenceController.java
@@ -17,10 +17,10 @@
 package com.android.settings.bluetooth;
 
 import android.content.Context;
-import android.media.AudioAttributes;
 import android.provider.Settings;
 
 import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+import com.android.settingslib.bluetooth.HearingAidAudioRoutingConstants;
 
 /**
  * The controller of the hearing device media routing list preference.
@@ -45,9 +45,8 @@
 
     @Override
     protected int[] getSupportedAttributeList() {
-        return new int[]{
-                AudioAttributes.USAGE_MEDIA,
-                AudioAttributes.USAGE_GAME};
+        return HearingAidAudioRoutingConstants.MEDIA_ROUTING_ATTRIBUTES;
+
     }
 
     @Override
@@ -64,6 +63,7 @@
     @Override
     protected int restoreRoutingValue(Context context) {
         return Settings.Secure.getInt(context.getContentResolver(),
-                Settings.Secure.HEARING_AID_MEDIA_ROUTING, RoutingValue.AUTO);
+                Settings.Secure.HEARING_AID_MEDIA_ROUTING,
+                HearingAidAudioRoutingConstants.RoutingValue.AUTO);
     }
 }
diff --git a/src/com/android/settings/bluetooth/HearingDeviceRingtoneRoutingPreferenceController.java b/src/com/android/settings/bluetooth/HearingDeviceRingtoneRoutingPreferenceController.java
index 325d394..006cb6b 100644
--- a/src/com/android/settings/bluetooth/HearingDeviceRingtoneRoutingPreferenceController.java
+++ b/src/com/android/settings/bluetooth/HearingDeviceRingtoneRoutingPreferenceController.java
@@ -17,10 +17,10 @@
 package com.android.settings.bluetooth;
 
 import android.content.Context;
-import android.media.AudioAttributes;
 import android.provider.Settings;
 
 import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+import com.android.settingslib.bluetooth.HearingAidAudioRoutingConstants;
 
 /**
  * The controller of the hearing device ringtone routing list preference.
@@ -45,7 +45,8 @@
 
     @Override
     protected int[] getSupportedAttributeList() {
-        return new int[] {AudioAttributes.USAGE_NOTIFICATION_RINGTONE};
+        return HearingAidAudioRoutingConstants.RINGTONE_ROUTING_ATTRIBUTE;
+
     }
 
     @Override
@@ -62,6 +63,7 @@
     @Override
     protected int restoreRoutingValue(Context context) {
         return Settings.Secure.getInt(context.getContentResolver(),
-                Settings.Secure.HEARING_AID_RINGTONE_ROUTING, RoutingValue.AUTO);
+                Settings.Secure.HEARING_AID_RINGTONE_ROUTING,
+                HearingAidAudioRoutingConstants.RoutingValue.AUTO);
     }
 }
diff --git a/src/com/android/settings/bluetooth/HearingDeviceSystemSoundsRoutingPreferenceController.java b/src/com/android/settings/bluetooth/HearingDeviceSystemSoundsRoutingPreferenceController.java
index 19de713..a66cfab 100644
--- a/src/com/android/settings/bluetooth/HearingDeviceSystemSoundsRoutingPreferenceController.java
+++ b/src/com/android/settings/bluetooth/HearingDeviceSystemSoundsRoutingPreferenceController.java
@@ -17,10 +17,10 @@
 package com.android.settings.bluetooth;
 
 import android.content.Context;
-import android.media.AudioAttributes;
 import android.provider.Settings;
 
 import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+import com.android.settingslib.bluetooth.HearingAidAudioRoutingConstants;
 
 /**
  * The controller of the hearing device system sounds routing list preference.
@@ -46,14 +46,8 @@
 
     @Override
     protected int[] getSupportedAttributeList() {
-        return new int[]{
-                AudioAttributes.USAGE_ALARM,
-                AudioAttributes.USAGE_NOTIFICATION,
-                AudioAttributes.USAGE_NOTIFICATION_EVENT,
-                AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY,
-                AudioAttributes.USAGE_ASSISTANCE_NAVIGATION_GUIDANCE,
-                AudioAttributes.USAGE_ASSISTANCE_SONIFICATION,
-                AudioAttributes.USAGE_ASSISTANT};
+        return HearingAidAudioRoutingConstants.SYSTEM_SOUNDS_ROUTING_ATTRIBUTES;
+
     }
 
     @Override
@@ -71,6 +65,7 @@
     @Override
     protected int restoreRoutingValue(Context context) {
         return Settings.Secure.getInt(context.getContentResolver(),
-                Settings.Secure.HEARING_AID_SYSTEM_SOUNDS_ROUTING, RoutingValue.AUTO);
+                Settings.Secure.HEARING_AID_SYSTEM_SOUNDS_ROUTING,
+                HearingAidAudioRoutingConstants.RoutingValue.AUTO);
     }
 }
diff --git a/src/com/android/settings/core/SettingsBaseActivity.java b/src/com/android/settings/core/SettingsBaseActivity.java
index b4380ab..ff84a3f 100644
--- a/src/com/android/settings/core/SettingsBaseActivity.java
+++ b/src/com/android/settings/core/SettingsBaseActivity.java
@@ -50,6 +50,7 @@
 import com.google.android.material.appbar.CollapsingToolbarLayout;
 import com.google.android.material.resources.TextAppearanceConfig;
 import com.google.android.setupcompat.util.WizardManagerHelper;
+import com.google.android.setupdesign.transition.TransitionHelper;
 import com.google.android.setupdesign.util.ThemeHelper;
 
 /** Base activity for Settings pages */
@@ -77,6 +78,11 @@
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
+        final boolean isAnySetupWizard = WizardManagerHelper.isAnySetupWizard(getIntent());
+        if (isAnySetupWizard) {
+            TransitionHelper.applyForwardTransition(this);
+            TransitionHelper.applyBackwardTransition(this);
+        }
         super.onCreate(savedInstanceState);
         if (isFinishing()) {
             return;
@@ -97,7 +103,6 @@
             requestWindowFeature(Window.FEATURE_NO_TITLE);
         }
         // Apply SetupWizard light theme during setup flow. This is for SubSettings pages.
-        final boolean isAnySetupWizard = WizardManagerHelper.isAnySetupWizard(getIntent());
         if (isAnySetupWizard && this instanceof SubSettings) {
             setTheme(SetupWizardUtils.getTheme(this, getIntent()));
             setTheme(R.style.SettingsPreferenceTheme_SetupWizard);
diff --git a/src/com/android/settings/display/CustomizableLockScreenQuickAffordancesPreferenceController.java b/src/com/android/settings/display/CustomizableLockScreenQuickAffordancesPreferenceController.java
index 2c06a51..96ca4e5 100644
--- a/src/com/android/settings/display/CustomizableLockScreenQuickAffordancesPreferenceController.java
+++ b/src/com/android/settings/display/CustomizableLockScreenQuickAffordancesPreferenceController.java
@@ -50,7 +50,7 @@
         final Preference preference = screen.findPreference(getPreferenceKey());
         if (preference != null) {
             preference.setOnPreferenceClickListener(preference1 -> {
-                final Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
+                final Intent intent = CustomizableLockScreenUtils.newIntent();
                 final String packageName =
                         mContext.getString(R.string.config_wallpaper_picker_package);
                 if (!TextUtils.isEmpty(packageName)) {
diff --git a/src/com/android/settings/display/CustomizableLockScreenUtils.java b/src/com/android/settings/display/CustomizableLockScreenUtils.java
index 2e9f53d..d945652 100644
--- a/src/com/android/settings/display/CustomizableLockScreenUtils.java
+++ b/src/com/android/settings/display/CustomizableLockScreenUtils.java
@@ -18,6 +18,8 @@
 
 import android.content.ContentResolver;
 import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
 import android.database.Cursor;
 import android.net.Uri;
 import android.text.TextUtils;
@@ -67,6 +69,10 @@
      * <p>This is a slow, blocking call that shouldn't be made on the main thread.
      */
     public static boolean isFeatureEnabled(Context context) {
+        if (!isWallpaperPickerInstalled(context)) {
+            return false;
+        }
+
         try (Cursor cursor = context.getContentResolver().query(
                 FLAGS_URI,
                 null,
@@ -151,4 +157,17 @@
             return null;
         }
     }
+
+    /**
+     * Returns a new {@link Intent} that can be used to start the wallpaper picker
+     * activity.
+     */
+    public static Intent newIntent() {
+        return new Intent(Intent.ACTION_SET_WALLPAPER);
+    }
+
+    private static boolean isWallpaperPickerInstalled(Context context) {
+        final PackageManager packageManager = context.getPackageManager();
+        return newIntent().resolveActivity(packageManager) != null;
+    }
 }
diff --git a/src/com/android/settings/localepicker/LocaleFeatureProviderImpl.java b/src/com/android/settings/localepicker/LocaleFeatureProviderImpl.java
index b6c21db..0af9d2f 100644
--- a/src/com/android/settings/localepicker/LocaleFeatureProviderImpl.java
+++ b/src/com/android/settings/localepicker/LocaleFeatureProviderImpl.java
@@ -27,9 +27,19 @@
     @Override
     public String getLocaleNames() {
         final LocaleList locales = LocalePicker.getLocales();
-        Locale[] arrLocalesWithoutExtension = new Locale[locales.size()];
-        for (int i = 0; i < locales.size(); i++) {
-            arrLocalesWithoutExtension[i] = locales.get(i).stripExtensions();
+        return getLocaleNames(locales);
+    }
+
+    /**
+     * Returns displayable string of inputted locales.
+     */
+    public String getLocaleNames(LocaleList inputLocales) {
+        if (inputLocales.isEmpty()) {
+            return "";
+        }
+        Locale[] arrLocalesWithoutExtension = new Locale[inputLocales.size()];
+        for (int i = 0; i < inputLocales.size(); i++) {
+            arrLocalesWithoutExtension[i] = inputLocales.get(i).stripExtensions();
         }
         final Locale displayLocale = Locale.getDefault();
         return LocaleHelper.toSentenceCase(
diff --git a/src/com/android/settings/network/MobileNetworkRepository.java b/src/com/android/settings/network/MobileNetworkRepository.java
index 1e57c48..bec65e2 100644
--- a/src/com/android/settings/network/MobileNetworkRepository.java
+++ b/src/com/android/settings/network/MobileNetworkRepository.java
@@ -111,8 +111,12 @@
     private Map<Integer, SubscriptionInfo> mSubscriptionInfoMap = new ArrayMap<>();
     private Map<Integer, TelephonyManager> mTelephonyManagerMap = new HashMap<>();
     private Map<Integer, PhoneCallStateTelephonyCallback> mTelephonyCallbackMap = new HashMap<>();
-    private BroadcastReceiver mDataSubscriptionChangedReceiver = null;
-
+    private BroadcastReceiver mDataSubscriptionChangedReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            onSubscriptionsChanged();
+        }
+    };
     @NonNull
     public static MobileNetworkRepository getInstance(Context context) {
         synchronized (sInstanceLock) {
@@ -142,8 +146,6 @@
         mFilter.addAction(SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED);
         mFilter.addAction(ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED);
         mFilter.addAction(SubscriptionManager.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED);
-        mDataSubscriptionChangedReceiver = new DataSubscriptionChangedReceiver();
-        mContext.registerReceiver(mDataSubscriptionChangedReceiver, mFilter);
     }
 
     private class AirplaneModeObserver extends ContentObserver {
@@ -171,13 +173,6 @@
         }
     }
 
-    private class DataSubscriptionChangedReceiver extends BroadcastReceiver {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            onSubscriptionsChanged();
-        }
-    }
-
     /**
      * Register all callbacks and listener.
      *
@@ -188,9 +183,16 @@
      */
     public void addRegister(LifecycleOwner lifecycleOwner,
             MobileNetworkCallback mobileNetworkCallback, int subId) {
+        if (sCallbacks.isEmpty()) {
+            mSubscriptionManager.addOnSubscriptionsChangedListener(mContext.getMainExecutor(),
+                    this);
+            mAirplaneModeObserver.register(mContext);
+            mContext.registerReceiver(mDataSubscriptionChangedReceiver, mFilter);
+            if (DEBUG) {
+                Log.d(TAG, "addRegister done");
+            }
+        }
         sCallbacks.add(mobileNetworkCallback);
-        mSubscriptionManager.addOnSubscriptionsChangedListener(mContext.getMainExecutor(), this);
-        mAirplaneModeObserver.register(mContext);
         observeAllSubInfo(lifecycleOwner);
         observeAllUiccInfo(lifecycleOwner);
         observeAllMobileNetworkInfo(lifecycleOwner);
@@ -200,7 +202,7 @@
         }
     }
 
-    private void addRegisterBySubId(int subId) {
+    public void addRegisterBySubId(int subId) {
         MobileDataContentObserver dataContentObserver = new MobileDataContentObserver(
                 new Handler(Looper.getMainLooper()));
         dataContentObserver.setOnMobileDataChangedListener(() -> {
@@ -268,10 +270,7 @@
         if (sCallbacks.isEmpty()) {
             mSubscriptionManager.removeOnSubscriptionsChangedListener(this);
             mAirplaneModeObserver.unRegister(mContext);
-            if (mDataSubscriptionChangedReceiver != null) {
-                mContext.unregisterReceiver(mDataSubscriptionChangedReceiver);
-                mDataSubscriptionChangedReceiver = null;
-            }
+            mContext.unregisterReceiver(mDataSubscriptionChangedReceiver);
             mDataContentObserverMap.forEach((id, observer) -> {
                 observer.unRegister(mContext);
             });
@@ -285,6 +284,9 @@
             });
             mTelephonyCallbackMap.clear();
             mTelephonyManagerMap.clear();
+            if (DEBUG) {
+                Log.d(TAG, "removeRegister done");
+            }
         }
     }
 
diff --git a/src/com/android/settings/network/telephony/DefaultSubscriptionController.java b/src/com/android/settings/network/telephony/DefaultSubscriptionController.java
index 01ec5df..c8f7acf 100644
--- a/src/com/android/settings/network/telephony/DefaultSubscriptionController.java
+++ b/src/com/android/settings/network/telephony/DefaultSubscriptionController.java
@@ -104,8 +104,13 @@
 
     @OnLifecycleEvent(ON_RESUME)
     public void onResume() {
-        mMobileNetworkRepository.addRegister(mLifecycleOwner, this, getDefaultSubscriptionId());
+        mMobileNetworkRepository.addRegister(mLifecycleOwner, this,
+                SubscriptionManager.INVALID_SUBSCRIPTION_ID);
         mMobileNetworkRepository.updateEntity();
+        // Can not get default subId from database until get the callback, add register by subId
+        // later.
+        mMobileNetworkRepository.addRegisterBySubId(getDefaultSubscriptionId());
+
     }
 
     @OnLifecycleEvent(ON_PAUSE)
diff --git a/src/com/android/settings/password/SetupChooseLockGeneric.java b/src/com/android/settings/password/SetupChooseLockGeneric.java
index 797f1eb..17d83b3 100644
--- a/src/com/android/settings/password/SetupChooseLockGeneric.java
+++ b/src/com/android/settings/password/SetupChooseLockGeneric.java
@@ -108,6 +108,7 @@
             super.onViewCreated(view, savedInstanceState);
 
             GlifPreferenceLayout layout = (GlifPreferenceLayout) view;
+            layout.setDescriptionText(loadDescriptionText());
             layout.setDividerItemDecoration(new SettingsDividerItemDecoration(getContext()));
             layout.setDividerInset(getContext().getResources().getDimensionPixelSize(
                     R.dimen.sud_items_glif_text_divider_inset));
@@ -128,11 +129,9 @@
 
         @Override
         protected void addHeaderView() {
-            if (isForBiometric()) {
-                setHeaderView(R.layout.setup_choose_lock_generic_biometrics_header);
-            } else {
-                setHeaderView(R.layout.setup_choose_lock_generic_header);
-            }
+            // The original logic has been moved to onViewCreated and
+            // uses GlifLayout#setDescriptionText instead,
+            // keep empty body here since we won't call super method.
         }
 
         @Override
@@ -229,6 +228,12 @@
         private boolean isForBiometric() {
             return mForFingerprint || mForFace || mForBiometrics;
         }
+
+        String loadDescriptionText() {
+            return getString(isForBiometric()
+                    ? R.string.lock_settings_picker_biometrics_added_security_message
+                    : R.string.setup_lock_settings_picker_message);
+        }
     }
 
     public static class InternalActivity extends ChooseLockGeneric.InternalActivity {
diff --git a/src/com/android/settings/regionalpreferences/NumberingSystemController.java b/src/com/android/settings/regionalpreferences/NumberingSystemController.java
index d9feba4..d936fbf 100644
--- a/src/com/android/settings/regionalpreferences/NumberingSystemController.java
+++ b/src/com/android/settings/regionalpreferences/NumberingSystemController.java
@@ -17,16 +17,26 @@
 package com.android.settings.regionalpreferences;
 
 import android.content.Context;
+import android.os.LocaleList;
 
+import com.android.internal.app.LocaleStore;
 import com.android.settings.core.BasePreferenceController;
 import com.android.settings.localepicker.LocaleFeatureProviderImpl;
 
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Set;
+
 /** A controller for the entry of Numbering System's page */
 public class NumberingSystemController extends BasePreferenceController {
     private static final String TAG = NumberingSystemController.class.getSimpleName();
 
+    private LocaleList mLocaleList;
     public NumberingSystemController(Context context, String preferenceKey) {
         super(context, preferenceKey);
+        // Initialize the supported languages to LocaleInfos
+        LocaleStore.fillCache(context);
+        mLocaleList = getNumberingSystemLocale();
     }
 
     /**
@@ -42,11 +52,31 @@
      */
     @Override
     public int getAvailabilityStatus() {
-        return AVAILABLE;
+        return mLocaleList.isEmpty() ? CONDITIONALLY_UNAVAILABLE : AVAILABLE;
+    }
+
+    private static LocaleList getNumberingSystemLocale() {
+        LocaleList localeList = LocaleList.getDefault();
+        Set<Locale> localesHasNumberingSystems = new HashSet<>();
+        for (int i = 0; i < localeList.size(); i++) {
+            Locale locale = localeList.get(i);
+            LocaleStore.LocaleInfo localeInfo = LocaleStore.getLocaleInfo(locale);
+            if (localeInfo.hasNumberingSystems()) {
+                localesHasNumberingSystems.add(locale);
+            }
+        }
+        return convertToLocaleList(localesHasNumberingSystems);
+    }
+
+    private static LocaleList convertToLocaleList(Set<Locale> locales) {
+        if (locales.isEmpty()) {
+            return LocaleList.getEmptyLocaleList();
+        }
+        return new LocaleList(locales.stream().toArray(Locale[]::new));
     }
 
     @Override
     public CharSequence getSummary() {
-        return new LocaleFeatureProviderImpl().getLocaleNames();
+        return new LocaleFeatureProviderImpl().getLocaleNames(getNumberingSystemLocale());
     }
 }
diff --git a/src/com/android/settings/regionalpreferences/NumberingSystemItemController.java b/src/com/android/settings/regionalpreferences/NumberingSystemItemController.java
index fc26b53..8e2d735 100644
--- a/src/com/android/settings/regionalpreferences/NumberingSystemItemController.java
+++ b/src/com/android/settings/regionalpreferences/NumberingSystemItemController.java
@@ -30,6 +30,7 @@
 
 import com.android.internal.app.LocaleHelper;
 import com.android.internal.app.LocalePicker;
+import com.android.internal.app.LocaleStore;
 import com.android.settings.core.BasePreferenceController;
 import com.android.settings.core.SubSettingLauncher;
 import com.android.settings.dashboard.DashboardFragment;
@@ -52,6 +53,8 @@
 
     public NumberingSystemItemController(Context context, Bundle argument) {
         super(context, "no_key");
+        // Initialize the supported languages to LocaleInfos
+        LocaleStore.fillCache(context);
         mOption = argument.getString(
                 RegionalPreferencesEntriesFragment.ARG_KEY_REGIONAL_PREFERENCE, "");
         mSelectedLanguage = argument.getString(
@@ -111,8 +114,12 @@
         // Get current system language list to show on screen.
         LocaleList localeList = LocaleList.getDefault();
         for (int i = 0; i < localeList.size(); i++) {
-            Preference pref = new Preference(mContext);
             Locale locale = localeList.get(i);
+            LocaleStore.LocaleInfo localeInfo = LocaleStore.getLocaleInfo(locale);
+            if (!localeInfo.hasNumberingSystems()) {
+                continue;
+            }
+            Preference pref = new Preference(mContext);
             pref.setTitle(LocaleHelper.getDisplayName(locale.stripExtensions(), locale, true));
             pref.setKey(locale.toLanguageTag());
             pref.setSummary(getNumberingSystem(locale));
diff --git a/src/com/android/settings/tts/TextToSpeechSettings.java b/src/com/android/settings/tts/TextToSpeechSettings.java
index 621b222..9f1d2f3 100644
--- a/src/com/android/settings/tts/TextToSpeechSettings.java
+++ b/src/com/android/settings/tts/TextToSpeechSettings.java
@@ -811,6 +811,14 @@
     }
 
     public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
-            new BaseSearchIndexProvider(R.xml.tts_settings);
+            new BaseSearchIndexProvider(R.xml.tts_settings) {
+                @Override
+                protected boolean isPageSearchEnabled(Context context) {
+                    TtsEngines ttsEngines = new TtsEngines(context);
+                    return !ttsEngines.getEngines().isEmpty() &&
+                            context.getResources().getBoolean(
+                                    R.bool.config_show_tts_settings_summary);
+                }
+            };
 
 }
diff --git a/src/com/android/settings/wifi/addappnetworks/AddAppNetworksFragment.java b/src/com/android/settings/wifi/addappnetworks/AddAppNetworksFragment.java
index 63ab173..60031b0 100644
--- a/src/com/android/settings/wifi/addappnetworks/AddAppNetworksFragment.java
+++ b/src/com/android/settings/wifi/addappnetworks/AddAppNetworksFragment.java
@@ -655,6 +655,10 @@
             try {
                 mWifiManager.addOrUpdatePasspointConfiguration(passpointConfig);
                 mAnyNetworkSavedSuccess = true;
+
+                // (force) enable MAC randomization on new credentials
+                mWifiManager.setMacRandomizationSettingPasspointEnabled(
+                        passpointConfig.getHomeSp().getFqdn(), true);
             } catch (IllegalArgumentException e) {
                 mResultCodeArrayList.set(mUiToRequestedList.get(index).mIndex,
                         RESULT_NETWORK_ADD_ERROR);
@@ -669,6 +673,10 @@
             final WifiConfiguration wifiConfiguration =
                     mUiToRequestedList.get(index).mWifiNetworkSuggestion.getWifiConfiguration();
             wifiConfiguration.SSID = addQuotationIfNeeded(wifiConfiguration.SSID);
+
+            // (force) enable MAC randomization on new credentials
+            wifiConfiguration.setMacRandomizationSetting(
+                    WifiConfiguration.RANDOMIZATION_PERSISTENT);
             mWifiManager.save(wifiConfiguration, mSaveListener);
         }
     }
diff --git a/tests/robotests/src/com/android/settings/bluetooth/HearingDeviceAudioRoutingBasePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/HearingDeviceAudioRoutingBasePreferenceControllerTest.java
index 5be36c8..105da65 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/HearingDeviceAudioRoutingBasePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/HearingDeviceAudioRoutingBasePreferenceControllerTest.java
@@ -20,15 +20,13 @@
 
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
+import static org.mockito.ArgumentMatchers.isNull;
+import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
+import android.bluetooth.BluetoothDevice;
 import android.content.Context;
-import android.content.SharedPreferences;
 import android.media.AudioAttributes;
 import android.media.AudioDeviceAttributes;
 import android.media.AudioDeviceInfo;
@@ -38,7 +36,10 @@
 import androidx.preference.ListPreference;
 import androidx.test.core.app.ApplicationProvider;
 
+import com.android.settings.R;
 import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+import com.android.settingslib.bluetooth.HearingAidAudioRoutingConstants;
+import com.android.settingslib.bluetooth.HearingAidAudioRoutingHelper;
 
 import org.junit.Before;
 import org.junit.Rule;
@@ -63,71 +64,67 @@
     private final Context mContext = ApplicationProvider.getApplicationContext();
     private static final String TEST_DEVICE_ADDRESS = "00:A1:A1:A1:A1:A1";
     private static final String FAKE_KEY = "fake_key";
-    private static final String TEST_SHARED_PREFERENCE = "test_bluetooth_settings";
 
     @Mock
+    private AudioProductStrategy mAudioProductStrategyMedia;
+    @Mock
     private CachedBluetoothDevice mCachedBluetoothDevice;
     @Mock
-    private AudioProductStrategy mAudioProductStrategyMedia;
-    private AudioDeviceAttributes mHearingDeviceAttribute;
-    private ListPreference mListPreference;
+    private BluetoothDevice mBluetoothDevice;
+    @Spy
+    private HearingAidAudioRoutingHelper mHelper = new HearingAidAudioRoutingHelper(mContext);
+    private final ListPreference mListPreference = new ListPreference(mContext);
     private TestHearingDeviceAudioRoutingBasePreferenceController mController;
 
     @Before
     public void setUp() {
-        mListPreference = new ListPreference(mContext);
-        when(mCachedBluetoothDevice.getAddress()).thenReturn(TEST_DEVICE_ADDRESS);
-        mHearingDeviceAttribute = new AudioDeviceAttributes(
+        final AudioDeviceAttributes hearingDeviceAttribute = new AudioDeviceAttributes(
                 AudioDeviceAttributes.ROLE_OUTPUT,
                 AudioDeviceInfo.TYPE_HEARING_AID,
                 TEST_DEVICE_ADDRESS);
+
+        when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice);
+        when(mBluetoothDevice.getAnonymizedAddress()).thenReturn(TEST_DEVICE_ADDRESS);
+        when(mCachedBluetoothDevice.getAddress()).thenReturn(TEST_DEVICE_ADDRESS);
+        when(mHelper.getMatchedHearingDeviceAttributes(any())).thenReturn(hearingDeviceAttribute);
         when(mAudioProductStrategyMedia.getAudioAttributesForLegacyStreamType(
                 AudioManager.STREAM_MUSIC))
                 .thenReturn((new AudioAttributes.Builder()).build());
-        doReturn(getSharedPreferences()).when(mContext).getSharedPreferences(anyString(), anyInt());
+        when(mHelper.getAudioProductStrategies()).thenReturn(List.of(mAudioProductStrategyMedia));
 
-        mController = spy(
-                new TestHearingDeviceAudioRoutingBasePreferenceController(mContext, FAKE_KEY));
-        mController.setupForTesting(mCachedBluetoothDevice);
-        doReturn(List.of(mAudioProductStrategyMedia)).when(mController).getAudioProductStrategies();
+        mController = new TestHearingDeviceAudioRoutingBasePreferenceController(mContext, FAKE_KEY,
+                mHelper);
+        TestHearingDeviceAudioRoutingBasePreferenceController.setupForTesting(
+                mCachedBluetoothDevice);
+        mListPreference.setEntries(R.array.bluetooth_audio_routing_titles);
+        mListPreference.setEntryValues(R.array.bluetooth_audio_routing_values);
+        mListPreference.setSummary("%s");
     }
 
     @Test
-    public void onPreferenceChange_routingValueAuto_expectedListValue() {
-        mController.onPreferenceChange(mListPreference, String.valueOf(
-                HearingDeviceAudioRoutingBasePreferenceController.RoutingValue.AUTO));
+    public void updateState_routingValueAuto_expectedSummary() {
+        mController.saveRoutingValue(mContext, HearingAidAudioRoutingConstants.RoutingValue.AUTO);
 
-        verify(mController).removePreferredDeviceForStrategies(any());
-        assertThat(mListPreference.getValue()).isEqualTo(String.valueOf(
-                HearingDeviceAudioRoutingBasePreferenceController.RoutingValue.AUTO));
+        mController.updateState(mListPreference);
+
+        assertThat(mListPreference.getSummary().toString()).isEqualTo(
+                mListPreference.getEntries()[0].toString());
     }
 
     @Test
-    public void onPreferenceChange_routingValueHearingDevice_expectedListValue() {
+    public void onPreferenceChange_routingValueHearingDevice_restoreSameValue() {
         mController.onPreferenceChange(mListPreference, String.valueOf(
-                HearingDeviceAudioRoutingBasePreferenceController.RoutingValue.HEARING_DEVICE));
+                HearingAidAudioRoutingConstants.RoutingValue.HEARING_DEVICE));
 
-        verify(mController).setPreferredDeviceForStrategies(any(), eq(mHearingDeviceAttribute));
-        assertThat(mListPreference.getValue()).isEqualTo(String.valueOf(
-                HearingDeviceAudioRoutingBasePreferenceController.RoutingValue.HEARING_DEVICE));
+        assertThat(mController.restoreRoutingValue(mContext)).isEqualTo(
+                HearingAidAudioRoutingConstants.RoutingValue.HEARING_DEVICE);
     }
 
     @Test
-    public void onPreferenceChange_routingValueDeviceSpeaker_expectedListValue() {
-        final AudioDeviceAttributes deviceSpeakerOut = new AudioDeviceAttributes(
-                AudioDeviceAttributes.ROLE_OUTPUT, AudioDeviceInfo.TYPE_BUILTIN_SPEAKER, "");
+    public void onPreferenceChange_noMatchedDeviceAttributes_notCallSetStrategies() {
+        when(mHelper.getMatchedHearingDeviceAttributes(any())).thenReturn(null);
 
-        mController.onPreferenceChange(mListPreference, String.valueOf(
-                HearingDeviceAudioRoutingBasePreferenceController.RoutingValue.DEVICE_SPEAKER));
-
-        verify(mController).setPreferredDeviceForStrategies(any(), eq(deviceSpeakerOut));
-        assertThat(mListPreference.getValue()).isEqualTo(String.valueOf(
-                HearingDeviceAudioRoutingBasePreferenceController.RoutingValue.DEVICE_SPEAKER));
-
-    }
-
-    private SharedPreferences getSharedPreferences() {
-        return mContext.getSharedPreferences(TEST_SHARED_PREFERENCE, Context.MODE_PRIVATE);
+        verify(mHelper, never()).setPreferredDeviceRoutingStrategies(any(), isNull(), anyInt());
     }
 
     private static class TestHearingDeviceAudioRoutingBasePreferenceController extends
@@ -137,8 +134,8 @@
         private static int sSavedRoutingValue;
 
         TestHearingDeviceAudioRoutingBasePreferenceController(Context context,
-                String preferenceKey) {
-            super(context, preferenceKey);
+                String preferenceKey, HearingAidAudioRoutingHelper helper) {
+            super(context, preferenceKey, helper);
         }
 
         @Override
diff --git a/tests/robotests/src/com/android/settings/display/CustomizableLockScreenQuickAffordancesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/CustomizableLockScreenQuickAffordancesPreferenceControllerTest.java
index 4ad5c22..78a9e99 100644
--- a/tests/robotests/src/com/android/settings/display/CustomizableLockScreenQuickAffordancesPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/CustomizableLockScreenQuickAffordancesPreferenceControllerTest.java
@@ -21,6 +21,8 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.anyInt;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -28,6 +30,10 @@
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
 import android.database.MatrixCursor;
 import android.text.TextUtils;
 
@@ -54,6 +60,7 @@
 
     @Mock private Context mContext;
     @Mock private ContentResolver mContentResolver;
+    @Mock private PackageManager mPackageManager;
 
     private CustomizableLockScreenQuickAffordancesPreferenceController mUnderTest;
 
@@ -63,20 +70,28 @@
         when(mContext.getContentResolver()).thenReturn(mContentResolver);
         when(mContext.getResources())
                 .thenReturn(ApplicationProvider.getApplicationContext().getResources());
+        when(mContext.getPackageManager()).thenReturn(mPackageManager);
 
         mUnderTest = new CustomizableLockScreenQuickAffordancesPreferenceController(mContext, KEY);
     }
 
     @Test
-    public void getAvailabilityStatus_whenEnabled() {
-        setEnabled(true);
+    public void getAvailabilityStatus_whenFeatureEnabled() {
+        setEnabled(/* isWallpaperPickerInstalled= */ true, /* isFeatureEnabled = */ true);
 
         assertThat(mUnderTest.getAvailabilityStatus()).isEqualTo(AVAILABLE);
     }
 
     @Test
-    public void getAvailabilityStatus_whenNotEnabled() {
-        setEnabled(false);
+    public void getAvailabilityStatus_whenWallpaperPickerNotInstalledEnabled() {
+        setEnabled(/* isWallpaperPickerInstalled= */ false, /* isFeatureEnabled = */ true);
+
+        assertThat(mUnderTest.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_whenFeatureNotEnabled() {
+        setEnabled(/* isWallpaperPickerInstalled= */ true, /* isFeatureEnabled = */ false);
 
         assertThat(mUnderTest.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
     }
@@ -127,13 +142,29 @@
         assertThat(TextUtils.equals(mUnderTest.getSummary(), "one, two")).isTrue();
     }
 
-    private void setEnabled(boolean isEnabled) {
+    private void setEnabled(boolean isWallpaperPickerInstalled, boolean isFeatureEnabled) {
+        if (isWallpaperPickerInstalled) {
+            final ResolveInfo resolveInfo = new ResolveInfo();
+            final ActivityInfo activityInfo = new ActivityInfo();
+            final ApplicationInfo applicationInfo = new ApplicationInfo();
+            applicationInfo.packageName = "com.fake.name";
+            activityInfo.applicationInfo = applicationInfo;
+            activityInfo.name = "someName";
+            resolveInfo.activityInfo = activityInfo;
+            when(mPackageManager.resolveActivity(any(), anyInt())).thenReturn(resolveInfo);
+        } else {
+            when(mPackageManager.resolveActivity(any(), anyInt())).thenReturn(null);
+        }
+
         final MatrixCursor cursor = new MatrixCursor(
                 new String[] {
                         CustomizableLockScreenUtils.NAME,
                         CustomizableLockScreenUtils.VALUE
                 });
-        cursor.addRow(new Object[] { CustomizableLockScreenUtils.ENABLED_FLAG, isEnabled ? 1 : 0 });
+        cursor.addRow(
+                new Object[] {
+                    CustomizableLockScreenUtils.ENABLED_FLAG, isFeatureEnabled ? 1 : 0
+                });
         when(
                 mContentResolver.query(
                         CustomizableLockScreenUtils.FLAGS_URI, null, null, null))
diff --git a/tests/robotests/src/com/android/settings/password/SetupChooseLockGenericTest.java b/tests/robotests/src/com/android/settings/password/SetupChooseLockGenericTest.java
index cd79f58..494d3f0 100644
--- a/tests/robotests/src/com/android/settings/password/SetupChooseLockGenericTest.java
+++ b/tests/robotests/src/com/android/settings/password/SetupChooseLockGenericTest.java
@@ -23,15 +23,20 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
-import static org.robolectric.Shadows.shadowOf;
-
 import android.content.Intent;
+import android.text.TextUtils;
 
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+
+import com.android.settings.password.SetupChooseLockGeneric.SetupChooseLockGenericFragment;
 import com.android.settings.testutils.shadow.ShadowLockPatternUtils;
 import com.android.settings.testutils.shadow.ShadowPasswordUtils;
 import com.android.settings.testutils.shadow.ShadowUserManager;
 import com.android.settings.testutils.shadow.ShadowUtils;
 
+import com.google.android.setupdesign.GlifPreferenceLayout;
+
 import org.junit.After;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -41,6 +46,8 @@
 import org.robolectric.annotation.Config;
 import org.robolectric.shadows.ShadowActivity;
 
+import java.util.List;
+
 @RunWith(RobolectricTestRunner.class)
 @Config(shadows = {
         ShadowUserManager.class,
@@ -78,4 +85,43 @@
         ShadowActivity shadowActivity = Shadows.shadowOf(activity);
         assertThat(shadowActivity.isFinishing()).isFalse();
     }
+
+    @Test
+    public void setupChooseLockGenericUsingDescriptionTextOfGlifLayout() {
+        SetupChooseLockGenericFragment fragment = getFragmentOfSetupChooseLockGeneric(false);
+        GlifPreferenceLayout view = getViewOfSetupChooseLockGenericFragment(fragment);
+        assertThat(TextUtils.isEmpty(view.getDescriptionText())).isFalse();
+        assertThat(view.getDescriptionText().toString()).isEqualTo(fragment.loadDescriptionText());
+    }
+
+    @Test
+    public void setupChooseLockGenericUsingDescriptionTextOfGlifLayoutForBiometric() {
+        SetupChooseLockGenericFragment fragment = getFragmentOfSetupChooseLockGeneric(true);
+        GlifPreferenceLayout view = getViewOfSetupChooseLockGenericFragment(fragment);
+        assertThat(TextUtils.isEmpty(view.getDescriptionText())).isFalse();
+        assertThat(view.getDescriptionText().toString()).isEqualTo(fragment.loadDescriptionText());
+    }
+
+    private SetupChooseLockGenericFragment getFragmentOfSetupChooseLockGeneric(boolean biometric) {
+        ShadowPasswordUtils.addGrantedPermission(REQUEST_PASSWORD_COMPLEXITY);
+        Intent intent = new Intent("com.android.settings.SETUP_LOCK_SCREEN");
+        intent.putExtra(EXTRA_KEY_REQUESTED_MIN_COMPLEXITY, PASSWORD_COMPLEXITY_HIGH);
+        intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT, biometric);
+        SetupChooseLockGeneric activity =
+                Robolectric.buildActivity(SetupChooseLockGeneric.class, intent).setup().get();
+
+        List<Fragment> fragments = activity.getSupportFragmentManager().getFragments();
+        assertThat(fragments).isNotNull();
+        assertThat(fragments.size()).isEqualTo(1);
+        assertThat(fragments.get(0)).isInstanceOf(SetupChooseLockGenericFragment.class);
+
+        return (SetupChooseLockGenericFragment) fragments.get(0);
+    }
+    private GlifPreferenceLayout getViewOfSetupChooseLockGenericFragment(
+            @NonNull SetupChooseLockGenericFragment fragment) {
+        assertThat(fragment.getView()).isNotNull();
+        assertThat(fragment.getView()).isInstanceOf(GlifPreferenceLayout.class);
+
+        return (GlifPreferenceLayout) fragment.getView();
+    }
 }
diff --git a/tests/unit/src/com/android/settings/applications/credentials/CredentialManagerPreferenceControllerTest.java b/tests/unit/src/com/android/settings/applications/credentials/CredentialManagerPreferenceControllerTest.java
index cba3101..2109f12 100644
--- a/tests/unit/src/com/android/settings/applications/credentials/CredentialManagerPreferenceControllerTest.java
+++ b/tests/unit/src/com/android/settings/applications/credentials/CredentialManagerPreferenceControllerTest.java
@@ -318,11 +318,11 @@
         Map<String, SwitchPreference> prefs =
                 controller.buildPreferenceList(mContext, mCredentialsPreferenceCategory);
         assertThat(prefs.size()).isEqualTo(3);
-        SwitchPreference pref1 = prefs.get(TEST_PACKAGE_NAME_C);
+        SwitchPreference pref1 = prefs.get(TEST_PACKAGE_NAME_A);
         assertThat(pref1).isNotNull();
         assertThat(pref1.getTitle()).isEqualTo(TEST_TITLE_APP_A);
         assertThat(pref1.isChecked()).isFalse();
-        SwitchPreference pref2 = prefs.get(TEST_PACKAGE_NAME_C);
+        SwitchPreference pref2 = prefs.get(TEST_PACKAGE_NAME_B);
         assertThat(pref2).isNotNull();
         assertThat(pref2.getTitle()).isEqualTo(TEST_TITLE_APP_B);
         assertThat(pref2.isChecked()).isFalse();
diff --git a/tests/unit/src/com/android/settings/regionalpreferences/NumberingPreferencesFragmentTest.java b/tests/unit/src/com/android/settings/regionalpreferences/NumberingPreferencesFragmentTest.java
index 92cfb69..5a579a3 100644
--- a/tests/unit/src/com/android/settings/regionalpreferences/NumberingPreferencesFragmentTest.java
+++ b/tests/unit/src/com/android/settings/regionalpreferences/NumberingPreferencesFragmentTest.java
@@ -19,18 +19,15 @@
 import static org.junit.Assert.assertEquals;
 
 import android.app.settings.SettingsEnums;
-import android.content.Context;
 import android.os.Bundle;
 import android.os.Looper;
 
 import androidx.test.annotation.UiThreadTest;
-import androidx.test.core.app.ApplicationProvider;
 
 import org.junit.Before;
 import org.junit.Test;
 
 public class NumberingPreferencesFragmentTest {
-    private Context mApplicationContext;
     private NumberingPreferencesFragment mFragment;
 
     @Before
@@ -39,7 +36,6 @@
         if (Looper.myLooper() == null) {
             Looper.prepare();
         }
-        mApplicationContext = ApplicationProvider.getApplicationContext();
         mFragment = new NumberingPreferencesFragment();
     }
 
diff --git a/tests/unit/src/com/android/settings/regionalpreferences/NumberingSystemControllerTest.java b/tests/unit/src/com/android/settings/regionalpreferences/NumberingSystemControllerTest.java
new file mode 100644
index 0000000..6a95bb9
--- /dev/null
+++ b/tests/unit/src/com/android/settings/regionalpreferences/NumberingSystemControllerTest.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2023 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.regionalpreferences;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
+
+import static org.junit.Assert.assertEquals;
+
+import android.content.Context;
+import android.os.LocaleList;
+
+import androidx.test.core.app.ApplicationProvider;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class NumberingSystemControllerTest {
+    private Context mApplicationContext;
+    private NumberingSystemController mController;
+
+    @Before
+    public void setUp() throws Exception {
+        mApplicationContext = ApplicationProvider.getApplicationContext();
+    }
+
+    @Test
+    public void getAvailabilityStatus_noLocale_unavailable() {
+        LocaleList.setDefault(LocaleList.forLanguageTags("en-US,zh-Hant-TW"));
+        mController = new NumberingSystemController(mApplicationContext, "key");
+
+        int result = mController.getAvailabilityStatus();
+
+        assertEquals(CONDITIONALLY_UNAVAILABLE, result);
+    }
+
+    @Test
+    public void getAvailabilityStatus_hasLocaleWithNumberingSystems_available() {
+        // ar-JO has different numbering system.
+        LocaleList.setDefault(LocaleList.forLanguageTags("en-US,zh-Hant-TW,ar-JO"));
+        mController = new NumberingSystemController(mApplicationContext, "key");
+
+        int result = mController.getAvailabilityStatus();
+
+        assertEquals(AVAILABLE, result);
+    }
+}
diff --git a/tests/unit/src/com/android/settings/regionalpreferences/NumberingSystemItemControllerTest.java b/tests/unit/src/com/android/settings/regionalpreferences/NumberingSystemItemControllerTest.java
index 0d9a334..5ec33db 100644
--- a/tests/unit/src/com/android/settings/regionalpreferences/NumberingSystemItemControllerTest.java
+++ b/tests/unit/src/com/android/settings/regionalpreferences/NumberingSystemItemControllerTest.java
@@ -111,8 +111,8 @@
 
     @Test
     @UiThreadTest
-    public void displayPreference_languageOptAndHas2Locale_show2Options() {
-        LocaleList.setDefault(LocaleList.forLanguageTags("en-US, zh-TW"));
+    public void displayPreference_languageOptAndHas2LocaleWithSingleNu_showNothing() {
+        LocaleList.setDefault(LocaleList.forLanguageTags("en-US,zh-TW"));
         Bundle bundle = new Bundle();
         bundle.putString(RegionalPreferencesEntriesFragment.ARG_KEY_REGIONAL_PREFERENCE,
                 NumberingSystemItemController.ARG_VALUE_LANGUAGE_SELECT);
@@ -123,13 +123,31 @@
 
         mController.displayPreference(mPreferenceScreen);
 
-        assertEquals(LocaleList.getDefault().size(), mPreferenceScreen.getPreferenceCount());
+        assertEquals(0, mPreferenceScreen.getPreferenceCount());
+    }
+
+    @Test
+    @UiThreadTest
+    public void displayPreference_languageOptAndHas2LocaleWithMultiNu_showLocaleWithMultiNuOnly() {
+        // ar-JO and dz-BT have multiple numbering systems.
+        LocaleList.setDefault(LocaleList.forLanguageTags("en-US,zh-TW,ar-JO,dz-BT"));
+        Bundle bundle = new Bundle();
+        bundle.putString(RegionalPreferencesEntriesFragment.ARG_KEY_REGIONAL_PREFERENCE,
+                NumberingSystemItemController.ARG_VALUE_LANGUAGE_SELECT);
+        bundle.putString(
+                NumberingSystemItemController.KEY_SELECTED_LANGUAGE, Locale.US.toLanguageTag());
+        mController = new NumberingSystemItemController(mApplicationContext, bundle);
+        mController.setParentFragment(mFragment);
+
+        mController.displayPreference(mPreferenceScreen);
+
+        assertEquals(2, mPreferenceScreen.getPreferenceCount());
     }
 
     @Test
     @UiThreadTest
     public void displayPreference_enUsNumbersOpt_show1Option() {
-        LocaleList.setDefault(LocaleList.forLanguageTags("en-US, zh-TW"));
+        LocaleList.setDefault(LocaleList.forLanguageTags("en-US,zh-TW"));
         Bundle bundle = new Bundle();
         bundle.putString(RegionalPreferencesEntriesFragment.ARG_KEY_REGIONAL_PREFERENCE,
                 NumberingSystemItemController.ARG_VALUE_NUMBERING_SYSTEM_SELECT);