diff --git a/res/layout/accessibility_text_reading_preview_mail_content.xml b/res/layout/accessibility_text_reading_preview_mail_content.xml
new file mode 100644
index 0000000..7b50ac1
--- /dev/null
+++ b/res/layout/accessibility_text_reading_preview_mail_content.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/subject"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/accessibility_text_reading_preview_mail_subject"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
+
+    <TextView
+        android:id="@+id/from"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingBottom="16dp"
+        android:paddingTop="11dp"
+        android:text="@string/accessibility_text_reading_preview_mail_from"
+        android:textColor="?android:attr/textColorSecondary" />
+
+    <TextView
+        android:id="@+id/content"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/accessibility_text_reading_preview_mail_content"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
+</LinearLayout>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 9f0af97..4c515ad 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -1596,4 +1596,15 @@
         <item>2</item>
         <item>4</item>
     </string-array>
+
+    <!-- All the preference when the open app supports TapPay -->
+    <string-array name="nfc_payment_favor">
+        <item>Always</item>
+        <item>Except when another payment app is open</item>
+    </string-array>
+    <!-- All the values of the preference when the open app supports TapPay -->
+    <string-array name="nfc_payment_favor_values">
+        <item>0</item>
+        <item>1</item>
+    </string-array>
 </resources>
diff --git a/res/values/config.xml b/res/values/config.xml
index 7a2f641..ec239a2 100755
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -573,4 +573,14 @@
 
     <!-- Whether to give option to add restricted profiles -->
     <bool name="config_offer_restricted_profiles">false</bool>
+
+    <!-- An array of packages for which Applications whose per-app locale cannot be changed. -->
+    <string-array name="config_disallowed_app_localeChange_packages" translatable="false">
+        <!--
+        <item>com.example.package.first</item>
+        <item>com.example.package.second</item>
+        <item>...</item>
+        -->
+    </string-array>
+
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ec72321..c62974a 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5216,6 +5216,12 @@
     <string name="accessibility_introduction_title">About <xliff:g id="service" example="Select to Speak">%1$s</xliff:g></string>
     <!-- Title for the accessibility preference to adjust the display size, font size, bold text, and high contrast text features. [CHAR LIMIT=NONE] -->
     <string name="accessibility_text_reading_options_title">Text and reading options</string>
+    <!-- Subject for the mail content of the accessibility text reading preview. [CHAR LIMIT=NONE] -->
+    <string name="accessibility_text_reading_preview_mail_subject">Email: Plans for time machine, v2</string>
+    <!-- Message for the mail content of the accessibility text reading preview. [CHAR LIMIT=NONE] -->
+    <string name="accessibility_text_reading_preview_mail_from">From: bill@email.com</string>
+    <!-- Content for the mail content of the accessibility text reading preview. [CHAR LIMIT=NONE] -->
+    <string name="accessibility_text_reading_preview_mail_content">Good morning! Following up on our last conversation, I’d like to check in on the progress of your time machine development plan. Will you be able to have a prototype ready to demo at E3 this year?</string>
     <!-- Title for the footer text to explain what option accessibility service does. [CHAR LIMIT=35] -->
     <string name="accessibility_screen_option">Options</string>
     <!-- Summary for the accessibility preference to enable screen magnification. [CHAR LIMIT=25] -->
@@ -5481,6 +5487,8 @@
     <string name="accessibility_service_primary_open_title">Open <xliff:g id="accessibility_app_name" example="TalkBack">%1$s</xliff:g></string>
     <!-- Used in the accessibility service settings to show quick settings tooltips. [CHAR LIMIT=NONE] -->
     <string name="accessibility_service_quick_settings_tooltips_content">Swipe down to quickly turn <xliff:g id="accessibility_app_name" example="TalkBack">%1$s</xliff:g> on or off in quick settings</string>
+    <!-- Used in the accessibility action for accessibility quick settings tooltips to dismiss. [CHAR LIMIT=NONE] -->
+    <string name="accessibility_quick_settings_tooltips_dismiss">Dismiss</string>
     <!-- Used in the Color correction settings screen to control turning on/off the feature entirely [CHAR LIMIT=60] -->
     <string name="accessibility_daltonizer_primary_switch_title">Use color correction</string>
     <!-- Title for accessibility shortcut preference for color correction. [CHAR LIMIT=60] -->
@@ -7596,7 +7604,25 @@
     <string name="user_copy_apps_menu_title">Install available apps</string>
 
     <!-- NFC payment settings --><skip/>
+    <!-- Title for NFC payment settings page [CHAR LIMIT=40] -->
     <string name="nfc_payment_settings_title">Contactless payments</string>
+    <!-- Title for NFC default payment settings page [CHAR LIMIT=40] -->
+    <string name="nfc_default_payment_settings_title">Default payment app</string>
+    <!-- Text string explaining how Tap and Pay works [CHAR LIMIT=100] -->
+    <string name="nfc_default_payment_footer">To make a payment using a payment app, hold the back of your device to a payment terminal</string>
+    <!-- Text string linking to a page explaining how Tap and Pay works [CHAR LIMIT=40] -->
+    <string name="nfc_more_details">Learn more</string>
+
+    <!-- Strings shown in a dialog when a user tries to set a work app as a nfc default payment app --><skip/>
+    <!-- Title for the dialog [CHAR LIMIT=40] -->
+    <string name="nfc_default_payment_workapp_confirmation_title">Set work app as default payment app?</string>
+    <!-- Header text for the dialog [CHAR LIMIT=40] -->
+    <string name="nfc_default_payment_workapp_confirmation_message_title">To make a payment using a work app:</string>
+    <!-- Text string in the dialog [CHAR LIMIT=60] -->
+    <string name="nfc_default_payment_workapp_confirmation_message_1">work profile must be turned on.</string>
+    <!-- Text string in the dialog [CHAR LIMIT=60] -->
+    <string name="nfc_default_payment_workapp_confirmation_message_2">you\u2019ll need to enter your work profile lock if you have one.</string>
+
     <!-- Caption for button linking to a page explaining how Tap and Pay works-->
     <string name="nfc_payment_how_it_works">How it works</string>
     <!-- String shown when there are no NFC payment applications installed -->
@@ -7608,7 +7634,9 @@
     <!-- String indicating the label of the default payment app and a description of its state; eg Google Wallet - MasterCard 1234 -->
     <string name="nfc_payment_app_and_desc"><xliff:g id="app">%1$s</xliff:g> - <xliff:g id="description">%2$s</xliff:g></string>
     <!-- Header for what to do when the open app supports TapPay: use the default set app, or the open app -->
-    <string name="nfc_payment_use_default">Use default</string>
+    <string name="nfc_payment_use_default">Use default payment app</string>
+    <!-- Header for a dialog asking what to do when the open app supports TapPay [CHAR LIMIT=40] -->
+    <string name="nfc_payment_use_default_dialog">Use default payment app</string>
     <!-- Always use the default app (independent of what app is open) -->
     <string name="nfc_payment_favor_default">Always</string>
     <!-- If open app supports TapPay, use that app instead of the default -->
diff --git a/res/xml/nfc_default_payment_settings.xml b/res/xml/nfc_default_payment_settings.xml
new file mode 100644
index 0000000..d9978cd
--- /dev/null
+++ b/res/xml/nfc_default_payment_settings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:title="@string/nfc_default_payment_settings_title"/>
diff --git a/res/xml/nfc_payment_settings.xml b/res/xml/nfc_payment_settings.xml
index 8e55a39..d748a1c 100644
--- a/res/xml/nfc_payment_settings.xml
+++ b/res/xml/nfc_payment_settings.xml
@@ -19,16 +19,17 @@
     xmlns:settings="http://schemas.android.com/apk/res-auto"
     android:title="@string/nfc_payment_settings_title">
 
-    <com.android.settings.nfc.NfcPaymentPreference
-        android:key="nfc_payment"
-        android:title="@string/nfc_payment_default"
-        android:dialogTitle="@string/nfc_payment_pay_with"
-        android:widgetLayout="@layout/preference_widget_gear"
-        settings:controller="com.android.settings.nfc.NfcPaymentPreferenceController"/>
+    <com.android.settings.widget.GearPreference
+        android:key="nfc_payment_app"
+        android:title="@string/nfc_default_payment_settings_title"
+        android:fragment="com.android.settings.nfc.DefaultPaymentSettings"/>
 
-    <DropDownPreference
+    <ListPreference
         android:key="nfc_foreground"
         android:title="@string/nfc_payment_use_default"
-        settings:controller="com.android.settings.nfc.NfcForegroundPreferenceController"/>
+        android:dialogTitle="@string/nfc_payment_use_default_dialog"
+        settings:controller="com.android.settings.nfc.NfcForegroundPreferenceController"
+        android:entries="@array/nfc_payment_favor"
+        android:entryValues="@array/nfc_payment_favor_values" />
 
 </PreferenceScreen>
diff --git a/src/com/android/settings/accessibility/AccessibilityQuickSettingsTooltipWindow.java b/src/com/android/settings/accessibility/AccessibilityQuickSettingsTooltipWindow.java
index a4986a0..f24934f 100644
--- a/src/com/android/settings/accessibility/AccessibilityQuickSettingsTooltipWindow.java
+++ b/src/com/android/settings/accessibility/AccessibilityQuickSettingsTooltipWindow.java
@@ -19,10 +19,14 @@
 import android.content.Context;
 import android.content.res.Resources;
 import android.graphics.drawable.ColorDrawable;
+import android.os.Bundle;
 import android.os.Handler;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.View.AccessibilityDelegate;
+import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
 import android.widget.LinearLayout;
 import android.widget.PopupWindow;
 import android.widget.TextView;
@@ -49,6 +53,25 @@
         this.mContext = context;
     }
 
+    private final AccessibilityDelegate mAccessibilityDelegate = new AccessibilityDelegate() {
+            @Override
+            public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
+                super.onInitializeAccessibilityNodeInfo(host, info);
+                final AccessibilityAction clickAction = new AccessibilityAction(
+                        AccessibilityNodeInfo.ACTION_CLICK,
+                        mContext.getString(R.string.accessibility_quick_settings_tooltips_dismiss));
+                info.addAction(clickAction);
+            }
+
+            @Override
+            public boolean performAccessibilityAction(View host, int action, Bundle args) {
+                if (action == AccessibilityNodeInfo.ACTION_CLICK) {
+                    dismiss();
+                    return true;
+                }
+                return super.performAccessibilityAction(host, action, args);
+            }
+        };
     /**
      * Sets up {@link #AccessibilityQuickSettingsTooltipWindow}'s layout and content.
      *
@@ -74,13 +97,16 @@
         final LayoutInflater inflater = mContext.getSystemService(LayoutInflater.class);
         final View popupView =
                 inflater.inflate(R.layout.accessibility_qs_tooltips, /* root= */ null);
+        popupView.setFocusable(/* focusable= */ true);
+        popupView.setAccessibilityDelegate(mAccessibilityDelegate);
         setContentView(popupView);
+
         final TextView textView = getContentView().findViewById(R.id.qs_content);
         textView.setText(text);
-
         setWidth(getWindowWidthWith(textView));
         setHeight(LinearLayout.LayoutParams.WRAP_CONTENT);
         setFocusable(/* focusable= */ true);
+        setOutsideTouchable(/* touchable= */ true);
     }
 
     /**
diff --git a/src/com/android/settings/applications/AppLocaleUtil.java b/src/com/android/settings/applications/AppLocaleUtil.java
new file mode 100644
index 0000000..e795b01
--- /dev/null
+++ b/src/com/android/settings/applications/AppLocaleUtil.java
@@ -0,0 +1,68 @@
+/*
+ * 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.applications;
+
+import android.app.ActivityManager;
+import android.content.Context;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.util.Log;
+
+import com.android.settings.R;
+import com.android.settingslib.applications.ApplicationsState.AppEntry;
+
+/** This class provides methods that help dealing with per app locale. */
+public class AppLocaleUtil {
+    private static final String TAG = AppLocaleUtil.class.getSimpleName();
+
+    /**
+     * Decides the UI display of per app locale.
+     */
+    public static boolean canDisplayLocaleUi(Context context, AppEntry app) {
+        return !isDisallowedPackage(context, app.info.packageName)
+                && !isSignedWithPlatformKey(context, app.info.packageName)
+                && app.hasLauncherEntry;
+    }
+
+    private static boolean isDisallowedPackage(Context context, String packageName) {
+        final String[] disallowedPackages = context.getResources().getStringArray(
+                R.array.config_disallowed_app_localeChange_packages);
+        for (String disallowedPackage : disallowedPackages) {
+            if (packageName.equals(disallowedPackage)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private static boolean isSignedWithPlatformKey(Context context, String packageName) {
+        PackageInfo packageInfo = null;
+        PackageManager packageManager = context.getPackageManager();
+        ActivityManager activityManager = context.getSystemService(ActivityManager.class);
+        try {
+            packageInfo = packageManager.getPackageInfoAsUser(
+                    packageName, /* flags= */ 0,
+                    activityManager.getCurrentUser());
+        } catch (PackageManager.NameNotFoundException ex) {
+            Log.e(TAG, "package not found: " + packageName);
+        }
+        if (packageInfo == null) {
+            return false;
+        }
+        return packageInfo.applicationInfo.isSignedWithPlatformKey();
+    }
+}
diff --git a/src/com/android/settings/applications/AppStateLocaleBridge.java b/src/com/android/settings/applications/AppStateLocaleBridge.java
new file mode 100644
index 0000000..ebaf4ab
--- /dev/null
+++ b/src/com/android/settings/applications/AppStateLocaleBridge.java
@@ -0,0 +1,77 @@
+/*
+ * 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.applications;
+
+import android.content.Context;
+import android.util.Log;
+
+import com.android.settingslib.applications.ApplicationsState;
+import com.android.settingslib.applications.ApplicationsState.AppEntry;
+import com.android.settingslib.applications.ApplicationsState.AppFilter;
+
+import java.util.List;
+
+/**
+ * Creates a application filter to restrict UI display of applications.
+ * This is to avoid users from changing the per apps locale
+ * Also provides app filters that can use the info.
+ */
+public class AppStateLocaleBridge extends AppStateBaseBridge {
+    private static final String TAG = AppStateLocaleBridge.class.getSimpleName();
+
+    private final Context mContext;
+
+    public AppStateLocaleBridge(Context context, ApplicationsState appState,
+            Callback callback) {
+        super(appState, callback);
+        mContext = context;
+    }
+
+    @Override
+    protected void updateExtraInfo(AppEntry app, String packageName, int uid) {
+        app.extraInfo = AppLocaleUtil.canDisplayLocaleUi(mContext, app)
+                ? Boolean.TRUE : Boolean.FALSE;
+    }
+
+    @Override
+    protected void loadAllExtraInfo() {
+        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)
+                    ? Boolean.TRUE : Boolean.FALSE;
+        }
+    }
+
+    /** For the Settings which shows category of per app's locale. */
+    public static final AppFilter FILTER_APPS_LOCALE =
+            new AppFilter() {
+                @Override
+                public void init() {
+                }
+
+                @Override
+                public boolean filterApp(AppEntry entry) {
+                    if (entry.extraInfo == null) {
+                        Log.d(TAG, "No extra info.");
+                        return false;
+                    }
+                    return (Boolean) entry.extraInfo;
+                }
+            };
+
+
+}
diff --git a/src/com/android/settings/applications/appinfo/AppLocaleDetails.java b/src/com/android/settings/applications/appinfo/AppLocaleDetails.java
index 7fd43c2..aee360e 100644
--- a/src/com/android/settings/applications/appinfo/AppLocaleDetails.java
+++ b/src/com/android/settings/applications/appinfo/AppLocaleDetails.java
@@ -37,6 +37,8 @@
 import androidx.preference.Preference;
 import androidx.preference.PreferenceGroup;
 
+import com.android.internal.app.LocalePicker;
+import com.android.internal.app.LocalePicker.LocaleInfo;
 import com.android.settings.R;
 import com.android.settings.Utils;
 import com.android.settings.applications.AppInfoBase;
@@ -45,8 +47,11 @@
 import com.android.settingslib.widget.LayoutPreference;
 import com.android.settingslib.widget.RadioButtonPreference;
 
+import com.google.common.collect.Iterables;
+
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 import java.util.Locale;
 
 /**
@@ -200,8 +205,8 @@
         private TelephonyManager mTelephonyManager;
         private LocaleManager mLocaleManager;
 
-        private Collection<Locale> mSuggestedLocales = new ArrayList<>();;
-        private Collection<Locale> mSupportedLocales = new ArrayList<>();;
+        private Collection<Locale> mSuggestedLocales = new ArrayList<>();
+        private Collection<Locale> mSupportedLocales = new ArrayList<>();
 
         AppLocaleDetailsHelper(Context context, String packageName) {
             mContext = context;
@@ -230,25 +235,41 @@
         @VisibleForTesting
         void handleSuggestedLocales() {
             LocaleList currentSystemLocales = getCurrentSystemLocales();
-            Locale simLocale = mTelephonyManager.getSimLocale();
             Locale appLocale = getAppDefaultLocale(mContext, mPackageName);
+            String simCountry = mTelephonyManager.getSimCountryIso().toUpperCase(Locale.US);
+            String networkCountry = mTelephonyManager.getNetworkCountryIso().toUpperCase(Locale.US);
             // 1st locale in suggested languages group.
             if (appLocale != null) {
                 mSuggestedLocales.add(appLocale);
             }
             // 2nd locale in suggested languages group.
-            if (simLocale != null && !compareLocale(simLocale, appLocale)) {
-                mSuggestedLocales.add(simLocale);
+            final List<LocaleInfo> localeInfos = LocalePicker.getAllAssetLocales(mContext, false);
+            for (LocaleInfo localeInfo : localeInfos) {
+                Locale locale = localeInfo.getLocale();
+                String localeCountry = locale.getCountry().toUpperCase(Locale.US);
+                if (!compareLocale(locale, appLocale)
+                        && isCountrySuggestedLocale(localeCountry, simCountry, networkCountry)) {
+                    mSuggestedLocales.add(locale);
+                }
             }
             // Other locales in suggested languages group.
             for (int i = 0; i < currentSystemLocales.size(); i++) {
                 Locale locale = currentSystemLocales.get(i);
-                if (!compareLocale(locale, appLocale) && !compareLocale(locale, simLocale)) {
+                boolean isInSuggestedLocales = false;
+                for (int j = 0; j < mSuggestedLocales.size(); j++) {
+                    Locale suggestedLocale = Iterables.get(mSuggestedLocales, j);
+                    if (compareLocale(locale, suggestedLocale)) {
+                        isInSuggestedLocales = true;
+                        break;
+                    }
+                }
+                if (!isInSuggestedLocales) {
                     mSuggestedLocales.add(locale);
                 }
             }
         }
 
+        @VisibleForTesting
         static boolean compareLocale(Locale source, Locale target) {
             if (source == null && target == null) {
                 return true;
@@ -259,6 +280,13 @@
             }
         }
 
+        private static boolean isCountrySuggestedLocale(String localeCountry,
+                String simCountry,
+                String networkCountry) {
+            return ((!simCountry.isEmpty() && simCountry.equals(localeCountry))
+                    || (!networkCountry.isEmpty() && networkCountry.equals(localeCountry)));
+        }
+
         @VisibleForTesting
         void handleSupportedLocales() {
             //TODO Waiting for PackageManager api
diff --git a/src/com/android/settings/applications/appinfo/AppLocalePreferenceController.java b/src/com/android/settings/applications/appinfo/AppLocalePreferenceController.java
index f1e43ad..810d230 100644
--- a/src/com/android/settings/applications/appinfo/AppLocalePreferenceController.java
+++ b/src/com/android/settings/applications/appinfo/AppLocalePreferenceController.java
@@ -20,20 +20,23 @@
 import android.util.FeatureFlagUtils;
 
 import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.applications.AppLocaleUtil;
 
 /**
  * A controller to update current locale information of application.
  */
 public class AppLocalePreferenceController extends AppInfoPreferenceControllerBase {
+    private static final String TAG = AppLocalePreferenceController.class.getSimpleName();
+
     public AppLocalePreferenceController(Context context, String key) {
         super(context, key);
     }
 
     @Override
     public int getAvailabilityStatus() {
-        return FeatureFlagUtils
-                .isEnabled(mContext, FeatureFlagUtils.SETTINGS_APP_LANGUAGE_SELECTION)
-                ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
+        boolean isFeatureOn = FeatureFlagUtils
+                .isEnabled(mContext, FeatureFlagUtils.SETTINGS_APP_LANGUAGE_SELECTION);
+        return isFeatureOn && canDisplayLocaleUi() ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
     }
 
     @Override
@@ -45,4 +48,8 @@
     public CharSequence getSummary() {
         return AppLocaleDetails.getSummary(mContext, mParent.getAppEntry().info.packageName);
     }
+
+    boolean canDisplayLocaleUi() {
+        return AppLocaleUtil.canDisplayLocaleUi(mContext, mParent.getAppEntry());
+    }
 }
diff --git a/src/com/android/settings/applications/manageapplications/AppFilterRegistry.java b/src/com/android/settings/applications/manageapplications/AppFilterRegistry.java
index d1d4f62..6e67815 100644
--- a/src/com/android/settings/applications/manageapplications/AppFilterRegistry.java
+++ b/src/com/android/settings/applications/manageapplications/AppFilterRegistry.java
@@ -21,6 +21,7 @@
 import com.android.settings.R;
 import com.android.settings.applications.AppStateAlarmsAndRemindersBridge;
 import com.android.settings.applications.AppStateInstallAppsBridge;
+import com.android.settings.applications.AppStateLocaleBridge;
 import com.android.settings.applications.AppStateManageExternalStorageBridge;
 import com.android.settings.applications.AppStateMediaManagementAppsBridge;
 import com.android.settings.applications.AppStateNotificationBridge;
@@ -54,6 +55,7 @@
             FILTER_APPS_BLOCKED,
             FILTER_ALARMS_AND_REMINDERS,
             FILTER_APPS_MEDIA_MANAGEMENT,
+            FILTER_APPS_LOCALE,
     })
     @interface FilterType {
     }
@@ -79,14 +81,15 @@
     public static final int FILTER_MANAGE_EXTERNAL_STORAGE = 17;
     public static final int FILTER_ALARMS_AND_REMINDERS = 18;
     public static final int FILTER_APPS_MEDIA_MANAGEMENT = 19;
-    // Next id: 20. If you add an entry here, length of mFilters should be updated
+    public static final int FILTER_APPS_LOCALE = 20;
+    // Next id: 21. If you add an entry here, length of mFilters should be updated
 
     private static AppFilterRegistry sRegistry;
 
     private final AppFilterItem[] mFilters;
 
     private AppFilterRegistry() {
-        mFilters = new AppFilterItem[20];
+        mFilters = new AppFilterItem[21];
 
         // High power allowlist, on
         mFilters[FILTER_APPS_POWER_ALLOWLIST] = new AppFilterItem(
@@ -203,8 +206,16 @@
                 AppStateMediaManagementAppsBridge.FILTER_MEDIA_MANAGEMENT_APPS,
                 FILTER_APPS_MEDIA_MANAGEMENT,
                 R.string.media_management_apps_title);
+
+        // Apps that can configurate appication's locale.
+        mFilters[FILTER_APPS_LOCALE] = new AppFilterItem(
+                AppStateLocaleBridge.FILTER_APPS_LOCALE,
+            FILTER_APPS_LOCALE,
+                R.string.app_locale_picker_title);
     }
 
+
+
     public static AppFilterRegistry getInstance() {
         if (sRegistry == null) {
             sRegistry = new AppFilterRegistry();
@@ -235,6 +246,8 @@
                 return FILTER_ALARMS_AND_REMINDERS;
             case ManageApplications.LIST_TYPE_MEDIA_MANAGEMENT_APPS:
                 return FILTER_APPS_MEDIA_MANAGEMENT;
+            case ManageApplications.LIST_TYPE_APPS_LOCALE:
+                return FILTER_APPS_LOCALE;
             default:
                 return FILTER_APPS_ALL;
         }
diff --git a/src/com/android/settings/applications/manageapplications/ManageApplications.java b/src/com/android/settings/applications/manageapplications/ManageApplications.java
index d985482..01bc2f1 100644
--- a/src/com/android/settings/applications/manageapplications/ManageApplications.java
+++ b/src/com/android/settings/applications/manageapplications/ManageApplications.java
@@ -95,6 +95,7 @@
 import com.android.settings.applications.AppStateAppOpsBridge.PermissionState;
 import com.android.settings.applications.AppStateBaseBridge;
 import com.android.settings.applications.AppStateInstallAppsBridge;
+import com.android.settings.applications.AppStateLocaleBridge;
 import com.android.settings.applications.AppStateManageExternalStorageBridge;
 import com.android.settings.applications.AppStateMediaManagementAppsBridge;
 import com.android.settings.applications.AppStateNotificationBridge;
@@ -232,7 +233,7 @@
     public static final int LIST_MANAGE_EXTERNAL_STORAGE = 11;
     public static final int LIST_TYPE_ALARMS_AND_REMINDERS = 12;
     public static final int LIST_TYPE_MEDIA_MANAGEMENT_APPS = 13;
-    public static final int LIST_TYPE_APPS_LOCAL = 14;
+    public static final int LIST_TYPE_APPS_LOCALE = 14;
 
     // List types that should show instant apps.
     public static final Set<Integer> LIST_TYPES_WITH_INSTANT = new ArraySet<>(Arrays.asList(
@@ -321,7 +322,7 @@
             mNotificationBackend = new NotificationBackend();
             mSortOrder = R.id.sort_order_recent_notification;
         } else if (className.equals(AppLocaleDetails.class.getName())) {
-            mListType = LIST_TYPE_APPS_LOCAL;
+            mListType = LIST_TYPE_APPS_LOCALE;
         } else {
             mListType = LIST_TYPE_MAIN;
         }
@@ -504,7 +505,7 @@
                 return SettingsEnums.ALARMS_AND_REMINDERS;
             case LIST_TYPE_MEDIA_MANAGEMENT_APPS:
                 return SettingsEnums.MEDIA_MANAGEMENT_APPS;
-            case LIST_TYPE_APPS_LOCAL:
+            case LIST_TYPE_APPS_LOCALE:
                 return SettingsEnums.APPS_LOCALE_LIST;
             default:
                 return SettingsEnums.PAGE_UNKNOWN;
@@ -629,7 +630,7 @@
                 startAppInfoFragment(MediaManagementAppsDetails.class,
                         R.string.media_management_apps_title);
                 break;
-            case LIST_TYPE_APPS_LOCAL:
+            case LIST_TYPE_APPS_LOCALE:
                 startAppInfoFragment(AppLocaleDetails.class,
                         R.string.app_locale_picker_title);
                 break;
@@ -743,9 +744,9 @@
                 && mSortOrder != R.id.sort_order_size);
 
         mOptionsMenu.findItem(R.id.show_system).setVisible(!mShowSystem
-                && mListType != LIST_TYPE_HIGH_POWER);
+                && mListType != LIST_TYPE_HIGH_POWER && mListType != LIST_TYPE_APPS_LOCALE);
         mOptionsMenu.findItem(R.id.hide_system).setVisible(mShowSystem
-                && mListType != LIST_TYPE_HIGH_POWER);
+                && mListType != LIST_TYPE_HIGH_POWER && mListType != LIST_TYPE_APPS_LOCALE);
 
         mOptionsMenu.findItem(R.id.reset_app_preferences).setVisible(mListType == LIST_TYPE_MAIN);
 
@@ -1100,6 +1101,8 @@
                 mExtraInfoBridge = new AppStateAlarmsAndRemindersBridge(mContext, mState, this);
             } 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);
             } else {
                 mExtraInfoBridge = null;
             }
@@ -1533,7 +1536,7 @@
                 case LIST_TYPE_MEDIA_MANAGEMENT_APPS:
                     holder.setSummary(MediaManagementAppsDetails.getSummary(mContext, entry));
                     break;
-                case LIST_TYPE_APPS_LOCAL:
+                case LIST_TYPE_APPS_LOCALE:
                     holder.setSummary(AppLocaleDetails
                             .getSummary(mContext, entry.info.packageName));
                     break;
diff --git a/src/com/android/settings/connecteddevice/NfcAndPaymentFragment.java b/src/com/android/settings/connecteddevice/NfcAndPaymentFragment.java
index 4ebc0cd..feb757f 100644
--- a/src/com/android/settings/connecteddevice/NfcAndPaymentFragment.java
+++ b/src/com/android/settings/connecteddevice/NfcAndPaymentFragment.java
@@ -17,6 +17,12 @@
 package com.android.settings.connecteddevice;
 
 import android.app.settings.SettingsEnums;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.content.pm.UserInfo;
+import android.os.UserHandle;
+import android.os.UserManager;
+
 
 import com.android.settings.R;
 import com.android.settings.dashboard.DashboardFragment;
@@ -54,5 +60,16 @@
      * For Search.
      */
     public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
-            new BaseSearchIndexProvider(R.xml.nfc_and_payment_settings);
+            new BaseSearchIndexProvider(R.xml.nfc_and_payment_settings) {
+            @Override
+                protected boolean isPageSearchEnabled(Context context) {
+                    final UserManager userManager = context.getSystemService(UserManager.class);
+                    final UserInfo myUserInfo = userManager.getUserInfo(UserHandle.myUserId());
+                    if (myUserInfo.isGuest()) {
+                        return false;
+                    }
+                    final PackageManager pm = context.getPackageManager();
+                    return pm.hasSystemFeature(PackageManager.FEATURE_NFC);
+                }
+            };
 }
diff --git a/src/com/android/settings/nfc/DefaultPaymentSettings.java b/src/com/android/settings/nfc/DefaultPaymentSettings.java
new file mode 100644
index 0000000..4dceefc
--- /dev/null
+++ b/src/com/android/settings/nfc/DefaultPaymentSettings.java
@@ -0,0 +1,278 @@
+/*
+ * 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.nfc;
+
+import android.app.settings.SettingsEnums;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.drawable.Drawable;
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.text.Layout;
+import android.text.SpannableString;
+import android.text.Spanned;
+import android.text.TextUtils;
+import android.text.style.AlignmentSpan;
+import android.text.style.BulletSpan;
+import android.text.style.ClickableSpan;
+import android.text.style.RelativeSizeSpan;
+import android.view.View;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.VisibleForTesting;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.R;
+import com.android.settings.applications.defaultapps.DefaultAppPickerFragment;
+import com.android.settings.nfc.PaymentBackend.PaymentAppInfo;
+import com.android.settingslib.widget.CandidateInfo;
+import com.android.settingslib.widget.FooterPreference;
+import com.android.settingslib.widget.SelectorWithWidgetPreference;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * DefaultPaymentSettings handles the NFC default payment app selection.
+ */
+public class DefaultPaymentSettings extends DefaultAppPickerFragment {
+    public static final String TAG = "DefaultPaymentSettings";
+
+    private PaymentBackend mPaymentBackend;
+    private List<PaymentAppInfo> mAppInfos;
+    private Preference mFooterPreference;
+
+    @Override
+    public int getMetricsCategory() {
+        return SettingsEnums.NFC_PAYMENT;
+    }
+
+    @Override
+    protected int getPreferenceScreenResId() {
+        return R.xml.nfc_default_payment_settings;
+    }
+
+    @Override
+    protected String getDefaultKey() {
+        PaymentAppInfo defaultAppInfo = mPaymentBackend.getDefaultApp();
+        if (defaultAppInfo != null) {
+            return defaultAppInfo.componentName.flattenToString() + " "
+                    + defaultAppInfo.userHandle.getIdentifier();
+        }
+        return null;
+    }
+
+    @Override
+    protected boolean setDefaultKey(String key) {
+        String[] keys = key.split(" ");
+        if (keys.length >= 2) {
+            mPaymentBackend.setDefaultPaymentApp(ComponentName.unflattenFromString(keys[0]),
+                    Integer.parseInt(keys[1]));
+        }
+        return true;
+    }
+
+    @Override
+    public void onAttach(Context context) {
+        super.onAttach(context);
+        mPaymentBackend = new PaymentBackend(getActivity());
+        mAppInfos = mPaymentBackend.getPaymentAppInfos();
+    }
+
+    @Override
+    protected void addStaticPreferences(PreferenceScreen screen) {
+        if (mFooterPreference == null) {
+            setupFooterPreference();
+        }
+        screen.addPreference(mFooterPreference);
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        mPaymentBackend.onResume();
+    }
+
+    @Override
+    public void onPause() {
+        super.onPause();
+        mPaymentBackend.onPause();
+    }
+
+    /**
+     * Comparator for NfcPaymentCandidateInfo.
+     */
+    public class NfcPaymentCandidateInfoComparator implements Comparator<NfcPaymentCandidateInfo> {
+        /**
+         * Compare the NfcPaymentCandidateInfo by the label string.
+         */
+        public int compare(NfcPaymentCandidateInfo obj1, NfcPaymentCandidateInfo obj2) {
+            if (obj1.loadLabel() == obj2.loadLabel()) {
+                return 0;
+            }
+            if (obj1.loadLabel() == null) {
+                return -1;
+            }
+            if (obj2.loadLabel() == null) {
+                return 1;
+            }
+            return obj1.loadLabel().toString().compareTo(obj2.loadLabel().toString());
+        }
+    }
+
+    @Override
+    public void bindPreferenceExtra(SelectorWithWidgetPreference pref, String key,
+            CandidateInfo info, String defaultKey, String systemDefaultKey) {
+        final NfcPaymentCandidateInfo candidateInfo = (NfcPaymentCandidateInfo) info;
+        if (candidateInfo.isManagedProfile()) {
+            pref.setSummary("Work");
+        }
+    }
+
+    @Override
+    protected List<? extends CandidateInfo> getCandidates() {
+        final List<NfcPaymentCandidateInfo> candidates = new ArrayList<>();
+        for (PaymentAppInfo appInfo: mAppInfos) {
+            UserManager um = getContext().createContextAsUser(
+                    appInfo.userHandle, /*flags=*/0).getSystemService(UserManager.class);
+            boolean isManagedProfile = um.isManagedProfile(appInfo.userHandle.getIdentifier());
+
+            CharSequence label;
+            label = appInfo.label;
+            candidates.add(new NfcPaymentCandidateInfo(
+                    appInfo.componentName.flattenToString(),
+                    label,
+                    appInfo.icon,
+                    appInfo.userHandle.getIdentifier(),
+                    isManagedProfile));
+        }
+        Collections.sort(candidates, new NfcPaymentCandidateInfoComparator());
+        return candidates;
+    }
+
+    @VisibleForTesting
+    class NfcPaymentCandidateInfo extends CandidateInfo {
+        private final String mKey;
+        private final CharSequence mLabel;
+        private final Drawable mDrawable;
+        private final int mUserId;
+        private final boolean mIsManagedProfile;
+
+        NfcPaymentCandidateInfo(String key, CharSequence label, Drawable drawable, int userId,
+                boolean isManagedProfile) {
+            super(true /* enabled */);
+            mKey = key;
+            mLabel = label;
+            mDrawable = drawable;
+            mUserId = userId;
+            mIsManagedProfile = isManagedProfile;
+        }
+
+        @Override
+        public CharSequence loadLabel() {
+            return mLabel;
+        }
+
+        @Override
+        public Drawable loadIcon() {
+            return mDrawable;
+        }
+
+        @Override
+        public String getKey() {
+            return mKey + " " + mUserId;
+        }
+
+        public boolean isManagedProfile() {
+            return mIsManagedProfile;
+        }
+    }
+
+    @Override
+    protected CharSequence getConfirmationMessage(CandidateInfo appInfo) {
+        if (appInfo == null) {
+            return null;
+        }
+        NfcPaymentCandidateInfo paymentInfo = (NfcPaymentCandidateInfo) appInfo;
+        UserManager um = getContext().createContextAsUser(UserHandle.of(paymentInfo.mUserId),
+                /*flags=*/0).getSystemService(UserManager.class);
+        boolean isManagedProfile = um.isManagedProfile(paymentInfo.mUserId);
+        if (!isManagedProfile) {
+            return null;
+        }
+
+        final String title = getContext().getString(
+                R.string.nfc_default_payment_workapp_confirmation_title);
+        final String messageTitle = getContext().getString(
+                R.string.nfc_default_payment_workapp_confirmation_message_title);
+        final String messageOne = getContext().getString(
+                R.string.nfc_default_payment_workapp_confirmation_message_1);
+        final String messageTwo = getContext().getString(
+                R.string.nfc_default_payment_workapp_confirmation_message_2);
+        final SpannableString titleString = new SpannableString(title);
+        final SpannableString messageString = new SpannableString(messageTitle);
+        final SpannableString oneString = new SpannableString(messageOne);
+        final SpannableString twoString = new SpannableString(messageTwo);
+
+        titleString.setSpan(new RelativeSizeSpan(1.5f), 0, title.length(),
+                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+        titleString.setSpan(new AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER), 0,
+                title.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+        messageString.setSpan(new AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER), 0,
+                messageTitle.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+        oneString.setSpan(new BulletSpan(20), 0, messageOne.length(),
+                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+        twoString.setSpan(new BulletSpan(20), 0, messageTwo.length(),
+                Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+
+        return TextUtils.concat(titleString, "\n\n", messageString, "\n\n", oneString, "\n",
+                twoString);
+    }
+
+    private void setupFooterPreference() {
+        final String textNfcDefaultPaymentFooter = getResources().getString(
+                R.string.nfc_default_payment_footer);
+        final String textMoreDetails = getResources().getString(R.string.nfc_more_details);
+
+        final SpannableString spannableString = new SpannableString(
+                textNfcDefaultPaymentFooter + System.lineSeparator()
+                + System.lineSeparator() + textMoreDetails);
+        final ClickableSpan clickableSpan = new ClickableSpan() {
+            @Override
+            public void onClick(@NonNull View widget) {
+                Intent howItWorksIntent = new Intent(getActivity(), HowItWorks.class);
+                startActivity(howItWorksIntent);
+            }
+        };
+
+        if (textNfcDefaultPaymentFooter != null && textMoreDetails != null) {
+            spannableString.setSpan(clickableSpan, textNfcDefaultPaymentFooter.length() + 1,
+                    textNfcDefaultPaymentFooter.length() + textMoreDetails.length() + 2,
+                    Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+        }
+
+        mFooterPreference = new FooterPreference(getContext());
+        mFooterPreference.setLayoutResource(R.layout.preference_footer);
+        mFooterPreference.setTitle(spannableString);
+        mFooterPreference.setSelectable(false);
+        mFooterPreference.setIcon(R.drawable.ic_info_outline_24dp);
+    }
+}
diff --git a/src/com/android/settings/nfc/NfcDefaultPaymentPreferenceController.java b/src/com/android/settings/nfc/NfcDefaultPaymentPreferenceController.java
new file mode 100644
index 0000000..6bcacb1
--- /dev/null
+++ b/src/com/android/settings/nfc/NfcDefaultPaymentPreferenceController.java
@@ -0,0 +1,146 @@
+/*
+ * 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.nfc;
+
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.graphics.drawable.Drawable;
+import android.nfc.NfcAdapter;
+
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.applications.defaultapps.DefaultAppPreferenceController;
+import com.android.settings.nfc.PaymentBackend.PaymentAppInfo;
+import com.android.settingslib.applications.DefaultAppInfo;
+import com.android.settingslib.core.lifecycle.Lifecycle;
+import com.android.settingslib.core.lifecycle.LifecycleObserver;
+import com.android.settingslib.core.lifecycle.events.OnPause;
+import com.android.settingslib.core.lifecycle.events.OnResume;
+
+import java.util.List;
+
+/**
+ * NfcDefaultPaymentPreferenceController shows an app icon and text summary for current selected
+ * default payment, and links to the nfc default payment selection page.
+ */
+public class NfcDefaultPaymentPreferenceController extends DefaultAppPreferenceController implements
+        PaymentBackend.Callback, LifecycleObserver, OnResume, OnPause {
+
+    private static final String TAG = "NfcDefaultPaymentController";
+    private static final String KEY = "nfc_payment_app";
+
+    private PaymentBackend mPaymentBackend;
+    private Preference mPreference;
+    private Context mContext;
+
+    public NfcDefaultPaymentPreferenceController(Context context, Lifecycle lifecycle) {
+        super(context);
+        mContext = context;
+        mPaymentBackend = new PaymentBackend(context);
+        if (lifecycle != null) {
+            lifecycle.addObserver(this);
+        }
+    }
+
+    @Override
+    public boolean isAvailable() {
+        final PackageManager pm = mContext.getPackageManager();
+        if (!pm.hasSystemFeature(PackageManager.FEATURE_NFC)) {
+            return false;
+        }
+        if (NfcAdapter.getDefaultAdapter(mContext) == null) {
+            return false;
+        }
+        if (mPaymentBackend == null) {
+            mPaymentBackend = new PaymentBackend(mContext);
+        }
+        final List<PaymentAppInfo> appInfos = mPaymentBackend.getPaymentAppInfos();
+        return (appInfos != null && !appInfos.isEmpty())
+                ? true
+                : false;
+    }
+
+    @Override
+    public String getPreferenceKey() {
+        return KEY;
+    }
+
+    @Override
+    public void onResume() {
+        if (mPaymentBackend != null) {
+            mPaymentBackend.registerCallback(this);
+            mPaymentBackend.onResume();
+        }
+    }
+
+    @Override
+    public void onPause() {
+        if (mPaymentBackend != null) {
+            mPaymentBackend.unregisterCallback(this);
+            mPaymentBackend.onPause();
+        }
+    }
+
+    @Override
+    public void displayPreference(PreferenceScreen screen) {
+        mPreference = screen.findPreference(getPreferenceKey());
+        super.displayPreference(screen);
+    }
+
+    @Override
+    public void updateState(Preference preference) {
+        super.updateState(preference);
+        preference.setIconSpaceReserved(true);
+    }
+
+    @Override
+    public void onPaymentAppsChanged() {
+        updateState(mPreference);
+    }
+
+    /**
+     * PaymentDefaultAppInfo is used to store the default payment app info.
+     */
+    public static class PaymentDefaultAppInfo extends DefaultAppInfo {
+        public PaymentAppInfo mInfo;
+
+        public PaymentDefaultAppInfo(Context context, PackageManager pm, int userId,
+                PaymentAppInfo info) {
+            super(context, pm, userId, info.componentName);
+            mInfo = info;
+        }
+
+        @Override
+        public Drawable loadIcon() {
+            return mInfo.icon;
+        }
+    }
+
+    @Override
+    protected DefaultAppInfo getDefaultAppInfo() {
+        if (mPaymentBackend == null) {
+            return null;
+        }
+        final PaymentAppInfo defaultApp = mPaymentBackend.getDefaultApp();
+        if (defaultApp != null) {
+            return new PaymentDefaultAppInfo(mContext, mPackageManager,
+                    defaultApp.userHandle.getIdentifier(), defaultApp);
+        }
+        return null;
+    }
+}
diff --git a/src/com/android/settings/nfc/NfcForegroundPreferenceController.java b/src/com/android/settings/nfc/NfcForegroundPreferenceController.java
index b02608e..246bdb9 100644
--- a/src/com/android/settings/nfc/NfcForegroundPreferenceController.java
+++ b/src/com/android/settings/nfc/NfcForegroundPreferenceController.java
@@ -16,11 +16,9 @@
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.pm.PackageManager;
-import android.text.TextUtils;
 
-import androidx.preference.DropDownPreference;
+import androidx.preference.ListPreference;
 import androidx.preference.Preference;
-import androidx.preference.PreferenceScreen;
 
 import com.android.settings.R;
 import com.android.settings.core.BasePreferenceController;
@@ -36,13 +34,18 @@
         PaymentBackend.Callback, Preference.OnPreferenceChangeListener,
         LifecycleObserver, OnStart, OnStop {
 
-    private DropDownPreference mPreference;
+    private ListPreference mPreference;
     private PaymentBackend mPaymentBackend;
     private MetricsFeatureProvider mMetricsFeatureProvider;
 
+    private final String[] mListValues;
+    private final String[] mListEntries;
+
     public NfcForegroundPreferenceController(Context context, String key) {
         super(context, key);
         mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
+        mListValues = context.getResources().getStringArray(R.array.nfc_payment_favor_values);
+        mListEntries = context.getResources().getStringArray(R.array.nfc_payment_favor);
     }
 
     public void setPaymentBackend(PaymentBackend backend) {
@@ -79,47 +82,35 @@
     }
 
     @Override
-    public void displayPreference(PreferenceScreen screen) {
-        super.displayPreference(screen);
-        mPreference = screen.findPreference(getPreferenceKey());
-        if (mPreference == null) {
-            return;
-        }
-
-        mPreference.setEntries(new CharSequence[]{
-                mContext.getText(R.string.nfc_payment_favor_open),
-                mContext.getText(R.string.nfc_payment_favor_default)
-        });
-        mPreference.setEntryValues(new CharSequence[]{"1", "0"});
-    }
-
-    @Override
     public void onPaymentAppsChanged() {
         updateState(mPreference);
     }
 
     @Override
     public void updateState(Preference preference) {
-        if (preference instanceof DropDownPreference) {
-            ((DropDownPreference) preference).setValue(
-                    mPaymentBackend.isForegroundMode() ? "1" : "0");
-        }
         super.updateState(preference);
+        if (!(preference instanceof ListPreference)) {
+            return;
+        }
+        final ListPreference listPreference = (ListPreference) preference;
+        listPreference.setIconSpaceReserved(true);
+        listPreference.setValue(mListValues[mPaymentBackend.isForegroundMode() ? 1 : 0]);
     }
 
     @Override
     public CharSequence getSummary() {
-        return mPreference.getEntry();
+        return mListEntries[mPaymentBackend.isForegroundMode() ? 1 : 0];
     }
 
     @Override
     public boolean onPreferenceChange(Preference preference, Object newValue) {
-        if (!(preference instanceof DropDownPreference)) {
+        if (!(preference instanceof ListPreference)) {
             return false;
         }
-        final DropDownPreference pref = (DropDownPreference) preference;
+
+        final ListPreference listPreference = (ListPreference) preference;
         final String newValueString = (String) newValue;
-        pref.setSummary(pref.getEntries()[pref.findIndexOfValue(newValueString)]);
+        listPreference.setSummary(mListEntries[listPreference.findIndexOfValue(newValueString)]);
         final boolean foregroundMode = Integer.parseInt(newValueString) != 0;
         mPaymentBackend.setForegroundMode(foregroundMode);
         mMetricsFeatureProvider.action(mContext,
@@ -127,12 +118,4 @@
                         : SettingsEnums.ACTION_NFC_PAYMENT_ALWAYS_SETTING);
         return true;
     }
-
-    @Override
-    public void updateNonIndexableKeys(List<String> keys) {
-        final String key = getPreferenceKey();
-        if (!TextUtils.isEmpty(key)) {
-            keys.add(key);
-        }
-    }
-}
\ No newline at end of file
+}
diff --git a/src/com/android/settings/nfc/PaymentBackend.java b/src/com/android/settings/nfc/PaymentBackend.java
index 542c95b..0cfed20 100644
--- a/src/com/android/settings/nfc/PaymentBackend.java
+++ b/src/com/android/settings/nfc/PaymentBackend.java
@@ -20,6 +20,7 @@
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.pm.PackageManager;
+import android.graphics.drawable.Drawable;
 import android.nfc.NfcAdapter;
 import android.nfc.cardemulation.ApduServiceInfo;
 import android.nfc.cardemulation.CardEmulation;
@@ -50,6 +51,7 @@
         public ComponentName componentName;
         public ComponentName settingsComponent;
         public UserHandle userHandle;
+        public Drawable icon;
     }
 
     /**
@@ -131,6 +133,7 @@
                     appInfo.settingsComponent = null;
                 }
                 appInfo.description = service.getDescription();
+                appInfo.icon = pm.getUserBadgedIcon(service.loadIcon(pm), appInfo.userHandle);
 
                 appInfos.add(appInfo);
             }
diff --git a/src/com/android/settings/nfc/PaymentSettings.java b/src/com/android/settings/nfc/PaymentSettings.java
index bbe5f29..a1f75bc 100644
--- a/src/com/android/settings/nfc/PaymentSettings.java
+++ b/src/com/android/settings/nfc/PaymentSettings.java
@@ -18,15 +18,11 @@
 
 import android.app.settings.SettingsEnums;
 import android.content.Context;
-import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.content.pm.UserInfo;
 import android.os.Bundle;
 import android.os.UserHandle;
 import android.os.UserManager;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
 
@@ -37,8 +33,12 @@
 import com.android.settings.R;
 import com.android.settings.dashboard.DashboardFragment;
 import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settingslib.core.AbstractPreferenceController;
+import com.android.settingslib.core.lifecycle.Lifecycle;
 import com.android.settingslib.search.SearchIndexable;
 
+import java.util.ArrayList;
+import java.util.List;
 
 @SearchIndexable
 public class PaymentSettings extends DashboardFragment {
@@ -62,12 +62,23 @@
     }
 
     @Override
+    protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
+        return buildPreferenceControllers(context, getSettingsLifecycle());
+    }
+
+    private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
+            Lifecycle lifecycle) {
+        final List<AbstractPreferenceController> controllers = new ArrayList<>();
+        controllers.add(new NfcDefaultPaymentPreferenceController(context, lifecycle));
+
+        return controllers;
+    }
+
+    @Override
     public void onAttach(Context context) {
         super.onAttach(context);
         mPaymentBackend = new PaymentBackend(getActivity());
-        setHasOptionsMenu(true);
 
-        use(NfcPaymentPreferenceController.class).setPaymentBackend(mPaymentBackend);
         use(NfcForegroundPreferenceController.class).setPaymentBackend(mPaymentBackend);
     }
 
@@ -93,15 +104,6 @@
         mPaymentBackend.onPause();
     }
 
-    @Override
-    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
-        super.onCreateOptionsMenu(menu, inflater);
-        MenuItem menuItem = menu.add(R.string.nfc_payment_how_it_works);
-        Intent howItWorksIntent = new Intent(getActivity(), HowItWorks.class);
-        menuItem.setIntent(howItWorksIntent);
-        menuItem.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_NEVER);
-    }
-
     @VisibleForTesting
     boolean isShowEmptyImage(PreferenceScreen screen) {
         for (int i = 0; i < screen.getPreferenceCount(); i++) {
@@ -127,4 +129,4 @@
                     return pm.hasSystemFeature(PackageManager.FEATURE_NFC);
                 }
             };
-}
\ No newline at end of file
+}
diff --git a/src/com/android/settings/nfc/SecureNfcEnabler.java b/src/com/android/settings/nfc/SecureNfcEnabler.java
index 9acaf64..f31a382 100644
--- a/src/com/android/settings/nfc/SecureNfcEnabler.java
+++ b/src/com/android/settings/nfc/SecureNfcEnabler.java
@@ -18,9 +18,8 @@
 
 import android.content.Context;
 import android.nfc.NfcAdapter;
-import android.provider.Settings;
+import android.os.UserManager;
 
-import androidx.annotation.VisibleForTesting;
 import androidx.preference.SwitchPreference;
 
 import com.android.settings.R;
@@ -32,10 +31,12 @@
  */
 public class SecureNfcEnabler extends BaseNfcEnabler {
     private final SwitchPreference mPreference;
+    private final UserManager mUserManager;
 
     public SecureNfcEnabler(Context context, SwitchPreference preference) {
         super(context);
         mPreference = preference;
+        mUserManager = context.getSystemService(UserManager.class);
     }
 
     @Override
@@ -48,7 +49,7 @@
             case NfcAdapter.STATE_ON:
                 mPreference.setSummary(R.string.nfc_secure_toggle_summary);
                 mPreference.setChecked(mPreference.isChecked());
-                mPreference.setEnabled(true);
+                mPreference.setEnabled(isToggleable());
                 break;
             case NfcAdapter.STATE_TURNING_ON:
                 mPreference.setEnabled(false);
@@ -58,4 +59,11 @@
                 break;
         }
     }
+
+    private boolean isToggleable() {
+        if (mUserManager.isGuestUser()) {
+            return false;
+        }
+        return true;
+    }
 }
diff --git a/src/com/android/settings/users/UserDetailsSettings.java b/src/com/android/settings/users/UserDetailsSettings.java
index 8f89a5f..c3657be 100644
--- a/src/com/android/settings/users/UserDetailsSettings.java
+++ b/src/com/android/settings/users/UserDetailsSettings.java
@@ -74,6 +74,9 @@
     private static final int DIALOG_SETUP_USER = 4;
     private static final int DIALOG_CONFIRM_RESET_GUEST = 5;
 
+    /** Whether to enable the app_copying fragment. */
+    private static final boolean SHOW_APP_COPYING_PREF = false;
+
     private UserManager mUserManager;
     private UserCapabilities mUserCaps;
     private boolean mGuestUserAutoCreated;
@@ -298,6 +301,9 @@
                 if (mGuestUserAutoCreated) {
                     mRemoveUserPref.setEnabled((mUserInfo.flags & UserInfo.FLAG_INITIALIZED) != 0);
                 }
+                if (!SHOW_APP_COPYING_PREF) {
+                    removePreference(KEY_APP_COPYING);
+                }
             } else {
                 mPhonePref.setChecked(!mUserManager.hasUserRestriction(
                         UserManager.DISALLOW_OUTGOING_CALLS, new UserHandle(userId)));
@@ -410,6 +416,9 @@
     }
 
     private void openAppCopyingScreen() {
+        if (!SHOW_APP_COPYING_PREF) {
+            return;
+        }
         final Bundle extras = new Bundle();
         extras.putInt(AppRestrictionsFragment.EXTRA_USER_ID, mUserInfo.id);
         new SubSettingLauncher(getContext())
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java
index dc4bca3..9398d20 100644
--- a/src/com/android/settings/users/UserSettings.java
+++ b/src/com/android/settings/users/UserSettings.java
@@ -503,7 +503,8 @@
     private void onAddSupervisedUserClicked() {
         final Intent intent = new Intent()
                 .setAction(UserManager.ACTION_CREATE_SUPERVISED_USER)
-                .setPackage(mConfigSupervisedUserCreationPackage);
+                .setPackage(mConfigSupervisedUserCreationPackage)
+                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 
         // TODO(b/209659998): [to-be-removed] fallback activity for supervised user creation.
         if (getActivity().getPackageManager().resolveActivity(intent, 0) == null) {
diff --git a/tests/robotests/src/com/android/settings/ResetNetworkConfirmTest.java b/tests/robotests/src/com/android/settings/ResetNetworkConfirmTest.java
index e7a0090..e4495f4 100644
--- a/tests/robotests/src/com/android/settings/ResetNetworkConfirmTest.java
+++ b/tests/robotests/src/com/android/settings/ResetNetworkConfirmTest.java
@@ -18,6 +18,15 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
+import static org.mockito.ArgumentMatchers.any;
+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.net.wifi.p2p.WifiP2pManager;
+import android.os.Looper;
 import android.view.LayoutInflater;
 import android.widget.TextView;
 
@@ -25,7 +34,6 @@
 
 import com.android.settings.testutils.shadow.ShadowBluetoothAdapter;
 import com.android.settings.testutils.shadow.ShadowRecoverySystem;
-import com.android.settings.testutils.shadow.ShadowWifiP2pManager;
 
 import org.junit.After;
 import org.junit.Before;
@@ -39,27 +47,31 @@
 import org.robolectric.annotation.Config;
 
 @RunWith(RobolectricTestRunner.class)
-@Config(shadows = {ShadowRecoverySystem.class,
-        ShadowWifiP2pManager.class, ShadowBluetoothAdapter.class
-})
+@Config(shadows = {ShadowRecoverySystem.class, ShadowBluetoothAdapter.class})
 public class ResetNetworkConfirmTest {
 
     private FragmentActivity mActivity;
+
+    @Mock
+    private WifiP2pManager mWifiP2pManager;
     @Mock
     private ResetNetworkConfirm mResetNetworkConfirm;
 
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
+        when(mWifiP2pManager.initialize(any(Context.class), any(Looper.class), any()))
+                .thenReturn(mock(WifiP2pManager.Channel.class));
+
         mResetNetworkConfirm = new ResetNetworkConfirm();
-        mActivity = Robolectric.setupActivity(FragmentActivity.class);
+        mActivity = spy(Robolectric.setupActivity(FragmentActivity.class));
+        when(mActivity.getSystemService(Context.WIFI_P2P_SERVICE)).thenReturn(mWifiP2pManager);
         mResetNetworkConfirm.mActivity = mActivity;
     }
 
     @After
     public void tearDown() {
         ShadowRecoverySystem.reset();
-        ShadowWifiP2pManager.reset();
     }
 
     @Test
@@ -88,11 +100,10 @@
      * Test for WifiP2pManager factoryReset method.
      */
     @Test
-    @Ignore
     public void testResetNetworkData_resetP2p() {
         mResetNetworkConfirm.p2pFactoryReset(mActivity);
 
-        assertThat(ShadowWifiP2pManager.getFactoryResetCount()).isEqualTo(1);
+        verify(mWifiP2pManager).factoryReset(any(WifiP2pManager.Channel.class), any());
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/accessibility/AccessibilityQuickSettingsTooltipWindowTest.java b/tests/robotests/src/com/android/settings/accessibility/AccessibilityQuickSettingsTooltipWindowTest.java
index f1e1121b..be67977 100644
--- a/tests/robotests/src/com/android/settings/accessibility/AccessibilityQuickSettingsTooltipWindowTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/AccessibilityQuickSettingsTooltipWindowTest.java
@@ -22,6 +22,7 @@
 
 import android.content.Context;
 import android.view.View;
+import android.view.accessibility.AccessibilityNodeInfo;
 import android.widget.PopupWindow;
 
 import androidx.test.core.app.ApplicationProvider;
@@ -53,52 +54,68 @@
 
     private static final String TEST_PACKAGE_NAME = "com.test.package";
     private final Context mContext = ApplicationProvider.getApplicationContext();
-    private AccessibilityQuickSettingsTooltipWindow mToolTipView;
+    private AccessibilityQuickSettingsTooltipWindow mTooltipView;
     private View mView;
 
     @Before
     public void setUp() {
-        mToolTipView = new AccessibilityQuickSettingsTooltipWindow(mContext);
+        mTooltipView = new AccessibilityQuickSettingsTooltipWindow(mContext);
         mView = new View(RuntimeEnvironment.application);
     }
 
     @Test
-    public void initToolTipView_atMostAvailableTextWidth() {
+    public void initTooltipView_atMostAvailableTextWidth() {
         final String quickSettingsTooltipsContent = mContext.getString(
                 R.string.accessibility_service_quick_settings_tooltips_content, TEST_PACKAGE_NAME);
-        mToolTipView.setup(quickSettingsTooltipsContent);
+        mTooltipView.setup(quickSettingsTooltipsContent);
 
-        final int getMaxWidth = mToolTipView.getAvailableWindowWidth();
-        assertThat(mToolTipView.getWidth()).isAtMost(getMaxWidth);
+        final int getMaxWidth = mTooltipView.getAvailableWindowWidth();
+        assertThat(mTooltipView.getWidth()).isAtMost(getMaxWidth);
     }
 
     @Test
-    public void showToolTipView_success() {
-        mToolTipView.setup(TEST_PACKAGE_NAME);
+    public void showTooltipView_success() {
+        mTooltipView.setup(TEST_PACKAGE_NAME);
         assertThat(getLatestPopupWindow()).isNull();
 
-        mToolTipView.showAtTopCenter(mView);
+        mTooltipView.showAtTopCenter(mView);
 
-        assertThat(getLatestPopupWindow()).isSameInstanceAs(mToolTipView);
+        assertThat(getLatestPopupWindow()).isSameInstanceAs(mTooltipView);
     }
 
     @Test
-    public void dismiss_toolTipViewShown_shouldInvokeCallbackAndNotShowing() {
-        mToolTipView.setup(TEST_PACKAGE_NAME);
-        mToolTipView.setOnDismissListener(mMockOnDismissListener);
-        mToolTipView.showAtTopCenter(mView);
+    public void accessibilityClickActionOnTooltipViewShown_shouldInvokeCallbackAndNotShowing() {
+        mTooltipView.setup(TEST_PACKAGE_NAME);
+        mTooltipView.setOnDismissListener(mMockOnDismissListener);
+        mTooltipView.showAtTopCenter(mView);
 
-        mToolTipView.dismiss();
+        final boolean isActionPerformed =
+                mTooltipView.getContentView().performAccessibilityAction(
+                        AccessibilityNodeInfo.AccessibilityAction.ACTION_CLICK.getId(),
+                        /* arguments= */ null);
+
+        assertThat(isActionPerformed).isTrue();
+        verify(mMockOnDismissListener).onDismiss();
+        assertThat(getLatestPopupWindow().isShowing()).isFalse();
+    }
+
+    @Test
+    public void dismiss_tooltipViewShown_shouldInvokeCallbackAndNotShowing() {
+        mTooltipView.setup(TEST_PACKAGE_NAME);
+        mTooltipView.setOnDismissListener(mMockOnDismissListener);
+        mTooltipView.showAtTopCenter(mView);
+
+        mTooltipView.dismiss();
 
         verify(mMockOnDismissListener).onDismiss();
         assertThat(getLatestPopupWindow().isShowing()).isFalse();
     }
 
     @Test
-    public void waitAutoCloseDelayTime_toolTipViewShown_shouldInvokeCallbackAndNotShowing() {
-        mToolTipView.setup(TEST_PACKAGE_NAME, /* closeDelayTimeMillis= */ 1);
-        mToolTipView.setOnDismissListener(mMockOnDismissListener);
-        mToolTipView.showAtTopCenter(mView);
+    public void waitAutoCloseDelayTime_tooltipViewShown_shouldInvokeCallbackAndNotShowing() {
+        mTooltipView.setup(TEST_PACKAGE_NAME, /* closeDelayTimeMillis= */ 1);
+        mTooltipView.setOnDismissListener(mMockOnDismissListener);
+        mTooltipView.showAtTopCenter(mView);
 
         ShadowLooper.runUiThreadTasksIncludingDelayedTasks();
 
diff --git a/tests/robotests/src/com/android/settings/dream/DreamPickerControllerTest.java b/tests/robotests/src/com/android/settings/dream/DreamPickerControllerTest.java
index 1048970..c6c2436 100644
--- a/tests/robotests/src/com/android/settings/dream/DreamPickerControllerTest.java
+++ b/tests/robotests/src/com/android/settings/dream/DreamPickerControllerTest.java
@@ -48,7 +48,6 @@
 
 @RunWith(RobolectricTestRunner.class)
 public class DreamPickerControllerTest {
-    private DreamPickerController mController;
     @Mock(answer = Answers.RETURNS_DEEP_STUBS)
     private DreamBackend mBackend;
     private Context mContext;
@@ -63,31 +62,36 @@
 
         mPreference = new LayoutPreference(mContext, R.layout.dream_picker_layout);
         when(mScreen.findPreference(anyString())).thenReturn(mPreference);
+    }
 
-        mController = new DreamPickerController(
+    private DreamPickerController buildController() {
+        final DreamPickerController controller = new DreamPickerController(
                 mContext,
                 /* preferenceKey= */ "test",
                 mBackend);
-
-        mController.displayPreference(mScreen);
+        controller.displayPreference(mScreen);
+        return controller;
     }
 
     @Test
     public void isDisabledIfNoDreamsAvailable() {
         when(mBackend.getDreamInfos()).thenReturn(new ArrayList<>(0));
-        assertThat(mController.isAvailable()).isFalse();
+        final DreamPickerController controller = buildController();
+        assertThat(controller.isAvailable()).isFalse();
     }
 
     @Test
     public void isEnabledIfDreamsAvailable() {
         when(mBackend.getDreamInfos()).thenReturn(Collections.singletonList(new DreamInfo()));
-        assertThat(mController.isAvailable()).isTrue();
+        final DreamPickerController controller = buildController();
+        assertThat(controller.isAvailable()).isTrue();
     }
 
     @Test
     public void testDreamDisplayedInList() {
         when(mBackend.getDreamInfos()).thenReturn(Collections.singletonList(new DreamInfo()));
-        mController.updateState(mPreference);
+        final DreamPickerController controller = buildController();
+        controller.updateState(mPreference);
 
         RecyclerView view = mPreference.findViewById(R.id.dream_list);
         assertThat(view.getAdapter().getItemCount()).isEqualTo(1);
@@ -100,7 +104,8 @@
         mockDreamInfo.isActive = true;
 
         when(mBackend.getDreamInfos()).thenReturn(Collections.singletonList(mockDreamInfo));
-        mController.updateState(mPreference);
+        final DreamPickerController controller = buildController();
+        controller.updateState(mPreference);
 
         Button view = mPreference.findViewById(R.id.preview_button);
         view.performClick();
diff --git a/tests/robotests/src/com/android/settings/enterprise/BugReportsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/BugReportsPreferenceControllerTest.java
index 5a05ecc..34853c6 100644
--- a/tests/robotests/src/com/android/settings/enterprise/BugReportsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/BugReportsPreferenceControllerTest.java
@@ -22,13 +22,13 @@
 
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
 
 import java.util.Date;
-import org.robolectric.RobolectricTestRunner;
 
 @RunWith(RobolectricTestRunner.class)
 public class BugReportsPreferenceControllerTest
-    extends AdminActionPreferenceControllerTestBase {
+        extends AdminActionPreferenceControllerTestBase {
 
     @Override
     public void setUp() {
@@ -39,7 +39,7 @@
     @Override
     public void setDate(Date date) {
         when(mFeatureFactory.enterprisePrivacyFeatureProvider.getLastBugReportRequestTime())
-            .thenReturn(date);
+                .thenReturn(date);
     }
 
     @Test
diff --git a/tests/robotests/src/com/android/settings/network/WifiConnectionPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/WifiConnectionPreferenceControllerTest.java
index 925b000..4a7c273 100644
--- a/tests/robotests/src/com/android/settings/network/WifiConnectionPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/WifiConnectionPreferenceControllerTest.java
@@ -19,6 +19,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
@@ -33,6 +34,7 @@
 import androidx.preference.PreferenceCategory;
 import androidx.preference.PreferenceScreen;
 
+import com.android.settings.testutils.FakeFeatureFactory;
 import com.android.settings.wifi.WifiConnectionPreferenceController;
 import com.android.settings.wifi.WifiEntryPreference;
 import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -40,7 +42,6 @@
 import com.android.wifitrackerlib.WifiPickerTracker;
 
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
@@ -50,7 +51,6 @@
 import org.robolectric.RuntimeEnvironment;
 
 @RunWith(RobolectricTestRunner.class)
-@Ignore
 public class WifiConnectionPreferenceControllerTest {
     private static final String KEY = "wifi_connection";
 
@@ -72,6 +72,10 @@
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         mContext = spy(RuntimeEnvironment.application);
+        FakeFeatureFactory fakeFeatureFactory = FakeFeatureFactory.setupForTest();
+        when(fakeFeatureFactory.wifiTrackerLibProvider.createWifiPickerTracker(
+                any(), any(), any(), any(), any(), anyLong(), anyLong(), any()))
+                .thenReturn(mWifiPickerTracker);
         mLifecycleOwner = () -> mLifecycle;
         mLifecycle = new Lifecycle(mLifecycleOwner);
         when(mScreen.findPreference(eq(KEY))).thenReturn(mPreferenceCategory);
diff --git a/tests/robotests/src/com/android/settings/nfc/NfcForegroundPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/nfc/NfcForegroundPreferenceControllerTest.java
index 4c2195c..63fa320 100644
--- a/tests/robotests/src/com/android/settings/nfc/NfcForegroundPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/nfc/NfcForegroundPreferenceControllerTest.java
@@ -26,7 +26,7 @@
 import android.content.Context;
 import android.content.pm.PackageManager;
 
-import androidx.preference.DropDownPreference;
+import androidx.preference.ListPreference;
 import androidx.preference.PreferenceScreen;
 
 import com.android.settings.R;
@@ -39,7 +39,6 @@
 import org.mockito.MockitoAnnotations;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
-import org.robolectric.util.ReflectionHelpers;
 
 import java.util.ArrayList;
 
@@ -56,7 +55,7 @@
     private PackageManager mManager;
 
     private Context mContext;
-    private DropDownPreference mPreference;
+    private ListPreference mPreference;
     private NfcForegroundPreferenceController mController;
     private FakeFeatureFactory mFakeFeatureFactory;
 
@@ -67,7 +66,9 @@
         when(mContext.getPackageManager()).thenReturn(mManager);
         mFakeFeatureFactory = FakeFeatureFactory.setupForTest();
         mController = new NfcForegroundPreferenceController(mContext, PREF_KEY);
-        mPreference = new DropDownPreference(mContext);
+        mPreference = new ListPreference(mContext);
+        mPreference.setEntries(R.array.nfc_payment_favor);
+        mPreference.setEntryValues(R.array.nfc_payment_favor_values);
         when(mScreen.findPreference(PREF_KEY)).thenReturn(mPreference);
     }
 
@@ -146,17 +147,14 @@
         final CharSequence favorDefault = mContext.getText(R.string.nfc_payment_favor_default);
         final CharSequence favorOpen = mContext.getText(R.string.nfc_payment_favor_open);
 
-        assertThat(mPreference.getEntry()).isEqualTo(favorDefault);
-        assertThat(mPreference.getSummary()).isEqualTo(favorDefault);
-
-        mPreference.setValueIndex(0);
-        mPreference.callChangeListener(mPreference.getEntryValues()[0]);
+        mPreference.setValueIndex(1);
+        mPreference.callChangeListener(mPreference.getEntryValues()[1]);
         verify(mPaymentBackend).setForegroundMode(true);
         assertThat(mPreference.getEntry()).isEqualTo(favorOpen);
         assertThat(mPreference.getSummary()).isEqualTo(favorOpen);
 
-        mPreference.setValueIndex(1);
-        mPreference.callChangeListener(mPreference.getEntryValues()[1]);
+        mPreference.setValueIndex(0);
+        mPreference.callChangeListener(mPreference.getEntryValues()[0]);
         verify(mPaymentBackend).setForegroundMode(false);
         assertThat(mPreference.getEntry()).isEqualTo(favorDefault);
         assertThat(mPreference.getSummary()).isEqualTo(favorDefault);
@@ -168,16 +166,16 @@
         mController.displayPreference(mScreen);
         mController.onPaymentAppsChanged();
 
-        mPreference.setValueIndex(0);
-        mPreference.callChangeListener(mPreference.getEntryValues()[0]);
+        mPreference.setValueIndex(1);
+        mPreference.callChangeListener(mPreference.getEntryValues()[1]);
         verify(mPaymentBackend).setForegroundMode(true);
         verify(mFakeFeatureFactory.metricsFeatureProvider).action(mContext,
                 SettingsEnums.ACTION_NFC_PAYMENT_FOREGROUND_SETTING);
 
-        mPreference.setValueIndex(1);
-        mPreference.callChangeListener(mPreference.getEntryValues()[1]);
+        mPreference.setValueIndex(0);
+        mPreference.callChangeListener(mPreference.getEntryValues()[0]);
         verify(mPaymentBackend).setForegroundMode(false);
         verify(mFakeFeatureFactory.metricsFeatureProvider).action(mContext,
                 SettingsEnums.ACTION_NFC_PAYMENT_ALWAYS_SETTING);
     }
-}
\ No newline at end of file
+}
diff --git a/tests/robotests/src/com/android/settings/nfc/PaymentSettingsTest.java b/tests/robotests/src/com/android/settings/nfc/PaymentSettingsTest.java
index 32eedd8..458bc93 100644
--- a/tests/robotests/src/com/android/settings/nfc/PaymentSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/nfc/PaymentSettingsTest.java
@@ -53,7 +53,7 @@
 @Config(shadows = {PaymentSettingsTest.ShadowPaymentBackend.class, ShadowNfcAdapter.class})
 public class PaymentSettingsTest {
 
-    static final String PAYMENT_KEY = "nfc_payment";
+    static final String PAYMENT_KEY = "nfc_payment_app";
     static final String FOREGROUND_KEY = "nfc_foreground";
 
     private Context mContext;
@@ -160,4 +160,4 @@
             return mAppInfos;
         }
     }
-}
\ No newline at end of file
+}
diff --git a/tests/robotests/src/com/android/settings/users/UserSettingsTest.java b/tests/robotests/src/com/android/settings/users/UserSettingsTest.java
index 5c13e2f..2c694ac 100644
--- a/tests/robotests/src/com/android/settings/users/UserSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/users/UserSettingsTest.java
@@ -664,6 +664,7 @@
     public void onPreferenceClick_addSupervisedUserClicked_startIntentWithAction() {
         final String intentPackage = "testPackage";
         final String intentAction = UserManager.ACTION_CREATE_SUPERVISED_USER;
+        final int intentFlags = Intent.FLAG_ACTIVITY_NEW_TASK;
         final int metricsAction = SettingsEnums.ACTION_USER_SUPERVISED_ADD;
         try {
             setConfigSupervisedUserCreationPackage(intentPackage);
@@ -676,6 +677,7 @@
             verify(mFragment).startActivity(captor.capture());
             assertThat(captor.getValue().getPackage()).isEqualTo(intentPackage);
             assertThat(captor.getValue().getAction()).isEqualTo(intentAction);
+            assertThat(captor.getValue().getFlags() & intentFlags).isGreaterThan(0);
 
             verify(mMetricsFeatureProvider).action(any(), eq(metricsAction));
         } finally {
diff --git a/tests/robotests/src/com/android/settings/wifi/AddNetworkFragmentTest.java b/tests/robotests/src/com/android/settings/wifi/AddNetworkFragmentTest.java
index 3ba13b4..d491355 100644
--- a/tests/robotests/src/com/android/settings/wifi/AddNetworkFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/AddNetworkFragmentTest.java
@@ -18,16 +18,21 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
+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.net.wifi.WifiManager;
 import android.view.View;
 
+import androidx.test.core.app.ApplicationProvider;
+
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.settings.testutils.shadow.ShadowConnectivityManager;
 
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.MockitoAnnotations;
@@ -44,37 +49,36 @@
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
+        Context context = spy(ApplicationProvider.getApplicationContext());
+        when(context.getSystemService(Context.WIFI_SERVICE)).thenReturn(mock(WifiManager.class));
+
         mAddNetworkFragment = spy(new AddNetworkFragment());
+        when(mAddNetworkFragment.getContext()).thenReturn(context);
         FragmentController.setupFragment(mAddNetworkFragment);
     }
 
     @Test
-    @Ignore
     public void getMetricsCategory_shouldReturnAddNetwork() {
         assertThat(mAddNetworkFragment.getMetricsCategory()).isEqualTo(
                 MetricsEvent.SETTINGS_WIFI_ADD_NETWORK);
     }
 
     @Test
-    @Ignore
     public void getMode_shouldBeModeConnected() {
         assertThat(mAddNetworkFragment.getMode()).isEqualTo(WifiConfigUiBase2.MODE_CONNECT);
     }
 
     @Test
-    @Ignore
     public void launchFragment_shouldShowSubmitButton() {
         assertThat(mAddNetworkFragment.getSubmitButton()).isNotNull();
     }
 
     @Test
-    @Ignore
     public void launchFragment_shouldShowCancelButton() {
         assertThat(mAddNetworkFragment.getCancelButton()).isNotNull();
     }
 
     @Test
-    @Ignore
     public void onClickSubmitButton_shouldHandleSubmitAction() {
         View submitButton = mAddNetworkFragment.getView().findViewById(
                 AddNetworkFragment.SUBMIT_BUTTON_ID);
@@ -85,7 +89,6 @@
     }
 
     @Test
-    @Ignore
     public void onClickCancelButton_shouldHandleCancelAction() {
         View cancelButton = mAddNetworkFragment.getView().findViewById(
                 AddNetworkFragment.CANCEL_BUTTON_ID);
@@ -96,7 +99,6 @@
     }
 
     @Test
-    @Ignore
     public void dispatchSubmit_shouldHandleSubmitAction() {
         mAddNetworkFragment.dispatchSubmit();
 
diff --git a/tests/robotests/src/com/android/settings/wifi/ConfigureWifiEntryFragmentTest.java b/tests/robotests/src/com/android/settings/wifi/ConfigureWifiEntryFragmentTest.java
index f7ae660..f8f45dd 100644
--- a/tests/robotests/src/com/android/settings/wifi/ConfigureWifiEntryFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/ConfigureWifiEntryFragmentTest.java
@@ -18,16 +18,21 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
+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.app.settings.SettingsEnums;
+import android.content.Context;
+import android.net.wifi.WifiManager;
 import android.os.Bundle;
 
+import androidx.test.core.app.ApplicationProvider;
+
 import com.android.wifitrackerlib.NetworkDetailsTracker;
 
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
@@ -36,7 +41,6 @@
 import org.robolectric.shadows.androidx.fragment.FragmentController;
 
 @RunWith(RobolectricTestRunner.class)
-@Ignore
 public class ConfigureWifiEntryFragmentTest {
 
     private static final String KEY_SSID = "key_ssid";
@@ -50,13 +54,16 @@
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
-        Bundle bundle = new Bundle();
+        Context context = spy(ApplicationProvider.getApplicationContext());
+        when(context.getSystemService(Context.WIFI_SERVICE)).thenReturn(mock(WifiManager.class));
 
+        Bundle bundle = new Bundle();
         bundle.putString(KEY_SSID, "Test AP");
         bundle.putInt(KEY_SECURITY, 1 /* WEP */);
         mConfigureWifiEntryFragment = spy(new ConfigureWifiEntryFragment());
         mConfigureWifiEntryFragment.setArguments(bundle);
         mConfigureWifiEntryFragment.mNetworkDetailsTracker = mNetworkDetailsTracker;
+        when(mConfigureWifiEntryFragment.getContext()).thenReturn(context);
 
         FragmentController.setupFragment(mConfigureWifiEntryFragment);
     }
diff --git a/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogActivityTest.java b/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogActivityTest.java
index 460e644..fb20045 100644
--- a/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogActivityTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogActivityTest.java
@@ -19,6 +19,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
@@ -35,13 +36,12 @@
 import androidx.annotation.Nullable;
 import androidx.appcompat.app.AlertDialog;
 
+import com.android.settings.testutils.FakeFeatureFactory;
 import com.android.settings.testutils.shadow.ShadowAlertDialogCompat;
 import com.android.settings.wifi.NetworkRequestErrorDialogFragment.ERROR_DIALOG_TYPE;
-import com.android.settingslib.wifi.WifiTracker;
-import com.android.settingslib.wifi.WifiTrackerFactory;
+import com.android.wifitrackerlib.WifiPickerTracker;
 
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.MockitoAnnotations;
@@ -55,7 +55,6 @@
 import java.util.List;
 
 @RunWith(RobolectricTestRunner.class)
-@Ignore
 @Config(shadows = ShadowAlertDialogCompat.class)
 public class NetworkRequestDialogActivityTest {
 
@@ -69,11 +68,11 @@
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
-
         mContext = spy(RuntimeEnvironment.application);
-
-        WifiTracker wifiTracker = mock(WifiTracker.class);
-        WifiTrackerFactory.setTestingWifiTracker(wifiTracker);
+        FakeFeatureFactory fakeFeatureFactory = FakeFeatureFactory.setupForTest();
+        when(fakeFeatureFactory.wifiTrackerLibProvider.createWifiPickerTracker(
+                any(), any(), any(), any(), any(), anyLong(), anyLong(), any()))
+                .thenReturn(mock(WifiPickerTracker.class));
 
         NetworkRequestDialogActivity activity =
             Robolectric.setupActivity(NetworkRequestDialogActivity.class);
diff --git a/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogFragmentTest.java b/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogFragmentTest.java
index 496fe87..e08a14a 100644
--- a/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/NetworkRequestDialogFragmentTest.java
@@ -18,6 +18,8 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
 import static org.mockito.Mockito.inOrder;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
@@ -38,15 +40,16 @@
 import androidx.fragment.app.FragmentActivity;
 
 import com.android.settings.R;
+import com.android.settings.testutils.FakeFeatureFactory;
 import com.android.settings.testutils.shadow.ShadowAlertDialogCompat;
 import com.android.wifitrackerlib.WifiEntry;
 import com.android.wifitrackerlib.WifiPickerTracker;
 
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.InOrder;
+import org.mockito.MockitoAnnotations;
 import org.robolectric.Robolectric;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
@@ -56,7 +59,6 @@
 import java.util.List;
 
 @RunWith(RobolectricTestRunner.class)
-@Ignore
 @Config(shadows = ShadowAlertDialogCompat.class)
 public class NetworkRequestDialogFragmentTest {
 
@@ -69,6 +71,12 @@
 
     @Before
     public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        FakeFeatureFactory fakeFeatureFactory = FakeFeatureFactory.setupForTest();
+        when(fakeFeatureFactory.wifiTrackerLibProvider.createWifiPickerTracker(
+                any(), any(), any(), any(), any(), anyLong(), anyLong(), any()))
+                .thenReturn(mock(WifiPickerTracker.class));
+
         mActivity = Robolectric.buildActivity(FragmentActivity.class,
                 new Intent().putExtra(NetworkRequestDialogFragment.EXTRA_APP_NAME,
                         TEST_APP_NAME)).setup().get();
diff --git a/tests/robotests/src/com/android/settings/wifi/NetworkRequestErrorDialogFragmentTest.java b/tests/robotests/src/com/android/settings/wifi/NetworkRequestErrorDialogFragmentTest.java
index 8e95db8..f4e018f 100644
--- a/tests/robotests/src/com/android/settings/wifi/NetworkRequestErrorDialogFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/NetworkRequestErrorDialogFragmentTest.java
@@ -19,9 +19,12 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.junit.Assert.fail;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
 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 static org.mockito.internal.verification.VerificationModeFactory.times;
 
 import android.content.DialogInterface;
@@ -32,22 +35,21 @@
 import androidx.appcompat.app.AlertDialog;
 
 import com.android.settings.R;
+import com.android.settings.testutils.FakeFeatureFactory;
 import com.android.settings.testutils.shadow.ShadowAlertDialogCompat;
 import com.android.settings.wifi.NetworkRequestErrorDialogFragment.ERROR_DIALOG_TYPE;
-import com.android.settingslib.wifi.WifiTracker;
-import com.android.settingslib.wifi.WifiTrackerFactory;
+import com.android.wifitrackerlib.WifiPickerTracker;
 
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.mockito.MockitoAnnotations;
 import org.robolectric.Robolectric;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
 import org.robolectric.annotation.Config;
 
 @RunWith(RobolectricTestRunner.class)
-@Ignore
 @Config(shadows = ShadowAlertDialogCompat.class)
 public class NetworkRequestErrorDialogFragmentTest {
 
@@ -56,8 +58,11 @@
 
     @Before
     public void setUp() {
-        WifiTracker wifiTracker = mock(WifiTracker.class);
-        WifiTrackerFactory.setTestingWifiTracker(wifiTracker);
+        MockitoAnnotations.initMocks(this);
+        FakeFeatureFactory fakeFeatureFactory = FakeFeatureFactory.setupForTest();
+        when(fakeFeatureFactory.wifiTrackerLibProvider.createWifiPickerTracker(
+                any(), any(), any(), any(), any(), anyLong(), anyLong(), any()))
+                .thenReturn(mock(WifiPickerTracker.class));
 
         mActivity = Robolectric.setupActivity(NetworkRequestDialogActivity.class);
         mFragment = spy(NetworkRequestErrorDialogFragment.newInstance());
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java b/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
index 9952c06..8ecbaf6 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiConfigControllerTest.java
@@ -22,6 +22,7 @@
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
 import static org.robolectric.Shadows.shadowOf;
 
@@ -45,19 +46,19 @@
 import android.widget.Spinner;
 import android.widget.TextView;
 
+import androidx.test.core.app.ApplicationProvider;
+
 import com.android.settings.R;
 import com.android.settings.network.SubscriptionUtil;
 import com.android.settings.testutils.shadow.ShadowConnectivityManager;
 import com.android.settingslib.wifi.AccessPoint;
 
 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.ShadowInputMethodManager;
@@ -66,7 +67,6 @@
 import java.util.Arrays;
 
 @RunWith(RobolectricTestRunner.class)
-@Ignore
 @Config(shadows = ShadowConnectivityManager.class)
 public class WifiConfigControllerTest {
 
@@ -96,7 +96,8 @@
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
-        mContext = RuntimeEnvironment.application;
+        mContext = spy(ApplicationProvider.getApplicationContext());
+        when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mock(WifiManager.class));
         when(mConfigUiBase.getContext()).thenReturn(mContext);
         when(mAccessPoint.getSecurity()).thenReturn(AccessPoint.SECURITY_PSK);
         mView = LayoutInflater.from(mContext).inflate(R.layout.wifi_dialog, null);
diff --git a/tests/robotests/src/com/android/settings/wifi/slice/ContextualWifiSliceTest.java b/tests/robotests/src/com/android/settings/wifi/slice/ContextualWifiSliceTest.java
index 28798df..f31c216 100644
--- a/tests/robotests/src/com/android/settings/wifi/slice/ContextualWifiSliceTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/slice/ContextualWifiSliceTest.java
@@ -27,8 +27,9 @@
 
 import android.content.ContentResolver;
 import android.content.Context;
+import android.net.Network;
 import android.net.NetworkCapabilities;
-import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiInfo;
 import android.net.wifi.WifiManager;
 
 import androidx.core.graphics.drawable.IconCompat;
@@ -45,9 +46,10 @@
 import com.android.settings.testutils.shadow.ShadowConnectivityManager;
 
 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.annotation.Config;
@@ -55,29 +57,40 @@
 import java.util.List;
 
 @RunWith(RobolectricTestRunner.class)
-@Ignore
 @Config(shadows = ShadowConnectivityManager.class)
 public class ContextualWifiSliceTest {
+    private static final String SSID = "123";
+
+    @Mock
+    private WifiManager mWifiManager;
+    @Mock
+    private WifiInfo mWifiInfo;
+    @Mock
+    private Network mNetwork;
 
     private Context mContext;
     private ContentResolver mResolver;
-    private WifiManager mWifiManager;
     private ContextualWifiSlice mWifiSlice;
     private FakeFeatureFactory mFeatureFactory;
 
     @Before
     public void setUp() {
+        MockitoAnnotations.initMocks(this);
         mContext = spy(RuntimeEnvironment.application);
         mResolver = mock(ContentResolver.class);
         mFeatureFactory = FakeFeatureFactory.setupForTest();
         mFeatureFactory.slicesFeatureProvider = new SlicesFeatureProviderImpl();
         mFeatureFactory.slicesFeatureProvider.newUiSession();
         doReturn(mResolver).when(mContext).getContentResolver();
-        mWifiManager = mContext.getSystemService(WifiManager.class);
+        doReturn(mWifiManager).when(mContext).getSystemService(WifiManager.class);
+        doReturn(true).when(mWifiManager).isWifiEnabled();
+        doReturn(WifiManager.WIFI_STATE_ENABLED).when(mWifiManager).getWifiState();
+        doReturn(mWifiInfo).when(mWifiManager).getConnectionInfo();
+        doReturn(SSID).when(mWifiInfo).getSSID();
+        doReturn(mNetwork).when(mWifiManager).getCurrentNetwork();
 
         // Set-up specs for SliceMetadata.
         SliceProvider.setSpecs(SliceLiveData.SUPPORTED_SPECS);
-        mWifiManager.setWifiEnabled(true);
 
         mWifiSlice = new ContextualWifiSlice(mContext);
     }
@@ -121,7 +134,7 @@
         mWifiSlice.sApRowCollapsed = true;
         connectToWifi(makeValidatedNetworkCapabilities());
 
-        mWifiManager.disconnect();
+        doReturn(null).when(mWifiManager).getCurrentNetwork();
         final Slice wifiSlice = mWifiSlice.getSlice();
 
         assertWifiHeader(wifiSlice);
@@ -138,11 +151,7 @@
     }
 
     private void connectToWifi(NetworkCapabilities nc) {
-        final WifiConfiguration config = new WifiConfiguration();
-        config.SSID = "123";
-        mWifiManager.connect(config, null /* listener */);
-        ShadowConnectivityManager.getShadow().setNetworkCapabilities(
-                mWifiManager.getCurrentNetwork(), nc);
+        ShadowConnectivityManager.getShadow().setNetworkCapabilities(mNetwork, nc);
     }
 
     private NetworkCapabilities makeValidatedNetworkCapabilities() {
diff --git a/tests/robotests/src/com/android/settings/wifi/slice/WifiSliceTest.java b/tests/robotests/src/com/android/settings/wifi/slice/WifiSliceTest.java
index 6fb8bb2..b4a8b05 100644
--- a/tests/robotests/src/com/android/settings/wifi/slice/WifiSliceTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/slice/WifiSliceTest.java
@@ -50,9 +50,10 @@
 import com.android.wifitrackerlib.WifiEntry.ConnectedState;
 
 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.annotation.Config;
@@ -63,7 +64,6 @@
 import java.util.List;
 
 @RunWith(RobolectricTestRunner.class)
-@Ignore
 @Config(shadows = WifiSliceTest.ShadowSliceBackgroundWorker.class)
 public class WifiSliceTest {
 
@@ -71,21 +71,24 @@
     private static final String AP2_NAME = "ap2";
     private static final String AP3_NAME = "ap3";
 
+    @Mock
+    private WifiManager mWifiManager;
+
     private Context mContext;
     private ContentResolver mResolver;
-    private WifiManager mWifiManager;
     private WifiSlice mWifiSlice;
 
     @Before
     public void setUp() {
+        MockitoAnnotations.initMocks(this);
         mContext = spy(RuntimeEnvironment.application);
         mResolver = mock(ContentResolver.class);
         doReturn(mResolver).when(mContext).getContentResolver();
-        mWifiManager = mContext.getSystemService(WifiManager.class);
+        doReturn(mWifiManager).when(mContext).getSystemService(WifiManager.class);
+        doReturn(WifiManager.WIFI_STATE_ENABLED).when(mWifiManager).getWifiState();
 
         // Set-up specs for SliceMetadata.
         SliceProvider.setSpecs(SliceLiveData.SUPPORTED_SPECS);
-        mWifiManager.setWifiEnabled(true);
 
         mWifiSlice = new WifiSlice(mContext);
     }
@@ -108,7 +111,7 @@
 
     @Test
     public void getWifiSlice_wifiOff_shouldReturnSingleRow() {
-        mWifiManager.setWifiEnabled(false);
+        doReturn(WifiManager.WIFI_STATE_DISABLED).when(mWifiManager).getWifiState();
 
         final Slice wifiSlice = mWifiSlice.getSlice();
 
diff --git a/tests/unit/src/com/android/settings/applications/AppLocaleUtilTest.java b/tests/unit/src/com/android/settings/applications/AppLocaleUtilTest.java
new file mode 100644
index 0000000..22a055f
--- /dev/null
+++ b/tests/unit/src/com/android/settings/applications/AppLocaleUtilTest.java
@@ -0,0 +1,135 @@
+/*
+ * 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.applications;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import android.app.ActivityManager;
+import android.content.Context;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.content.res.Resources;
+
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import com.android.settingslib.applications.ApplicationsState.AppEntry;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+public class AppLocaleUtilTest {
+    @Mock
+    private PackageManager mPackageManager;
+    @Mock
+    private ActivityManager mActivityManager;
+    @Mock
+    private AppEntry mEntry;
+    @Mock
+    private ApplicationInfo mApplicationInfo;
+    @Mock
+    private Resources mResources;
+
+    private Context mContext;
+    private String mDisallowedPackage = "com.disallowed.package";
+    private String mAallowedPackage = "com.allowed.package";
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(ApplicationProvider.getApplicationContext());
+        when(mContext.getPackageManager()).thenReturn(mPackageManager);
+        when(mContext.getSystemService(ActivityManager.class)).thenReturn(mActivityManager);
+    }
+
+    @Test
+    public void isDisplayLocaleUi_showUI() throws PackageManager.NameNotFoundException {
+        setTestAppEntry(mAallowedPackage);
+        setDisallowedPackageName(mDisallowedPackage);
+        setApplicationInfo(/*no platform key*/false);
+        mEntry.hasLauncherEntry = true;
+
+        assertTrue(AppLocaleUtil.canDisplayLocaleUi(mContext, mEntry));
+    }
+
+    @Test
+    public void isDisplayLocaleUi_notShowUI_hasPlatformKey()
+            throws PackageManager.NameNotFoundException {
+        setTestAppEntry(mAallowedPackage);
+        setDisallowedPackageName(mDisallowedPackage);
+        setApplicationInfo(/*has platform key*/true);
+        mEntry.hasLauncherEntry = true;
+
+        assertFalse(AppLocaleUtil.canDisplayLocaleUi(mContext, mEntry));
+    }
+
+    @Test
+    public void isDisplayLocaleUi_notShowUI_noLauncherEntry()
+            throws PackageManager.NameNotFoundException {
+        setTestAppEntry(mAallowedPackage);
+        setDisallowedPackageName(mDisallowedPackage);
+        setApplicationInfo(/*no platform key*/false);
+        mEntry.hasLauncherEntry = false;
+
+        assertFalse(AppLocaleUtil.canDisplayLocaleUi(mContext, mEntry));
+    }
+
+    @Test
+    public void isDisplayLocaleUi_notShowUI_matchDisallowedPackageList()
+            throws PackageManager.NameNotFoundException {
+        setTestAppEntry(mDisallowedPackage);
+        setDisallowedPackageName(mDisallowedPackage);
+        setApplicationInfo(/*no platform key*/false);
+        mEntry.hasLauncherEntry = false;
+
+        assertFalse(AppLocaleUtil.canDisplayLocaleUi(mContext, mEntry));
+    }
+
+    private void setTestAppEntry(String packageName) {
+        mEntry.info = mApplicationInfo;
+        mApplicationInfo.packageName = packageName;
+    }
+
+    private void setDisallowedPackageName(String packageName) {
+        when(mContext.getResources()).thenReturn(mResources);
+        when(mResources.getStringArray(anyInt())).thenReturn(new String[]{packageName});
+    }
+
+    private void setApplicationInfo(boolean signedWithPlatformKey)
+            throws PackageManager.NameNotFoundException {
+        ApplicationInfo applicationInfo = new ApplicationInfo();
+        if (signedWithPlatformKey) {
+            applicationInfo.privateFlags = applicationInfo.privateFlags
+                    | ApplicationInfo.PRIVATE_FLAG_SIGNED_WITH_PLATFORM_KEY;
+        }
+
+        PackageInfo packageInfo = new PackageInfo();
+        packageInfo.applicationInfo = applicationInfo;
+        when(mPackageManager.getPackageInfoAsUser(anyString(), anyInt(), anyInt())).thenReturn(
+                packageInfo);
+    }
+}
diff --git a/tests/unit/src/com/android/settings/applications/appinfo/AppLocaleDetailsTest.java b/tests/unit/src/com/android/settings/applications/appinfo/AppLocaleDetailsTest.java
index e185354..1042a6a 100644
--- a/tests/unit/src/com/android/settings/applications/appinfo/AppLocaleDetailsTest.java
+++ b/tests/unit/src/com/android/settings/applications/appinfo/AppLocaleDetailsTest.java
@@ -53,7 +53,6 @@
 
     private Context mContext;
     private LocaleList mSystemLocales;
-    private Locale mSimLocale;
     private LocaleList mAppLocale;
     private String[] mAssetLocales;
 
@@ -69,7 +68,8 @@
         when(mContext.getSystemService(LocaleManager.class)).thenReturn(mLocaleManager);
 
         setupInitialLocales("en",
-                "uk",
+                "tw",
+                "jp",
                 "en, uk, jp, ne",
                 new String[]{"en", "ne", "ms", "pa"});
     }
@@ -88,6 +88,8 @@
     @Test
     @UiThreadTest
     public void handleAllLocalesData_1stLocaleOfSuggestedLocaleListIsAppLocale() {
+        Locale simCountryLocale = new Locale("zh", "TW");
+        Locale networkCountryLocale = new Locale("ja", "JP");
         DummyAppLocaleDetailsHelper helper =
                 new DummyAppLocaleDetailsHelper(mContext, APP_PACKAGE_NAME);
 
@@ -95,25 +97,17 @@
 
         Locale locale = Iterables.get(helper.getSuggestedLocales(), 0);
         assertTrue(locale.equals(mAppLocale.get(0)));
+        assertTrue(helper.getSuggestedLocales().contains(simCountryLocale));
+        assertTrue(helper.getSuggestedLocales().contains(networkCountryLocale));
     }
 
     @Test
     @UiThreadTest
-    public void handleAllLocalesData_2ndLocaleOfSuggestedLocaleListIsSimLocale() {
-        DummyAppLocaleDetailsHelper helper =
-                new DummyAppLocaleDetailsHelper(mContext, APP_PACKAGE_NAME);
-
-        helper.handleAllLocalesData();
-
-        Locale locale = Iterables.get(helper.getSuggestedLocales(), 1);
-        assertTrue(locale.equals(mSimLocale));
-    }
-
-    @Test
-    @UiThreadTest
-    public void handleAllLocalesData_withoutAppLocale_1stLocaleOfSuggestedLocaleListIsSimLocal() {
+    public void handleAllLocalesData_withoutAppLocale_1stSuggestedLocaleIsSimCountryLocale() {
+        Locale simCountryLocale = new Locale("zh", "TW");
         setupInitialLocales("",
-                "uk",
+                "tw",
+                "",
                 "en, uk, jp, ne",
                 new String[]{"en", "ne", "ms", "pa"});
         DummyAppLocaleDetailsHelper helper =
@@ -122,14 +116,35 @@
         helper.handleAllLocalesData();
 
         Locale locale = Iterables.get(helper.getSuggestedLocales(), 0);
-        assertTrue(locale.equals(mSimLocale));
+        assertTrue(locale.equals(simCountryLocale));
+        assertFalse(helper.getSuggestedLocales().contains(mAppLocale.get(0)));
     }
 
     @Test
     @UiThreadTest
-    public void handleAllLocalesData_noAppAndSimLocale_1stLocaleIsFirstOneInSystemLocales() {
+    public void handleAllLocalesData_withoutAppLocale_1stSuggestedLocaleIsNetworkCountryLocale() {
+        Locale networkCountryLocale = new Locale("en", "GB");
         setupInitialLocales("",
                 "",
+                "gb",
+                "en, uk, jp, ne",
+                new String[]{"en", "ne", "ms", "pa"});
+        DummyAppLocaleDetailsHelper helper =
+                new DummyAppLocaleDetailsHelper(mContext, APP_PACKAGE_NAME);
+
+        helper.handleAllLocalesData();
+
+        Locale locale = Iterables.get(helper.getSuggestedLocales(), 0);
+        assertTrue(locale.equals(networkCountryLocale));
+        assertFalse(helper.getSuggestedLocales().contains(mAppLocale.get(0)));
+    }
+
+    @Test
+    @UiThreadTest
+    public void handleAllLocalesData_noAppAndSimNetworkLocale_1stLocaleIsFirstOneInSystemLocales() {
+        setupInitialLocales("",
+                "",
+                "",
                 "en, uk, jp, ne",
                 new String[]{"en", "ne", "ms", "pa"});
         DummyAppLocaleDetailsHelper helper =
@@ -175,25 +190,34 @@
     /**
      * Sets the initial Locale data
      *
-     * @param appLocale     Application locale, it shall be a language tag.
-     *                      example: "en"
-     * @param simLocale     SIM carrier locale, it shall be a language tag.
-     *                      example: "en"
-     * @param systemLocales System locales, a locale list by a multiple language tags with comma.
-     *                      example: "en, uk, jp"
-     * @param assetLocales  Asset locales, a locale list by a multiple language tags with String
-     *                      array.
-     *                      example: new String[] {"en", "ne", "ms", "pa"}
+     * @param appLocale      Application locale, it shall be a language tag.
+     *                       example: "en"
+     *
+     * @param simCountry     The ISO-3166-1 alpha-2 country code equivalent for the SIM
+     *                       provider's country code.
+     *                       example: "us"
+     *
+     * @param networkCountry The ISO-3166-1 alpha-2 country code equivalent of the MCC
+     *                       (Mobile Country Code) of the current registered operato
+     *                       or the cell nearby.
+     *                       example: "us"
+     *
+     * @param systemLocales  System locales, a locale list by a multiple language tags with comma.
+     *                       example: "en, uk, jp"
+     * @param assetLocales   Asset locales, a locale list by a multiple language tags with String
+     *                       array.
+     *                       example: new String[] {"en", "ne", "ms", "pa"}
      */
     private void setupInitialLocales(String appLocale,
-            String simLocale,
+            String simCountry,
+            String networkCountry,
             String systemLocales,
             String[] assetLocales) {
         mAppLocale = LocaleList.forLanguageTags(appLocale);
-        mSimLocale = Locale.forLanguageTag(simLocale);
         mSystemLocales = LocaleList.forLanguageTags(systemLocales);
         mAssetLocales = assetLocales;
-        when(mTelephonyManager.getSimLocale()).thenReturn(simLocale.isEmpty() ? null : mSimLocale);
+        when(mTelephonyManager.getSimCountryIso()).thenReturn(simCountry);
+        when(mTelephonyManager.getNetworkCountryIso()).thenReturn(networkCountry);
         when(mLocaleManager.getApplicationLocales(anyString())).thenReturn(mAppLocale);
     }
 
diff --git a/tests/unit/src/com/android/settings/applications/appinfo/AppLocalePreferenceControllerTest.java b/tests/unit/src/com/android/settings/applications/appinfo/AppLocalePreferenceControllerTest.java
index d7e3f92..526b6cc 100644
--- a/tests/unit/src/com/android/settings/applications/appinfo/AppLocalePreferenceControllerTest.java
+++ b/tests/unit/src/com/android/settings/applications/appinfo/AppLocalePreferenceControllerTest.java
@@ -18,8 +18,6 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
-import static org.mockito.Mockito.spy;
-
 import android.content.Context;
 import android.util.FeatureFlagUtils;
 
@@ -37,20 +35,27 @@
 public class AppLocalePreferenceControllerTest {
 
     private Context mContext;
+    private boolean mCanDisplayLocaleUi;
     private AppLocalePreferenceController mController;
 
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
-        mContext = spy(ApplicationProvider.getApplicationContext());
+        mContext = ApplicationProvider.getApplicationContext();
 
-        mController = spy(new AppLocalePreferenceController(mContext, "test_key"));
+        mController = new AppLocalePreferenceController(mContext, "test_key") {
+            @Override
+            boolean canDisplayLocaleUi() {
+                return mCanDisplayLocaleUi;
+            }
+        };
         FeatureFlagUtils
                 .setEnabled(mContext, FeatureFlagUtils.SETTINGS_APP_LANGUAGE_SELECTION, true);
     }
 
     @Test
-    public void getAvailabilityStatus_featureFlagOff_shouldReturnUnavailable() {
+    public void getAvailabilityStatus_canShowUiButFeatureFlagOff_shouldReturnUnavailable() {
+        mCanDisplayLocaleUi = true;
         FeatureFlagUtils
                 .setEnabled(mContext, FeatureFlagUtils.SETTINGS_APP_LANGUAGE_SELECTION, false);
 
@@ -59,8 +64,28 @@
     }
 
     @Test
-    public void getAvailabilityStatus_featureFlagOn_shouldReturnAvailable() {
+    public void getAvailabilityStatus_canShowUiAndFeatureFlagOn_shouldReturnAvailable() {
+        mCanDisplayLocaleUi = true;
+
         assertThat(mController.getAvailabilityStatus())
                 .isEqualTo(BasePreferenceController.AVAILABLE);
     }
+
+    @Test
+    public void getAvailabilityStatus_featureFlagOnButCanNotShowUi_shouldReturnUnavailable() {
+        mCanDisplayLocaleUi = false;
+
+        assertThat(mController.getAvailabilityStatus())
+                .isEqualTo(BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_featureFlagOffAndCanNotShowUi_shouldReturnUnavailable() {
+        mCanDisplayLocaleUi = false;
+        FeatureFlagUtils
+                .setEnabled(mContext, FeatureFlagUtils.SETTINGS_APP_LANGUAGE_SELECTION, false);
+
+        assertThat(mController.getAvailabilityStatus())
+                .isEqualTo(BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
+    }
 }
