Merge "Add strings used for setupwizard lockscreen skip dialog" into qt-dev
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 68a7cbb..6d3c207 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2819,30 +2819,6 @@
             </intent-filter>
         </activity>
 
-        <activity
-            android:name="Settings$AdvancedAppsActivity"
-            android:exported="true"
-            android:label="@string/app_default_dashboard_title"
-            android:parentActivityName="Settings">
-            <intent-filter android:priority="1">
-                <action android:name="android.settings.MANAGE_DEFAULT_APPS_SETTINGS" />
-                <action android:name="android.settings.HOME_SETTINGS" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
-            <intent-filter>
-                <action android:name="com.android.settings.action.SETTINGS"/>
-            </intent-filter>
-            <meta-data android:name="com.android.settings.order" android:value="-120"/>
-            <meta-data android:name="com.android.settings.category"
-                       android:value="com.android.settings.category.ia.apps"/>
-            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
-                       android:value="com.android.settings.applications.DefaultAppSettings" />
-            <meta-data android:name="com.android.settings.summary"
-                       android:resource="@string/summary_empty"/>
-            <meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"
-                       android:value="true" />
-        </activity>
-
         <!-- Keep compatibility with old WebView-picker implementation -->
         <activity-alias android:name=".WebViewImplementation"
                   android:targetActivity="Settings$WebViewAppPickerActivity"
diff --git a/res/values/config.xml b/res/values/config.xml
index eaa2b3e..cdf2810 100755
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -320,9 +320,6 @@
     <!-- Whether wallpaper attribution should be shown or not. -->
     <bool name="config_show_wallpaper_attribution">true</bool>
 
-    <!-- Whether default_home should be shown or not. -->
-    <bool name="config_show_default_home">true</bool>
-
     <!-- Whether assist_and_voice_input should be shown or not. -->
     <bool name="config_show_assist_and_voice_input">true</bool>
 
diff --git a/res/values/strings.xml b/res/values/strings.xml
index aaf3bdc..7180a0f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7182,10 +7182,8 @@
     <!-- Search keyword for "Flashlight" settings [CHAR_LIMIT=NONE]-->
     <string name="keywords_flashlight">Flashlight, Light, Torch</string>
     <string name="keywords_change_wifi_state">wifi, wi-fi, toggle, control</string>
-    <string name="keywords_more_default_sms_app">text message, texting, messages, messaging, default</string>
     <string name="keywords_more_mobile_networks">cellular, mobile, cell carrier, wireless, data, 4g,3g, 2g, lte</string>
     <string name="keywords_wifi_calling">wifi, wi-fi, call, calling</string>
-    <string name="keywords_home">launcher, default, apps</string>
     <string name="keywords_display">screen, touchscreen</string>
     <string name="keywords_display_brightness_level">dim screen, touchscreen, battery, bright</string>
     <string name="keywords_display_night_display">dim screen, night, tint, night shift, brightness, screen color, colour, color</string>
@@ -7210,8 +7208,6 @@
     <string name="keywords_users">restriction, restrict, restricted</string>
     <string name="keywords_keyboard_and_ime">text correction, correct, sound, vibrate, auto, language, gesture, suggest, suggestion, theme, offensive, word, type, emoji, international</string>
     <string name="keywords_reset_apps">reset, preferences, default</string>
-    <string name="keywords_emergency_app">emergency, ice, app, default</string>
-    <string name="keywords_default_phone_app">phone, dialer, default</string>
     <string name="keywords_all_apps">apps, download, applications, system</string>
     <string name="keywords_app_permissions">apps, permissions, security</string>
     <string name="keywords_default_apps">apps, default</string>
@@ -7283,15 +7279,9 @@
     <!-- List of synonyms for the Default Assist and Voice input setting, used to match in settings search [CHAR LIMIT=NONE] -->
     <string name="keywords_assist_input">default, assistant</string>
 
-    <!-- List of synonyms for the Wallpaper picker setting, used to match in settings search [CHAR LIMIT=NONE] -->
-    <string name="keywords_default_browser">default, default browser</string>
-
     <!-- List of synonyms for the default payment app setting, used to match in settings search [CHAR LIMIT=NONE] -->
     <string name="keywords_default_payment_app">payment, default</string>
 
-    <!-- List of synonyms for the default links setting, used to match in settings search [CHAR LIMIT=NONE] -->
-    <string name="keywords_default_links">default</string>
-
     <!-- List of synonyms for Ambient display setting (when the screen is off), used to match in settings search [CHAR LIMIT=NONE] -->
     <string name="keywords_ambient_display">incoming notification</string>
 
diff --git a/res/xml/app_and_notification.xml b/res/xml/app_and_notification.xml
index fd3725a..cdeb35e 100644
--- a/res/xml/app_and_notification.xml
+++ b/res/xml/app_and_notification.xml
@@ -51,6 +51,14 @@
         android:order="10"/>
 
     <Preference
+        android:key="default_apps"
+        android:title="@string/app_default_dashboard_title"
+        android:order="11"
+        settings:controller="com.android.settings.applications.DefaultAppsPreferenceController">
+        <intent android:action="android.settings.MANAGE_DEFAULT_APPS_SETTINGS"/>
+    </Preference>
+
+    <Preference
         android:key="manage_perms"
         android:title="@string/app_permissions"
         android:order="12"
diff --git a/res/xml/app_default_settings.xml b/res/xml/app_default_settings.xml
deleted file mode 100644
index 1f1b24a..0000000
--- a/res/xml/app_default_settings.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2016 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
-<PreferenceScreen
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:settings="http://schemas.android.com/apk/res-auto"
-    android:key="app_default_settings_screen"
-    android:title="@string/app_default_dashboard_title"
-    settings:keywords="@string/keywords_app_default">
-
-    <com.android.settingslib.widget.apppreference.AppPreference
-        android:key="assist_and_voice_input"
-        android:title="@string/assist_and_voice_input_title"
-        android:fragment="com.android.settings.applications.assist.ManageAssist"
-        settings:searchable="false"/>
-
-    <com.android.settingslib.widget.apppreference.AppPreference
-        android:key="default_browser"
-        android:title="@string/default_browser_title"
-        android:fragment="com.android.settings.applications.defaultapps.DefaultBrowserPicker"
-        settings:keywords="@string/keywords_default_browser">
-        <extra android:name="for_work" android:value="false" />
-    </com.android.settingslib.widget.apppreference.AppPreference>
-
-    <com.android.settingslib.widget.apppreference.AppPreference
-        android:key="default_home"
-        android:title="@string/home_app"
-        android:fragment="com.android.settings.applications.defaultapps.DefaultHomePicker"
-        settings:keywords="@string/keywords_home" />
-
-    <com.android.settingslib.widget.apppreference.AppPreference
-        android:key="default_phone_app"
-        android:title="@string/default_phone_title"
-        android:fragment="com.android.settings.applications.defaultapps.DefaultPhonePicker"
-        settings:keywords="@string/keywords_default_phone_app" />
-
-    <com.android.settingslib.widget.apppreference.AppPreference
-        android:key="default_sms_app"
-        android:title="@string/sms_application_title"
-        android:fragment="com.android.settings.applications.defaultapps.DefaultSmsPicker"
-        settings:keywords="@string/keywords_more_default_sms_app" />
-
-    <com.android.settingslib.widget.apppreference.AppPreference
-        android:key="default_payment_app"
-        android:title="@string/nfc_payment_settings_title"
-        android:summary="@string/summary_placeholder"
-        android:fragment="com.android.settings.nfc.PaymentSettings"
-        settings:keywords="@string/keywords_default_payment_app"/>
-
-    <com.android.settingslib.widget.apppreference.AppPreference
-        android:key="default_emergency_app"
-        android:title="@string/default_emergency_app"
-        settings:keywords="@string/keywords_emergency_app" />
-
-    <!--
-    <com.android.settingslib.widget.apppreference.AppPreference
-        android:key="default_notification_asst_app"
-        android:title="@string/default_notification_assistant"
-        android:fragment="com.android.settings.applications.defaultapps.DefaultNotificationAssistantPicker"
-        />
-     -->
-
-    <com.android.settingslib.widget.apppreference.AppPreference
-        android:key="domain_urls"
-        android:title="@string/domain_urls_title"
-        android:fragment="com.android.settings.applications.managedomainurls.ManageDomainUrls"
-        settings:keywords="@string/keywords_default_links"/>
-
-    <!--
-     ~ STOPSHIP(b/110557011): Remove once the new UI is ready.
-     -->
-    <Preference
-        android:key="roles"
-        android:title="@string/roles_title"
-        settings:controller="com.android.settings.applications.defaultapps.RolesPreferenceController" />
-
-    <com.android.settings.widget.WorkOnlyCategory
-        android:key="work_app_defaults"
-        android:title="@string/default_for_work">
-
-        <com.android.settingslib.widget.apppreference.AppPreference
-            android:key="work_default_browser"
-            android:title="@string/default_browser_title"
-            android:fragment="com.android.settings.applications.defaultapps.DefaultBrowserPicker"
-            settings:searchable="false">
-            <extra android:name="for_work" android:value="true" />
-        </com.android.settingslib.widget.apppreference.AppPreference>
-
-        <com.android.settingslib.widget.apppreference.AppPreference
-            android:key="work_default_phone_app"
-            android:title="@string/default_phone_title"
-            android:fragment="com.android.settings.applications.defaultapps.DefaultPhonePicker"
-            settings:searchable="false">
-            <extra android:name="for_work" android:value="true" />
-        </com.android.settingslib.widget.apppreference.AppPreference>
-
-    </com.android.settings.widget.WorkOnlyCategory>
-
-</PreferenceScreen>
diff --git a/res/xml/default_assist_settings.xml b/res/xml/default_assist_settings.xml
deleted file mode 100644
index e1f5900..0000000
--- a/res/xml/default_assist_settings.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2017 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/default_assist_title" />
diff --git a/res/xml/default_browser_settings.xml b/res/xml/default_browser_settings.xml
deleted file mode 100644
index a319a7c..0000000
--- a/res/xml/default_browser_settings.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2017 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/default_browser_title" />
diff --git a/res/xml/default_emergency_settings.xml b/res/xml/default_emergency_settings.xml
deleted file mode 100644
index db418eb..0000000
--- a/res/xml/default_emergency_settings.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2017 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/default_emergency_app" />
diff --git a/res/xml/default_home_settings.xml b/res/xml/default_home_settings.xml
deleted file mode 100644
index 136f8cc..0000000
--- a/res/xml/default_home_settings.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2017 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/home_app" />
diff --git a/res/xml/default_phone_settings.xml b/res/xml/default_phone_settings.xml
deleted file mode 100644
index 1ae3ab1..0000000
--- a/res/xml/default_phone_settings.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2017 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/default_phone_title" />
diff --git a/res/xml/default_sms_settings.xml b/res/xml/default_sms_settings.xml
deleted file mode 100644
index 0a8bcc3..0000000
--- a/res/xml/default_sms_settings.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2017 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/sms_application_title" />
diff --git a/res/xml/special_access.xml b/res/xml/special_access.xml
index 9be01f9..cb97fee 100644
--- a/res/xml/special_access.xml
+++ b/res/xml/special_access.xml
@@ -85,6 +85,13 @@
         settings:controller="com.android.settings.applications.specialaccess.premiumsms.PremiumSmsController" />
 
     <Preference
+        android:key="default_payment_app"
+        android:title="@string/nfc_payment_settings_title"
+        android:fragment="com.android.settings.nfc.PaymentSettings"
+        settings:keywords="@string/keywords_default_payment_app"
+        settings:controller="com.android.settings.applications.specialaccess.DefaultPaymentSettingsPreferenceController" />
+
+    <Preference
         android:key="data_saver"
         android:title="@string/unrestricted_data_saver"
         android:fragment="com.android.settings.datausage.UnrestrictedDataAccess"
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index e1c9aff..90ffc5a 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -136,7 +136,6 @@
     public static class ChangeWifiStateActivity extends SettingsActivity { /* empty */ }
     public static class AppDrawOverlaySettingsActivity extends SettingsActivity { /* empty */ }
     public static class AppWriteSettingsActivity extends SettingsActivity { /* empty */ }
-    public static class AdvancedAppsActivity extends SettingsActivity { /* empty */ }
 
     public static class ManageExternalSourcesActivity extends SettingsActivity {/* empty */ }
     public static class ManageAppExternalSourcesActivity extends SettingsActivity { /* empty */ }
diff --git a/src/com/android/settings/applications/DefaultAppSettings.java b/src/com/android/settings/applications/DefaultAppSettings.java
deleted file mode 100644
index 353d867..0000000
--- a/src/com/android/settings/applications/DefaultAppSettings.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2017 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.Activity;
-import android.app.settings.SettingsEnums;
-import android.content.Context;
-import android.icu.text.ListFormatter;
-import android.provider.SearchIndexableResource;
-import android.text.TextUtils;
-
-import com.android.settings.R;
-import com.android.settings.applications.assist.DefaultAssistPreferenceController;
-import com.android.settings.applications.defaultapps.DefaultBrowserPreferenceController;
-import com.android.settings.applications.defaultapps.DefaultEmergencyPreferenceController;
-import com.android.settings.applications.defaultapps.DefaultHomePreferenceController;
-import com.android.settings.applications.defaultapps.DefaultPaymentSettingsPreferenceController;
-import com.android.settings.applications.defaultapps.DefaultPhonePreferenceController;
-import com.android.settings.applications.defaultapps.DefaultSmsPreferenceController;
-import com.android.settings.applications.defaultapps.DefaultWorkBrowserPreferenceController;
-import com.android.settings.applications.defaultapps.DefaultWorkPhonePreferenceController;
-import com.android.settings.dashboard.DashboardFragment;
-import com.android.settings.dashboard.SummaryLoader;
-import com.android.settings.search.BaseSearchIndexProvider;
-import com.android.settings.search.Indexable;
-import com.android.settings.widget.PreferenceCategoryController;
-import com.android.settingslib.core.AbstractPreferenceController;
-import com.android.settingslib.search.SearchIndexable;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-@SearchIndexable
-public class DefaultAppSettings extends DashboardFragment {
-
-    static final String TAG = "DefaultAppSettings";
-
-    private static final String KEY_DEFAULT_WORK_CATEGORY = "work_app_defaults";
-    private static final String KEY_ASSIST_VOICE_INPUT = "assist_and_voice_input";
-
-    @Override
-    protected String getLogTag() {
-        return TAG;
-    }
-
-    @Override
-    protected int getPreferenceScreenResId() {
-        return R.xml.app_default_settings;
-    }
-
-    @Override
-    protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
-        return buildPreferenceControllers(context);
-    }
-
-    @Override
-    public int getMetricsCategory() {
-        return SettingsEnums.APPLICATIONS_ADVANCED;
-    }
-
-    private static List<AbstractPreferenceController> buildPreferenceControllers(Context context) {
-        final List<AbstractPreferenceController> controllers = new ArrayList<>();
-        final List<AbstractPreferenceController> workControllers = new ArrayList<>();
-        workControllers.add(new DefaultWorkPhonePreferenceController(context));
-        workControllers.add(new DefaultWorkBrowserPreferenceController(context));
-        controllers.addAll(workControllers);
-        controllers.add(new PreferenceCategoryController(
-                context, KEY_DEFAULT_WORK_CATEGORY).setChildren(workControllers));
-        controllers.add(new DefaultAssistPreferenceController(context, KEY_ASSIST_VOICE_INPUT,
-                false /* showSetting */));
-        controllers.add(new DefaultBrowserPreferenceController(context));
-        controllers.add(new DefaultPhonePreferenceController(context));
-        controllers.add(new DefaultSmsPreferenceController(context));
-        controllers.add(new DefaultEmergencyPreferenceController(context));
-        controllers.add(new DefaultHomePreferenceController(context));
-        controllers.add(new DefaultPaymentSettingsPreferenceController(context));
-        return controllers;
-    }
-
-    public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
-            new BaseSearchIndexProvider() {
-                @Override
-                public List<SearchIndexableResource> getXmlResourcesToIndex(
-                        Context context, boolean enabled) {
-                    final SearchIndexableResource sir = new SearchIndexableResource(context);
-                    sir.xmlResId = R.xml.app_default_settings;
-                    return Arrays.asList(sir);
-                }
-
-                @Override
-                public List<AbstractPreferenceController> createPreferenceControllers(
-                        Context context) {
-                    return buildPreferenceControllers(context);
-                }
-            };
-
-    static class SummaryProvider implements SummaryLoader.SummaryProvider {
-
-        private final Context mContext;
-        private final SummaryLoader mSummaryLoader;
-        private final DefaultSmsPreferenceController mDefaultSmsPreferenceController;
-        private final DefaultBrowserPreferenceController mDefaultBrowserPreferenceController;
-        private final DefaultPhonePreferenceController mDefaultPhonePreferenceController;
-
-        public SummaryProvider(Context context, SummaryLoader summaryLoader) {
-            mContext = context;
-            mSummaryLoader = summaryLoader;
-            mDefaultSmsPreferenceController = new DefaultSmsPreferenceController(mContext);
-            mDefaultBrowserPreferenceController = new DefaultBrowserPreferenceController(mContext);
-            mDefaultPhonePreferenceController = new DefaultPhonePreferenceController(mContext);
-        }
-
-        @Override
-        public void setListening(boolean listening) {
-            if (!listening) {
-                return;
-            }
-            final List<CharSequence> summaries = new ArrayList<>();
-            if(!TextUtils.isEmpty(mDefaultBrowserPreferenceController.getDefaultAppLabel())) {
-                summaries.add(mDefaultBrowserPreferenceController.getDefaultAppLabel());
-            }
-            if(!TextUtils.isEmpty(mDefaultPhonePreferenceController.getDefaultAppLabel())) {
-                summaries.add(mDefaultPhonePreferenceController.getDefaultAppLabel());
-            }
-            if(!TextUtils.isEmpty(mDefaultSmsPreferenceController.getDefaultAppLabel())) {
-                summaries.add(mDefaultSmsPreferenceController.getDefaultAppLabel());
-            }
-
-            CharSequence summary = ListFormatter.getInstance().format(summaries);
-            if (!TextUtils.isEmpty(summary)) {
-                mSummaryLoader.setSummary(this, summary);
-            }
-        }
-    }
-
-    public static final SummaryLoader.SummaryProviderFactory SUMMARY_PROVIDER_FACTORY =
-            new SummaryLoader.SummaryProviderFactory() {
-                @Override
-                public SummaryLoader.SummaryProvider createSummaryProvider(Activity activity,
-                        SummaryLoader summaryLoader) {
-                    return new DefaultAppSettings.SummaryProvider(activity, summaryLoader);
-                }
-            };
-}
diff --git a/src/com/android/settings/applications/defaultapps/RolesPreferenceController.java b/src/com/android/settings/applications/DefaultAppsPreferenceController.java
similarity index 67%
rename from src/com/android/settings/applications/defaultapps/RolesPreferenceController.java
rename to src/com/android/settings/applications/DefaultAppsPreferenceController.java
index c7cab15..4d4165b 100644
--- a/src/com/android/settings/applications/defaultapps/RolesPreferenceController.java
+++ b/src/com/android/settings/applications/DefaultAppsPreferenceController.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018 The Android Open Source Project
+ * Copyright (C) 2019 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.
@@ -11,66 +11,38 @@
  * 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.
+ * limitations under the License
  */
 
-package com.android.settings.applications.defaultapps;
+package com.android.settings.applications;
 
 import android.app.role.RoleManager;
 import android.content.Context;
-import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.icu.text.ListFormatter;
-import android.provider.Settings;
 import android.text.TextUtils;
 
-import androidx.preference.Preference;
-
 import com.android.settings.core.BasePreferenceController;
 import com.android.settingslib.applications.AppUtils;
 
 import java.util.ArrayList;
 import java.util.List;
 
-/**
- * STOPSHIP(b/110557011): Remove once the new UI is ready.
- */
-public class RolesPreferenceController extends BasePreferenceController {
+public class DefaultAppsPreferenceController extends BasePreferenceController {
 
     private final PackageManager mPackageManager;
     private final RoleManager mRoleManager;
 
-    private final Intent mIntent;
-
-    public RolesPreferenceController(Context context, String preferenceKey) {
+    public DefaultAppsPreferenceController(Context context, String preferenceKey) {
         super(context, preferenceKey);
 
         mPackageManager = context.getPackageManager();
         mRoleManager = context.getSystemService(RoleManager.class);
-
-        final String packageName = mPackageManager.getPermissionControllerPackageName();
-        if (packageName != null) {
-            mIntent = new Intent(Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS)
-                    .setPackage(packageName);
-        } else {
-            mIntent = null;
-        }
     }
 
     @Override
     public int getAvailabilityStatus() {
-        return mIntent != null ? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE;
-    }
-
-    @Override
-    public boolean handlePreferenceTreeClick(Preference preference) {
-        if (TextUtils.equals(preference.getKey(), mPreferenceKey)) {
-            if (mIntent != null) {
-                mContext.startActivity(mIntent);
-            }
-            return true;
-        }
-        return false;
+        return AVAILABLE;
     }
 
     @Override
diff --git a/src/com/android/settings/applications/defaultapps/DefaultBrowserPicker.java b/src/com/android/settings/applications/defaultapps/DefaultBrowserPicker.java
deleted file mode 100644
index 40ea25e..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultBrowserPicker.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.app.settings.SettingsEnums;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-
-import com.android.settings.R;
-import com.android.settingslib.applications.DefaultAppInfo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Fragment for choosing default browser.
- */
-public class DefaultBrowserPicker extends DefaultAppPickerFragment {
-
-    @Override
-    protected int getPreferenceScreenResId() {
-        return R.xml.default_browser_settings;
-    }
-
-    @Override
-    public int getMetricsCategory() {
-        return SettingsEnums.DEFAULT_BROWSER_PICKER;
-    }
-
-    @Override
-    protected String getDefaultKey() {
-        return mPm.getDefaultBrowserPackageNameAsUser(mUserId);
-    }
-
-    @Override
-    protected boolean setDefaultKey(String packageName) {
-        return mPm.setDefaultBrowserPackageNameAsUser(packageName, mUserId);
-    }
-
-    @Override
-    protected List<DefaultAppInfo> getCandidates() {
-        final List<DefaultAppInfo> candidates = new ArrayList<>();
-        final Context context = getContext();
-        // Resolve that intent and check that the handleAllWebDataURI boolean is set
-        final List<ResolveInfo> list =
-            DefaultBrowserPreferenceController.getCandidates(mPm, mUserId);
-
-        for (ResolveInfo info : list) {
-            try {
-                candidates.add(new DefaultAppInfo(context, mPm, mUserId,
-                        mPm.getApplicationInfoAsUser(info.activityInfo.packageName, 0, mUserId)));
-            } catch (PackageManager.NameNotFoundException e) {
-                // Skip unknown packages.
-            }
-        }
-
-        return candidates;
-    }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceController.java
deleted file mode 100644
index 6cd72f7..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceController.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.ComponentInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.graphics.drawable.Drawable;
-import android.net.Uri;
-import android.text.TextUtils;
-import android.util.ArraySet;
-import android.util.IconDrawableFactory;
-import android.util.Log;
-
-import androidx.annotation.VisibleForTesting;
-import androidx.preference.Preference;
-
-import com.android.settingslib.applications.DefaultAppInfo;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-public class DefaultBrowserPreferenceController extends DefaultAppPreferenceController {
-
-    private static final String TAG = "BrowserPrefCtrl";
-
-    static final Intent BROWSE_PROBE = new Intent()
-            .setAction(Intent.ACTION_VIEW)
-            .addCategory(Intent.CATEGORY_BROWSABLE)
-            .setData(Uri.parse("http:"))
-            .addFlags(Intent.FLAG_IGNORE_EPHEMERAL);
-
-    public DefaultBrowserPreferenceController(Context context) {
-        super(context);
-    }
-
-    @Override
-    public boolean isAvailable() {
-        final List<ResolveInfo> candidates = getCandidates(mPackageManager, mUserId);
-        return candidates != null && !candidates.isEmpty();
-    }
-
-    @Override
-    public String getPreferenceKey() {
-        return "default_browser";
-    }
-
-    @Override
-    public void updateState(Preference preference) {
-        super.updateState(preference);
-        final CharSequence defaultAppLabel = getDefaultAppLabel();
-        if (!TextUtils.isEmpty(defaultAppLabel)) {
-            preference.setSummary(defaultAppLabel);
-        }
-    }
-
-    @Override
-    protected DefaultAppInfo getDefaultAppInfo() {
-        try {
-            final String packageName = mPackageManager.getDefaultBrowserPackageNameAsUser(mUserId);
-            Log.d(TAG, "Get default browser package: " + packageName);
-            return new DefaultAppInfo(mContext, mPackageManager, mUserId,
-                    mPackageManager.getApplicationInfoAsUser(packageName, 0, mUserId));
-        } catch (PackageManager.NameNotFoundException e) {
-            return null;
-        }
-    }
-
-    @Override
-    public CharSequence getDefaultAppLabel() {
-        if (!isAvailable()) {
-            return null;
-        }
-        final DefaultAppInfo defaultApp = getDefaultAppInfo();
-        final CharSequence defaultAppLabel = defaultApp != null ? defaultApp.loadLabel() : null;
-        if (!TextUtils.isEmpty(defaultAppLabel)) {
-            return defaultAppLabel;
-        }
-        return getOnlyAppLabel();
-    }
-
-    @Override
-    public Drawable getDefaultAppIcon() {
-        if (!isAvailable()) {
-            return null;
-        }
-        final DefaultAppInfo defaultApp = getDefaultAppInfo();
-        if (defaultApp != null) {
-            return defaultApp.loadIcon();
-        }
-        return getOnlyAppIcon();
-    }
-
-    static List<ResolveInfo> getCandidates(PackageManager packageManager, int userId) {
-        final List<ResolveInfo> candidates = new ArrayList<>();
-        // Resolve that intent and check that the handleAllWebDataURI boolean is set
-        final List<ResolveInfo> list = packageManager.queryIntentActivitiesAsUser(
-            BROWSE_PROBE, PackageManager.MATCH_ALL, userId);
-        if (list != null) {
-            final Set<String> addedPackages = new ArraySet<>();
-            for (ResolveInfo info : list) {
-                if (!info.handleAllWebDataURI || info.activityInfo == null
-                        || !info.activityInfo.enabled
-                        || !info.activityInfo.applicationInfo.enabled) {
-                    continue;
-                }
-                final String packageName = info.activityInfo.packageName;
-                if (addedPackages.contains(packageName)) {
-                    continue;
-                }
-                candidates.add(info);
-                addedPackages.add(packageName);
-            }
-        }
-        return candidates;
-    }
-
-    private String getOnlyAppLabel() {
-        // Resolve that intent and check that the handleAllWebDataURI boolean is set
-        final List<ResolveInfo> list = getCandidates(mPackageManager, mUserId);
-        if (list != null && list.size() == 1) {
-            final ResolveInfo info = list.get(0);
-            final String label = info.loadLabel(mPackageManager).toString();
-            final ComponentInfo cn = info.getComponentInfo();
-            final String packageName = cn == null ? null : cn.packageName;
-            Log.d(TAG, "Getting label for the only browser app: " + packageName + label);
-            return label;
-        }
-        return null;
-    }
-
-    @VisibleForTesting
-    Drawable getOnlyAppIcon() {
-        final List<ResolveInfo> list = getCandidates(mPackageManager, mUserId);
-        if (list != null && list.size() == 1) {
-            final ResolveInfo info = list.get(0);
-            final ComponentInfo cn = info.getComponentInfo();
-            final String packageName = cn == null ? null : cn.packageName;
-            if (TextUtils.isEmpty(packageName)) {
-                return null;
-            }
-            final ApplicationInfo appInfo;
-            try {
-                appInfo = mPackageManager.getApplicationInfoAsUser(packageName, 0, mUserId);
-            } catch (PackageManager.NameNotFoundException e) {
-                Log.w(TAG, "Error getting app info for " + packageName);
-                return null;
-            }
-            Log.d(TAG, "Getting icon for the only browser app: " + packageName);
-            final IconDrawableFactory iconFactory = IconDrawableFactory.newInstance(mContext);
-            return iconFactory.getBadgedIcon(cn, appInfo, mUserId);
-        }
-        return null;
-    }
-
-    /**
-     * Whether or not the pkg contains browser capability
-     */
-    public static boolean hasBrowserPreference(String pkg, Context context, int userId) {
-        final Intent intent = new Intent(BROWSE_PROBE);
-        intent.setPackage(pkg);
-        final List<ResolveInfo> resolveInfos = context.getPackageManager()
-                .queryIntentActivitiesAsUser(intent, 0 /* flags */, userId);
-        return resolveInfos != null && resolveInfos.size() != 0;
-    }
-
-    /**
-     * Whether or not the pkg is the default browser
-     */
-    public boolean isBrowserDefault(String pkg, int userId) {
-        final String defaultPackage = mPackageManager.getDefaultBrowserPackageNameAsUser(userId);
-        if (defaultPackage != null) {
-            return defaultPackage.equals(pkg);
-        }
-
-        final List<ResolveInfo> list = getCandidates(mPackageManager, userId);
-        // There is only 1 app, it must be the default browser.
-        return list != null && list.size() == 1;
-    }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultEmergencyPicker.java b/src/com/android/settings/applications/defaultapps/DefaultEmergencyPicker.java
deleted file mode 100644
index 32cc9a8..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultEmergencyPicker.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.app.role.RoleManager;
-import android.app.settings.SettingsEnums;
-import android.content.Context;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.os.AsyncTask;
-import android.os.Process;
-import android.text.TextUtils;
-import android.util.Log;
-
-import com.android.internal.util.CollectionUtils;
-import com.android.settings.R;
-import com.android.settings.Utils;
-import com.android.settingslib.applications.DefaultAppInfo;
-import com.android.settingslib.widget.CandidateInfo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class DefaultEmergencyPicker extends DefaultAppPickerFragment {
-    private static final String TAG = "DefaultEmergencyPicker";
-    @Override
-    public int getMetricsCategory() {
-        return SettingsEnums.DEFAULT_EMERGENCY_APP_PICKER;
-    }
-
-    @Override
-    protected int getPreferenceScreenResId() {
-        return R.xml.default_emergency_settings;
-    }
-
-    @Override
-    protected List<DefaultAppInfo> getCandidates() {
-        final List<DefaultAppInfo> candidates = new ArrayList<>();
-        final List<ResolveInfo> infos = mPm.queryIntentActivities(
-                DefaultEmergencyPreferenceController.QUERY_INTENT, 0);
-        PackageInfo bestMatch = null;
-        final Context context = getContext();
-        for (ResolveInfo info : infos) {
-            try {
-                final PackageInfo packageInfo =
-                        mPm.getPackageInfo(info.activityInfo.packageName, 0);
-                final ApplicationInfo appInfo = packageInfo.applicationInfo;
-                candidates.add(new DefaultAppInfo(context, mPm, mUserId, appInfo));
-                // Get earliest installed system app.
-                if (isSystemApp(appInfo) && (bestMatch == null ||
-                        bestMatch.firstInstallTime > packageInfo.firstInstallTime)) {
-                    bestMatch = packageInfo;
-                }
-            } catch (PackageManager.NameNotFoundException e) {
-                // Skip unknown packages.
-            }
-            if (bestMatch != null) {
-                final String defaultKey = getDefaultKey();
-                if (TextUtils.isEmpty(defaultKey)) {
-                    setDefaultKey(bestMatch.packageName);
-                }
-            }
-        }
-        return candidates;
-    }
-
-    @Override
-    protected String getConfirmationMessage(CandidateInfo info) {
-        return Utils.isPackageDirectBootAware(getContext(), info.getKey()) ? null
-                : getContext().getString(R.string.direct_boot_unaware_dialog_message);
-    }
-
-    @Override
-    protected String getDefaultKey() {
-        RoleManager roleManager = getContext().getSystemService(RoleManager.class);
-        return CollectionUtils.firstOrNull(roleManager.getRoleHolders(RoleManager.ROLE_EMERGENCY));
-    }
-
-    @Override
-    protected boolean setDefaultKey(String key) {
-        final String previousValue = getDefaultKey();
-
-        if (!TextUtils.isEmpty(key) && !TextUtils.equals(key, previousValue)) {
-            getContext().getSystemService(RoleManager.class).addRoleHolderAsUser(
-                    RoleManager.ROLE_EMERGENCY, key, 0, Process.myUserHandle(),
-                    AsyncTask.THREAD_POOL_EXECUTOR, successful -> {
-                        if (!successful) {
-                            Log.e(TAG, "Failed to set emergency default app.");
-                        }
-                    });
-            return true;
-        }
-        return false;
-    }
-
-    private boolean isSystemApp(ApplicationInfo info) {
-        return info != null && (info.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
-    }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultEmergencyPreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultEmergencyPreferenceController.java
deleted file mode 100644
index 425b216..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultEmergencyPreferenceController.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.app.role.RoleManager;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.ResolveInfo;
-import android.provider.Settings;
-import android.telephony.TelephonyManager;
-
-import com.android.internal.util.CollectionUtils;
-import com.android.settingslib.applications.DefaultAppInfo;
-
-import java.util.List;
-
-public class DefaultEmergencyPreferenceController extends DefaultAppPreferenceController {
-
-    private static final boolean DEFAULT_EMERGENCY_APP_IS_CONFIGURABLE = false;
-
-    public static final Intent QUERY_INTENT = new Intent(
-            TelephonyManager.ACTION_EMERGENCY_ASSISTANCE);
-
-    public DefaultEmergencyPreferenceController(Context context) {
-        super(context);
-    }
-
-    @Override
-    public boolean isAvailable() {
-        return DEFAULT_EMERGENCY_APP_IS_CONFIGURABLE
-                && isCapable()
-                && mPackageManager.resolveActivity(QUERY_INTENT, 0) != null;
-    }
-
-    @Override
-    public String getPreferenceKey() {
-        return "default_emergency_app";
-    }
-
-    @Override
-    protected DefaultAppInfo getDefaultAppInfo() {
-        return null;
-    }
-
-    private boolean isCapable() {
-        return TelephonyManager.EMERGENCY_ASSISTANCE_ENABLED
-                && mContext.getResources().getBoolean(
-                com.android.internal.R.bool.config_voice_capable);
-    }
-
-    public static boolean hasEmergencyPreference(String pkg, Context context) {
-        Intent i = new Intent(QUERY_INTENT);
-        i.setPackage(pkg);
-        final List<ResolveInfo> resolveInfos =
-                context.getPackageManager().queryIntentActivities(i, 0);
-        return resolveInfos != null && resolveInfos.size() != 0;
-    }
-
-    public static boolean isEmergencyDefault(String pkg, Context context) {
-      String defaultPackage = CollectionUtils.firstOrNull(
-              context.getSystemService(RoleManager.class)
-                        .getRoleHolders(RoleManager.ROLE_EMERGENCY));
-        return defaultPackage != null && defaultPackage.equals(pkg);
-    }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultHomePicker.java b/src/com/android/settings/applications/defaultapps/DefaultHomePicker.java
deleted file mode 100644
index 304b307..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultHomePicker.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.app.settings.SettingsEnums;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.ActivityInfo;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.content.pm.UserInfo;
-import android.os.Build;
-import android.text.TextUtils;
-
-import com.android.settings.R;
-import com.android.settingslib.applications.DefaultAppInfo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class DefaultHomePicker extends DefaultAppPickerFragment {
-
-    private String mPackageName;
-
-    @Override
-    public void onAttach(Context context) {
-        super.onAttach(context);
-        mPackageName = context.getPackageName();
-    }
-
-    @Override
-    protected int getPreferenceScreenResId() {
-        return R.xml.default_home_settings;
-    }
-
-    @Override
-    public int getMetricsCategory() {
-        return SettingsEnums.DEFAULT_HOME_PICKER;
-    }
-
-    @Override
-    protected List<DefaultAppInfo> getCandidates() {
-        final boolean mustSupportManagedProfile = hasManagedProfile();
-        final List<DefaultAppInfo> candidates = new ArrayList<>();
-        final List<ResolveInfo> homeActivities = new ArrayList<>();
-        final Context context = getContext();
-        mPm.getHomeActivities(homeActivities);
-
-        for (ResolveInfo resolveInfo : homeActivities) {
-            final ActivityInfo info = resolveInfo.activityInfo;
-            final ComponentName activityName = new ComponentName(info.packageName, info.name);
-            if (info.packageName.equals(mPackageName)) {
-                continue;
-            }
-
-            final String summary;
-            boolean enabled = true;
-            if (mustSupportManagedProfile && !launcherHasManagedProfilesFeature(resolveInfo)) {
-                summary = getContext().getString(R.string.home_work_profile_not_supported);
-                enabled = false;
-            } else {
-                summary = null;
-            }
-            final DefaultAppInfo candidate =
-                    new DefaultAppInfo(context, mPm, mUserId, activityName, summary, enabled);
-            candidates.add(candidate);
-        }
-        return candidates;
-    }
-
-    @Override
-    protected String getDefaultKey() {
-        final ArrayList<ResolveInfo> homeActivities = new ArrayList<>();
-        final ComponentName currentDefaultHome = mPm.getHomeActivities(homeActivities);
-        if (currentDefaultHome != null) {
-            return currentDefaultHome.flattenToString();
-        }
-        return null;
-    }
-
-    @Override
-    protected boolean setDefaultKey(String key) {
-        if (!TextUtils.isEmpty(key)) {
-            final ComponentName component = ComponentName.unflattenFromString(key);
-            final List<ResolveInfo> homeActivities = new ArrayList<>();
-            mPm.getHomeActivities(homeActivities);
-            final List<ComponentName> allComponents = new ArrayList<>();
-            for (ResolveInfo info : homeActivities) {
-                final ActivityInfo appInfo = info.activityInfo;
-                ComponentName activityName = new ComponentName(appInfo.packageName, appInfo.name);
-                allComponents.add(activityName);
-            }
-            mPm.replacePreferredActivity(
-                    DefaultHomePreferenceController.HOME_FILTER,
-                    IntentFilter.MATCH_CATEGORY_EMPTY,
-                    allComponents.toArray(new ComponentName[0]),
-                    component);
-
-            // Launch the new Home app so the change is immediately visible even if
-            // the Home button is not pressed.
-            final Context context = getContext();
-            Intent i = new Intent(Intent.ACTION_MAIN);
-            i.addCategory(Intent.CATEGORY_HOME);
-            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-            context.startActivity(i);
-            return true;
-        }
-        return false;
-    }
-
-    private boolean hasManagedProfile() {
-        final Context context = getContext();
-        List<UserInfo> profiles = mUserManager.getProfiles(context.getUserId());
-        for (UserInfo userInfo : profiles) {
-            if (userInfo.isManagedProfile()) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private boolean launcherHasManagedProfilesFeature(ResolveInfo resolveInfo) {
-        try {
-            ApplicationInfo appInfo = mPm.getApplicationInfo(resolveInfo.activityInfo.packageName,
-                    0 /* default flags */);
-            return versionNumberAtLeastL(appInfo.targetSdkVersion);
-        } catch (PackageManager.NameNotFoundException e) {
-            return false;
-        }
-    }
-
-    private boolean versionNumberAtLeastL(int versionNumber) {
-        return versionNumber >= Build.VERSION_CODES.LOLLIPOP;
-    }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceController.java
deleted file mode 100644
index 9fbde3e..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceController.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.ActivityInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-
-import com.android.settings.R;
-import com.android.settingslib.applications.DefaultAppInfo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class DefaultHomePreferenceController extends DefaultAppPreferenceController {
-
-    static final IntentFilter HOME_FILTER;
-
-    private final String mPackageName;
-
-    static {
-        HOME_FILTER = new IntentFilter(Intent.ACTION_MAIN);
-        HOME_FILTER.addCategory(Intent.CATEGORY_HOME);
-        HOME_FILTER.addCategory(Intent.CATEGORY_DEFAULT);
-    }
-
-    public DefaultHomePreferenceController(Context context) {
-        super(context);
-        mPackageName = mContext.getPackageName();
-    }
-
-    @Override
-    public String getPreferenceKey() {
-        return "default_home";
-    }
-
-    @Override
-    public boolean isAvailable() {
-        return mContext.getResources().getBoolean(R.bool.config_show_default_home);
-    }
-
-    @Override
-    protected DefaultAppInfo getDefaultAppInfo() {
-        final ArrayList<ResolveInfo> homeActivities = new ArrayList<>();
-        final ComponentName currentDefaultHome = mPackageManager.getHomeActivities(homeActivities);
-        if (currentDefaultHome != null) {
-            return new DefaultAppInfo(mContext, mPackageManager, mUserId, currentDefaultHome);
-        }
-        final ActivityInfo onlyAppInfo = getOnlyAppInfo(homeActivities);
-        if (onlyAppInfo != null) {
-            return new DefaultAppInfo(mContext, mPackageManager, mUserId,
-                    onlyAppInfo.getComponentName());
-        }
-        return null;
-    }
-
-    private ActivityInfo getOnlyAppInfo(List<ResolveInfo> homeActivities) {
-        final List<ActivityInfo> appLabels = new ArrayList<>();
-
-        mPackageManager.getHomeActivities(homeActivities);
-        for (ResolveInfo candidate : homeActivities) {
-            final ActivityInfo info = candidate.activityInfo;
-            if (info.packageName.equals(mPackageName)) {
-                continue;
-            }
-            appLabels.add(info);
-        }
-        return appLabels.size() == 1
-                ? appLabels.get(0)
-                : null;
-    }
-
-    @Override
-    protected Intent getSettingIntent(DefaultAppInfo info) {
-        if (info == null) {
-            return null;
-        }
-        final String packageName;
-        if (info.componentName != null) {
-            packageName = info.componentName.getPackageName();
-        } else if (info.packageItemInfo != null) {
-            packageName = info.packageItemInfo.packageName;
-        } else {
-            return null;
-        }
-
-        Intent intent = new Intent(Intent.ACTION_APPLICATION_PREFERENCES)
-                .setPackage(packageName)
-                .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
-        return intent.resolveActivity(mPackageManager) != null ? intent : null;
-    }
-
-    public static boolean hasHomePreference(String pkg, Context context) {
-        ArrayList<ResolveInfo> homeActivities = new ArrayList<>();
-        PackageManager pm = context.getPackageManager();
-        pm.getHomeActivities(homeActivities);
-        for (int i = 0; i < homeActivities.size(); i++) {
-            if (homeActivities.get(i).activityInfo.packageName.equals(pkg)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static boolean isHomeDefault(String pkg, PackageManager pm) {
-        final ArrayList<ResolveInfo> homeActivities = new ArrayList<>();
-        ComponentName def = pm.getHomeActivities(homeActivities);
-
-        return def == null || def.getPackageName().equals(pkg);
-    }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultPaymentSettingsPreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultPaymentSettingsPreferenceController.java
deleted file mode 100644
index 55803c5..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultPaymentSettingsPreferenceController.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.nfc.NfcAdapter;
-import android.os.UserManager;
-
-import androidx.preference.Preference;
-
-import com.android.settings.R;
-import com.android.settings.core.PreferenceControllerMixin;
-import com.android.settings.nfc.PaymentBackend;
-import com.android.settingslib.core.AbstractPreferenceController;
-
-public class DefaultPaymentSettingsPreferenceController extends AbstractPreferenceController
-        implements PreferenceControllerMixin {
-
-    private final NfcAdapter mNfcAdapter;
-    private final PackageManager mPackageManager;
-    private final UserManager mUserManager;
-    private PaymentBackend mPaymentBackend;
-
-    public DefaultPaymentSettingsPreferenceController(Context context) {
-        super(context);
-        mPackageManager = context.getPackageManager();
-        mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
-        mNfcAdapter = NfcAdapter.getDefaultAdapter(mContext);
-    }
-
-    @Override
-    public boolean isAvailable() {
-        return mPackageManager.hasSystemFeature(PackageManager.FEATURE_NFC)
-                && mPackageManager.hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION)
-                && mUserManager.isAdminUser()
-                && mNfcAdapter != null
-                && mNfcAdapter.isEnabled();
-    }
-
-    @Override
-    public void updateState(Preference preference) {
-        if (mPaymentBackend == null) {
-            if (mNfcAdapter != null) {
-                mPaymentBackend = new PaymentBackend(mContext);
-            } else {
-                mPaymentBackend = null;
-            }
-        }
-        if (mPaymentBackend == null) {
-            return;
-        }
-        mPaymentBackend.refresh();
-        final PaymentBackend.PaymentAppInfo app = mPaymentBackend.getDefaultApp();
-        if (app != null) {
-            preference.setSummary(app.label);
-        } else {
-            preference.setSummary(R.string.app_list_preference_none);
-        }
-    }
-
-    @Override
-    public String getPreferenceKey() {
-        return "default_payment_app";
-    }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultPhonePicker.java b/src/com/android/settings/applications/defaultapps/DefaultPhonePicker.java
deleted file mode 100644
index 8b16be1..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultPhonePicker.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.app.settings.SettingsEnums;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.telecom.DefaultDialerManager;
-import android.telecom.TelecomManager;
-import android.text.TextUtils;
-
-import com.android.settings.R;
-import com.android.settingslib.applications.DefaultAppInfo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class DefaultPhonePicker extends DefaultAppPickerFragment {
-
-    private DefaultKeyUpdater mDefaultKeyUpdater;
-
-    @Override
-    public int getMetricsCategory() {
-        return SettingsEnums.DEFAULT_PHONE_PICKER;
-    }
-
-    @Override
-    public void onAttach(Context context) {
-        super.onAttach(context);
-        mDefaultKeyUpdater = new DefaultKeyUpdater(
-                (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE));
-    }
-
-    @Override
-    protected int getPreferenceScreenResId() {
-        return R.xml.default_phone_settings;
-    }
-
-    @Override
-    protected List<DefaultAppInfo> getCandidates() {
-        final List<DefaultAppInfo> candidates = new ArrayList<>();
-        final List<String> dialerPackages =
-                DefaultDialerManager.getInstalledDialerApplications(getContext(), mUserId);
-        final Context context = getContext();
-        for (String packageName : dialerPackages) {
-            try {
-                candidates.add(new DefaultAppInfo(context, mPm, mUserId,
-                        mPm.getApplicationInfoAsUser(packageName, 0, mUserId)));
-            } catch (PackageManager.NameNotFoundException e) {
-                // Skip unknown packages.
-            }
-        }
-        return candidates;
-    }
-
-    @Override
-    protected String getDefaultKey() {
-        return mDefaultKeyUpdater.getDefaultDialerApplication(getContext(), mUserId);
-    }
-
-    @Override
-    protected String getSystemDefaultKey() {
-        return mDefaultKeyUpdater.getSystemDialerPackage();
-    }
-
-    @Override
-    protected boolean setDefaultKey(String key) {
-        if (!TextUtils.isEmpty(key) && !TextUtils.equals(key, getDefaultKey())) {
-            mBatteryUtils.clearForceAppStandby(key);
-            return mDefaultKeyUpdater.setDefaultDialerApplication(getContext(), key, mUserId);
-        }
-        return false;
-    }
-
-    /**
-     * Wrapper class to handle default phone app update.
-     */
-    static class DefaultKeyUpdater {
-        private final TelecomManager mTelecomManager;
-
-        public DefaultKeyUpdater(TelecomManager telecomManager) {
-            mTelecomManager = telecomManager;
-        }
-
-        public String getSystemDialerPackage() {
-            return mTelecomManager.getSystemDialerPackage();
-        }
-
-        public String getDefaultDialerApplication(Context context, int uid) {
-            return DefaultDialerManager.getDefaultDialerApplication(context, uid);
-        }
-
-        public boolean setDefaultDialerApplication(Context context, String key, int uid) {
-            return DefaultDialerManager.setDefaultDialerApplication(context, key, uid);
-        }
-    }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultPhonePreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultPhonePreferenceController.java
deleted file mode 100644
index 7b7755d..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultPhonePreferenceController.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.os.UserHandle;
-import android.os.UserManager;
-import android.telecom.DefaultDialerManager;
-import android.telephony.TelephonyManager;
-
-import com.android.settingslib.applications.DefaultAppInfo;
-
-import java.util.List;
-
-public class DefaultPhonePreferenceController extends DefaultAppPreferenceController {
-
-    public DefaultPhonePreferenceController(Context context) {
-        super(context);
-    }
-
-    @Override
-    public boolean isAvailable() {
-        final TelephonyManager tm =
-                (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
-        if (!tm.isVoiceCapable()) {
-            return false;
-        }
-        final UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
-        final boolean hasUserRestriction =
-                um.hasUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS);
-
-        if (hasUserRestriction) {
-            return false;
-        }
-        final List<String> candidates = getCandidates();
-        return candidates != null && !candidates.isEmpty();
-    }
-
-    @Override
-    public String getPreferenceKey() {
-        return "default_phone_app";
-    }
-
-    @Override
-    protected DefaultAppInfo getDefaultAppInfo() {
-        try {
-            return new DefaultAppInfo(mContext, mPackageManager, mUserId,
-                    mPackageManager.getApplicationInfo(
-                    DefaultDialerManager.getDefaultDialerApplication(mContext, mUserId), 0));
-        } catch (PackageManager.NameNotFoundException e) {
-            return null;
-        }
-    }
-
-    private List<String> getCandidates() {
-        return DefaultDialerManager.getInstalledDialerApplications(mContext, mUserId);
-    }
-
-    public static boolean hasPhonePreference(String pkg, Context context) {
-        List<String> dialerPackages =
-                DefaultDialerManager.getInstalledDialerApplications(context, UserHandle.myUserId());
-        return dialerPackages.contains(pkg);
-    }
-
-    public static boolean isPhoneDefault(String pkg, Context context) {
-        String def = DefaultDialerManager.getDefaultDialerApplication(context,
-                UserHandle.myUserId());
-        return def != null && def.equals(pkg);
-    }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultSmsPicker.java b/src/com/android/settings/applications/defaultapps/DefaultSmsPicker.java
deleted file mode 100644
index 4c6b6e8..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultSmsPicker.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.app.settings.SettingsEnums;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.text.TextUtils;
-
-import com.android.internal.telephony.SmsApplication;
-import com.android.settings.R;
-import com.android.settings.Utils;
-import com.android.settingslib.applications.DefaultAppInfo;
-import com.android.settingslib.widget.CandidateInfo;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public class DefaultSmsPicker extends DefaultAppPickerFragment {
-
-    private DefaultKeyUpdater mDefaultKeyUpdater = new DefaultKeyUpdater();
-
-    @Override
-    public int getMetricsCategory() {
-        return SettingsEnums.DEFAULT_SMS_PICKER;
-    }
-
-    @Override
-    protected int getPreferenceScreenResId() {
-        return R.xml.default_sms_settings;
-    }
-
-    @Override
-    protected List<DefaultAppInfo> getCandidates() {
-        final Context context = getContext();
-        final Collection<SmsApplication.SmsApplicationData> smsApplications =
-                SmsApplication.getApplicationCollection(context);
-        final List<DefaultAppInfo> candidates = new ArrayList<>(smsApplications.size());
-
-        for (SmsApplication.SmsApplicationData smsApplicationData : smsApplications) {
-            try {
-                candidates.add(new DefaultAppInfo(context, mPm, mUserId,
-                        mPm.getApplicationInfoAsUser(smsApplicationData.mPackageName, 0, mUserId)));
-            } catch (PackageManager.NameNotFoundException e) {
-                // Skip unknown packages.
-            }
-        }
-
-        return candidates;
-    }
-
-    @Override
-    protected String getDefaultKey() {
-        return mDefaultKeyUpdater.getDefaultApplication(getContext());
-    }
-
-    @Override
-    protected boolean setDefaultKey(String key) {
-        if (!TextUtils.isEmpty(key) && !TextUtils.equals(key, getDefaultKey())) {
-            mDefaultKeyUpdater.setDefaultApplication(getContext(), key);
-            mBatteryUtils.clearForceAppStandby(key);
-            return true;
-        }
-        return false;
-    }
-
-    @Override
-    protected String getConfirmationMessage(CandidateInfo info) {
-        return Utils.isPackageDirectBootAware(getContext(), info.getKey()) ? null
-                : getContext().getString(R.string.direct_boot_unaware_dialog_message);
-    }
-
-    /**
-     * Wrapper class to handle default phone app update.
-     */
-    static class DefaultKeyUpdater {
-
-        public String getDefaultApplication(Context context) {
-            final ComponentName appName = SmsApplication.getDefaultSmsApplication(context, true);
-            if (appName != null) {
-                return appName.getPackageName();
-            }
-            return null;
-        }
-
-        public void setDefaultApplication(Context context, String key) {
-            SmsApplication.setDefaultApplication(key, context);
-        }
-    }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultSmsPreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultSmsPreferenceController.java
deleted file mode 100644
index cb86b2e..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultSmsPreferenceController.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.telephony.TelephonyManager;
-
-import com.android.internal.telephony.SmsApplication;
-import com.android.settingslib.applications.DefaultAppInfo;
-
-import java.util.Collection;
-
-public class DefaultSmsPreferenceController extends DefaultAppPreferenceController {
-
-    public DefaultSmsPreferenceController(Context context) {
-        super(context);
-    }
-
-    @Override
-    public boolean isAvailable() {
-        boolean isRestrictedUser = mUserManager.getUserInfo(mUserId).isRestricted();
-        TelephonyManager tm =
-                (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
-        return !isRestrictedUser && tm.isSmsCapable();
-    }
-
-    @Override
-    public String getPreferenceKey() {
-        return "default_sms_app";
-    }
-
-    @Override
-    protected DefaultAppInfo getDefaultAppInfo() {
-        final ComponentName app = SmsApplication.getDefaultSmsApplication(mContext, true);
-        if (app != null) {
-            return new DefaultAppInfo(mContext, mPackageManager, mUserId, app);
-        }
-        return null;
-    }
-
-    public static boolean hasSmsPreference(String pkg, Context context) {
-        Collection<SmsApplication.SmsApplicationData> smsApplications =
-                SmsApplication.getApplicationCollection(context);
-        for (SmsApplication.SmsApplicationData data : smsApplications) {
-            if (data.mPackageName.equals(pkg)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static boolean isSmsDefault(String pkg, Context context) {
-        ComponentName appName = SmsApplication.getDefaultSmsApplication(context, true);
-        return appName != null && appName.getPackageName().equals(pkg);
-    }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultWorkBrowserPreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultWorkBrowserPreferenceController.java
deleted file mode 100644
index 4652855..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultWorkBrowserPreferenceController.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.content.Context;
-import android.os.UserHandle;
-
-import com.android.settings.Utils;
-
-
-public class DefaultWorkBrowserPreferenceController extends DefaultBrowserPreferenceController {
-
-    public static final String KEY = "work_default_browser";
-    private final UserHandle mUserHandle;
-
-    public DefaultWorkBrowserPreferenceController(Context context) {
-        super(context);
-        mUserHandle = Utils.getManagedProfile(mUserManager);
-        if (mUserHandle != null) {
-            mUserId = mUserHandle.getIdentifier();
-        }
-    }
-
-    @Override
-    public String getPreferenceKey() {
-        return KEY;
-    }
-
-    @Override
-    public boolean isAvailable() {
-        if (mUserHandle == null) {
-            return false;
-        }
-        return super.isAvailable();
-    }
-}
diff --git a/src/com/android/settings/applications/defaultapps/DefaultWorkPhonePreferenceController.java b/src/com/android/settings/applications/defaultapps/DefaultWorkPhonePreferenceController.java
deleted file mode 100644
index decff06..0000000
--- a/src/com/android/settings/applications/defaultapps/DefaultWorkPhonePreferenceController.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import android.content.Context;
-import android.os.UserHandle;
-
-import com.android.settings.Utils;
-
-public class DefaultWorkPhonePreferenceController extends DefaultPhonePreferenceController {
-
-    public static final String KEY = "work_default_phone_app";
-    private final UserHandle mUserHandle;
-
-    public DefaultWorkPhonePreferenceController(Context context) {
-        super(context);
-        mUserHandle = Utils.getManagedProfile(mUserManager);
-        if (mUserHandle != null) {
-            mUserId = mUserHandle.getIdentifier();
-        }
-    }
-
-    @Override
-    public boolean isAvailable() {
-        if (mUserHandle == null) {
-            return false;
-        }
-        return super.isAvailable();
-    }
-
-    @Override
-    public String getPreferenceKey() {
-        return KEY;
-    }
-}
diff --git a/src/com/android/settings/applications/manageapplications/ManageApplications.java b/src/com/android/settings/applications/manageapplications/ManageApplications.java
index 6315ab1..b4b909d 100644
--- a/src/com/android/settings/applications/manageapplications/ManageApplications.java
+++ b/src/com/android/settings/applications/manageapplications/ManageApplications.java
@@ -92,7 +92,6 @@
 import com.android.settings.applications.AppStateUsageBridge.UsageState;
 import com.android.settings.applications.AppStateWriteSettingsBridge;
 import com.android.settings.applications.AppStorageSettings;
-import com.android.settings.applications.DefaultAppSettings;
 import com.android.settings.applications.InstalledAppCounter;
 import com.android.settings.applications.UsageAccessDetails;
 import com.android.settings.applications.appinfo.AppInfoDashboardFragment;
@@ -704,12 +703,9 @@
                             .setResultListener(this, ADVANCED_SETTINGS)
                             .launch();
                 } else {
-                    new SubSettingLauncher(getContext())
-                            .setDestination(DefaultAppSettings.class.getName())
-                            .setTitleRes(R.string.configure_apps)
-                            .setSourceMetricsCategory(getMetricsCategory())
-                            .setResultListener(this, ADVANCED_SETTINGS)
-                            .launch();
+                    Intent intent = new Intent(
+                            android.provider.Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS);
+                    startActivityForResult(intent, ADVANCED_SETTINGS);
                 }
                 return true;
             default:
diff --git a/src/com/android/settings/applications/specialaccess/DefaultPaymentSettingsPreferenceController.java b/src/com/android/settings/applications/specialaccess/DefaultPaymentSettingsPreferenceController.java
new file mode 100644
index 0000000..dbdc9fe
--- /dev/null
+++ b/src/com/android/settings/applications/specialaccess/DefaultPaymentSettingsPreferenceController.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.applications.specialaccess;
+
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.nfc.NfcAdapter;
+import android.os.UserManager;
+
+import com.android.settings.core.BasePreferenceController;
+
+public class DefaultPaymentSettingsPreferenceController extends BasePreferenceController {
+
+    private final NfcAdapter mNfcAdapter;
+    private final PackageManager mPackageManager;
+    private final UserManager mUserManager;
+
+    public DefaultPaymentSettingsPreferenceController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+
+        mPackageManager = context.getPackageManager();
+        mUserManager = context.getSystemService(UserManager.class);
+        mNfcAdapter = NfcAdapter.getDefaultAdapter(mContext);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_NFC)
+                || !mPackageManager.hasSystemFeature(
+                        PackageManager.FEATURE_NFC_HOST_CARD_EMULATION)) {
+            return UNSUPPORTED_ON_DEVICE;
+        }
+        if (!mUserManager.isAdminUser()) {
+            return DISABLED_FOR_USER;
+        }
+        if (mNfcAdapter == null || !mNfcAdapter.isEnabled()) {
+            return CONDITIONALLY_UNAVAILABLE;
+        }
+        return AVAILABLE;
+    }
+}
diff --git a/src/com/android/settings/core/gateway/SettingsGateway.java b/src/com/android/settings/core/gateway/SettingsGateway.java
index 30f6afc..35a1627 100644
--- a/src/com/android/settings/core/gateway/SettingsGateway.java
+++ b/src/com/android/settings/core/gateway/SettingsGateway.java
@@ -34,7 +34,6 @@
 import com.android.settings.accounts.ChooseAccountFragment;
 import com.android.settings.accounts.ManagedProfileSettings;
 import com.android.settings.applications.AppAndNotificationDashboardFragment;
-import com.android.settings.applications.DefaultAppSettings;
 import com.android.settings.applications.ProcessStatsSummary;
 import com.android.settings.applications.ProcessStatsUi;
 import com.android.settings.applications.UsageAccessDetails;
@@ -247,7 +246,6 @@
             DrawOverlayDetails.class.getName(),
             WriteSettingsDetails.class.getName(),
             ExternalSourcesDetails.class.getName(),
-            DefaultAppSettings.class.getName(),
             WallpaperTypeSettings.class.getName(),
             VrListenerSettings.class.getName(),
             PictureInPictureSettings.class.getName(),
@@ -308,7 +306,6 @@
             // Home page > Apps & Notifications
             Settings.UserSettingsActivity.class.getName(),
             Settings.ConfigureNotificationSettingsActivity.class.getName(),
-            Settings.AdvancedAppsActivity.class.getName(),
             Settings.ManageApplicationsActivity.class.getName(),
             Settings.PaymentSettingsActivity.class.getName(),
             // Home page > Security & screen lock
diff --git a/src/com/android/settings/dashboard/DashboardFragmentRegistry.java b/src/com/android/settings/dashboard/DashboardFragmentRegistry.java
index 34afad6..b499b59 100644
--- a/src/com/android/settings/dashboard/DashboardFragmentRegistry.java
+++ b/src/com/android/settings/dashboard/DashboardFragmentRegistry.java
@@ -23,7 +23,6 @@
 import com.android.settings.accounts.AccountDashboardFragment;
 import com.android.settings.accounts.AccountDetailDashboardFragment;
 import com.android.settings.applications.AppAndNotificationDashboardFragment;
-import com.android.settings.applications.DefaultAppSettings;
 import com.android.settings.connecteddevice.AdvancedConnectedDeviceDashboardFragment;
 import com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment;
 import com.android.settings.development.DevelopmentSettingsDashboardFragment;
@@ -79,8 +78,6 @@
                 CategoryKey.CATEGORY_APPS);
         PARENT_TO_CATEGORY_KEY_MAP.put(PowerUsageSummary.class.getName(),
                 CategoryKey.CATEGORY_BATTERY);
-        PARENT_TO_CATEGORY_KEY_MAP.put(DefaultAppSettings.class.getName(),
-                CategoryKey.CATEGORY_APPS_DEFAULT);
         PARENT_TO_CATEGORY_KEY_MAP.put(DisplaySettings.class.getName(),
                 CategoryKey.CATEGORY_DISPLAY);
         PARENT_TO_CATEGORY_KEY_MAP.put(SoundSettings.class.getName(),
diff --git a/src/com/android/settings/users/UserPreference.java b/src/com/android/settings/users/UserPreference.java
index d87d78e..3603d44 100644
--- a/src/com/android/settings/users/UserPreference.java
+++ b/src/com/android/settings/users/UserPreference.java
@@ -40,18 +40,22 @@
     public static final int USERID_UNKNOWN = -10;
     public static final int USERID_GUEST_DEFAULTS = -11;
     public static final Comparator<UserPreference> SERIAL_NUMBER_COMPARATOR =
-            new Comparator<UserPreference>() {
-                @Override
-                public int compare(UserPreference p1, UserPreference p2) {
-                    int sn1 = p1.getSerialNumber();
-                    int sn2 = p2.getSerialNumber();
-                    if (sn1 < sn2) {
-                        return -1;
-                    } else if (sn1 > sn2) {
-                        return 1;
-                    }
-                    return 0;
+            (p1, p2) -> {
+
+                if (p1 == null) {
+                    return -1;
                 }
+                else if (p2 == null) {
+                    return 1;
+                }
+                int sn1 = p1.getSerialNumber();
+                int sn2 = p2.getSerialNumber();
+                if (sn1 < sn2) {
+                    return -1;
+                } else if (sn1 > sn2) {
+                    return 1;
+                }
+                return 0;
             };
 
     private OnClickListener mDeleteClickListener;
diff --git a/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java b/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java
index 13905c8..7b21d21 100644
--- a/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java
+++ b/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java
@@ -409,7 +409,8 @@
                 .setButton4Text(R.string.share)
                 .setButton4Icon(R.drawable.ic_qrcode_24dp)
                 .setButton4OnClickListener(view -> shareNetwork())
-                .setButton4Visible(WifiDppUtils.isSupportConfiguratorQrCodeGenerator(mAccessPoint));
+                .setButton4Visible(
+                        WifiDppUtils.isSupportConfiguratorQrCodeGenerator(mContext, mAccessPoint));
 
         mSignalStrengthPref = screen.findPreference(KEY_SIGNAL_STRENGTH_PREF);
         mTxLinkSpeedPref = screen.findPreference(KEY_TX_LINK_SPEED);
@@ -449,8 +450,7 @@
                         headerPref.findViewById(R.id.entity_header));
 
         ImageView iconView = headerPref.findViewById(R.id.entity_header_icon);
-        iconView.setBackground(
-                mContext.getDrawable(R.drawable.ic_settings_widget_background));
+
         iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
 
         mEntityHeaderController.setLabel(mAccessPoint.getTitle());
@@ -602,10 +602,9 @@
         mRssiSignalLevel = signalLevel;
         Drawable wifiIcon = mIconInjector.getIcon(mRssiSignalLevel);
 
-        wifiIcon.setTintList(Utils.getColorAccent(mContext));
         if (mEntityHeaderController != null) {
             mEntityHeaderController
-                    .setIcon(rescaleIconForHeader(wifiIcon)).done(mFragment.getActivity(),
+                    .setIcon(redrawIconForHeader(wifiIcon)).done(mFragment.getActivity(),
                             true /* rebind */);
         }
 
@@ -617,7 +616,7 @@
         mSignalStrengthPref.setVisible(true);
     }
 
-    private Drawable rescaleIconForHeader(Drawable original) {
+    private Drawable redrawIconForHeader(Drawable original) {
         final int iconSize = mContext.getResources().getDimensionPixelSize(
                 R.dimen.wifi_detail_page_header_image_size);
         final int actualWidth = original.getMinimumWidth();
@@ -628,10 +627,19 @@
             return original;
         }
 
+        // clear tint list to make sure can set 87% black after enlarge
+        original.setTintList(null);
+
+        // enlarge icon size
         final Bitmap bitmap = Utils.createBitmap(original,
                 iconSize /*width*/,
                 iconSize /*height*/);
-        return new BitmapDrawable(null /*resource*/, bitmap);
+        Drawable newIcon = new BitmapDrawable(null /*resource*/, bitmap);
+
+        // config color for 87% black after enlarge
+        newIcon.setTintList(Utils.getColorAttr(mContext, android.R.attr.textColorPrimary));
+
+        return newIcon;
     }
 
     private void refreshFrequency() {
diff --git a/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java b/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
index 21920d2..d0322b7 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
@@ -46,6 +46,8 @@
 import android.widget.TextView;
 
 import androidx.annotation.StringRes;
+import androidx.annotation.UiThread;
+import androidx.annotation.VisibleForTesting;
 import androidx.lifecycle.ViewModelProviders;
 
 import com.android.settings.R;
@@ -57,6 +59,7 @@
 import com.android.settingslib.wifi.WifiTracker;
 import com.android.settingslib.wifi.WifiTrackerFactory;
 
+import java.util.ArrayList;
 import java.util.List;
 
 public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment implements
@@ -104,7 +107,7 @@
     private WifiQrCode mWifiQrCode;
 
     /** The WifiConfiguration connecting for enrollee usage */
-    private WifiConfiguration mWifiConfiguration;
+    private WifiConfiguration mEnrolleeWifiConfiguration;
 
     private int mLatestStatusCode = WifiDppUtils.EASY_CONNECT_EVENT_FAILURE_NONE;
 
@@ -140,14 +143,8 @@
                     break;
 
                 case MESSAGE_SCAN_WIFI_DPP_SUCCESS:
-                    if (mCamera != null) {
-                        mCamera.stop();
-                    }
-
-                    mDecorateView.setFocused(true);
-                    mErrorMessage.setVisibility(View.INVISIBLE);
-
                     if (mScanWifiDppSuccessListener == null) {
+                        // mScanWifiDppSuccessListener may be null after onDetach(), do nothing here
                         return;
                     }
                     mScanWifiDppSuccessListener.onScanWifiDppSuccess((WifiQrCode)msg.obj);
@@ -160,23 +157,43 @@
                                 AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
                     }
 
-                    WifiDppUtils.triggerVibrationForQrCodeRecognition(getContext());
+                    notifyUserForQrCodeRecognition();
                     break;
 
                 case MESSAGE_SCAN_ZXING_WIFI_FORMAT_SUCCESS:
-                    if (mCamera != null) {
-                        mCamera.stop();
+                    // We may get 2 WifiConfiguration if the QR code has no password in it,
+                    // one for open network and one for enhanced open network.
+                    final WifiManager wifiManager =
+                            getContext().getSystemService(WifiManager.class);
+                    final WifiNetworkConfig qrCodeWifiNetworkConfig =
+                            (WifiNetworkConfig)msg.obj;
+                    final List<WifiConfiguration> qrCodeWifiConfigurations =
+                            qrCodeWifiNetworkConfig.getWifiConfigurations();
+
+                    // Adds all Wi-Fi networks in QR code to the set of configured networks and
+                    // connects to it if it's reachable.
+                    boolean hasReachableWifiNetwork = false;
+                    for (WifiConfiguration qrCodeWifiConfiguration : qrCodeWifiConfigurations) {
+                        final int id = wifiManager.addNetwork(qrCodeWifiConfiguration);
+                        if (id == -1) {
+                            continue;
+                        }
+                        wifiManager.enableNetwork(id, /* attemptConnect */ false);
+                        if (isReachableWifiNetwork(qrCodeWifiConfiguration)) {
+                            hasReachableWifiNetwork = true;
+                            mEnrolleeWifiConfiguration = qrCodeWifiConfiguration;
+                            wifiManager.connect(id,
+                                    /* listener */ WifiDppQrCodeScannerFragment.this);
+                        }
                     }
 
-                    mDecorateView.setFocused(true);
-                    mErrorMessage.setVisibility(View.INVISIBLE);
+                    if (hasReachableWifiNetwork == false) {
+                        showErrorMessageAndRestartCamera(
+                                R.string.wifi_dpp_check_connection_try_again);
+                        return;
+                    }
 
-                    final WifiNetworkConfig wifiNetworkConfig = (WifiNetworkConfig)msg.obj;
-                    mWifiConfiguration = wifiNetworkConfig.getWifiConfigurationOrNull();
-                    wifiNetworkConfig.connect(getContext(),
-                            /* listener */ WifiDppQrCodeScannerFragment.this);
-
-                    WifiDppUtils.triggerVibrationForQrCodeRecognition(getContext());
+                    notifyUserForQrCodeRecognition();
                     break;
 
                 default:
@@ -185,6 +202,30 @@
         }
     };
 
+    @UiThread
+    private void notifyUserForQrCodeRecognition() {
+        if (mCamera != null) {
+            mCamera.stop();
+        }
+
+        mDecorateView.setFocused(true);
+        mErrorMessage.setVisibility(View.INVISIBLE);
+
+        WifiDppUtils.triggerVibrationForQrCodeRecognition(getContext());
+    }
+
+    private boolean isReachableWifiNetwork(WifiConfiguration wifiConfiguration) {
+        final List<AccessPoint> scannedAccessPoints = mWifiTracker.getAccessPoints();
+
+        for (AccessPoint scannedAccessPoint : scannedAccessPoints) {
+            if (scannedAccessPoint.matches(wifiConfiguration) &&
+                    scannedAccessPoint.isReachable()) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -192,7 +233,7 @@
         if (savedInstanceState != null) {
             mIsConfiguratorMode = savedInstanceState.getBoolean(KEY_IS_CONFIGURATOR_MODE);
             mLatestStatusCode = savedInstanceState.getInt(KEY_LATEST_ERROR_CODE);
-            mWifiConfiguration = savedInstanceState.getParcelable(KEY_WIFI_CONFIGURATION);
+            mEnrolleeWifiConfiguration = savedInstanceState.getParcelable(KEY_WIFI_CONFIGURATION);
         }
 
         final WifiDppInitiatorViewModel model =
@@ -222,6 +263,24 @@
     }
 
     @Override
+    public void onPause() {
+        if (mCamera != null) {
+            mCamera.stop();
+        }
+
+        super.onPause();
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+
+        if (!isGoingInitiator()) {
+            restartCamera();
+        }
+    }
+
+    @Override
     public int getMetricsCategory() {
         if (mIsConfiguratorMode) {
             return SettingsEnums.SETTINGS_WIFI_DPP_CONFIGURATOR;
@@ -480,7 +539,7 @@
     public void onSaveInstanceState(Bundle outState) {
         outState.putBoolean(KEY_IS_CONFIGURATOR_MODE, mIsConfiguratorMode);
         outState.putInt(KEY_LATEST_ERROR_CODE, mLatestStatusCode);
-        outState.putParcelable(KEY_WIFI_CONFIGURATION, mWifiConfiguration);
+        outState.putParcelable(KEY_WIFI_CONFIGURATION, mEnrolleeWifiConfiguration);
 
         super.onSaveInstanceState(outState);
     }
@@ -496,7 +555,7 @@
             for (WifiConfiguration wifiConfig : wifiConfigs) {
                 if (wifiConfig.networkId == newNetworkId) {
                     mLatestStatusCode = WifiDppUtils.EASY_CONNECT_EVENT_SUCCESS;
-                    mWifiConfiguration = wifiConfig;
+                    mEnrolleeWifiConfiguration = wifiConfig;
                     wifiManager.connect(wifiConfig, WifiDppQrCodeScannerFragment.this);
                     return;
                 }
@@ -588,17 +647,13 @@
 
     @Override
     public void onSuccess() {
-        if (isEnrollingWifiNetworkReachable()) {
-            final Intent resultIntent = new Intent();
-            resultIntent.putExtra(WifiDialogActivity.KEY_WIFI_CONFIGURATION, mWifiConfiguration);
+        final Intent resultIntent = new Intent();
+        resultIntent.putExtra(WifiDialogActivity.KEY_WIFI_CONFIGURATION,
+                mEnrolleeWifiConfiguration);
 
-            final Activity hostActivity = getActivity();
-            hostActivity.setResult(Activity.RESULT_OK, resultIntent);
-            hostActivity.finish();
-        } else {
-            Log.d(TAG, "Enroll Wi-Fi network succeeded but it's not reachable");
-            showErrorMessageAndRestartCamera(R.string.wifi_dpp_check_connection_try_again);
-        }
+        final Activity hostActivity = getActivity();
+        hostActivity.setResult(Activity.RESULT_OK, resultIntent);
+        hostActivity.finish();
     }
 
     @Override
@@ -607,22 +662,6 @@
         showErrorMessageAndRestartCamera(R.string.wifi_dpp_check_connection_try_again);
     }
 
-    private boolean isEnrollingWifiNetworkReachable() {
-        if (mWifiConfiguration == null) {
-            Log.e(TAG, "Connect succeeded but lost WifiConfiguration");
-            return false;
-        }
-
-        final List<AccessPoint> scannedAccessPoints = mWifiTracker.getAccessPoints();
-        for (AccessPoint accessPoint : scannedAccessPoints) {
-            if (accessPoint.matches(mWifiConfiguration) &&
-                    accessPoint.isReachable()) {
-                return true;
-            }
-        }
-        return false;
-    }
-
     // Check is Easy Connect handshaking or not
     private boolean isGoingInitiator() {
         final WifiDppInitiatorViewModel model =
@@ -682,4 +721,9 @@
     public void onAccessPointsChanged() {
         // Do nothing.
     }
+
+    @VisibleForTesting
+    protected boolean isDecodeTaskAlive() {
+        return mCamera != null && mCamera.isDecodeTaskAlive();
+    }
 }
diff --git a/src/com/android/settings/wifi/dpp/WifiDppUtils.java b/src/com/android/settings/wifi/dpp/WifiDppUtils.java
index 2ec3137..695de76 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppUtils.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppUtils.java
@@ -162,6 +162,9 @@
         if (config.allowedKeyManagement.get(KeyMgmt.SAE)) {
             return WifiQrCode.SECURITY_SAE;
         }
+        if (config.allowedKeyManagement.get(KeyMgmt.OWE)) {
+            return WifiQrCode.SECURITY_NO_PASSWORD;
+        }
         if (config.allowedKeyManagement.get(KeyMgmt.WPA_PSK) ||
                 config.allowedKeyManagement.get(KeyMgmt.WPA2_PSK)) {
             return WifiQrCode.SECURITY_WPA_PSK;
@@ -185,7 +188,7 @@
     public static Intent getConfiguratorQrCodeGeneratorIntentOrNull(Context context,
             WifiManager wifiManager, AccessPoint accessPoint) {
         final Intent intent = new Intent(context, WifiDppConfiguratorActivity.class);
-        if (isSupportConfiguratorQrCodeGenerator(accessPoint)) {
+        if (isSupportConfiguratorQrCodeGenerator(context, accessPoint)) {
             intent.setAction(WifiDppConfiguratorActivity.ACTION_CONFIGURATOR_QR_CODE_GENERATOR);
         } else {
             return null;
@@ -343,22 +346,24 @@
     /**
      * Checks if QR code generator supports to config other devices with the Wi-Fi network
      *
+     * @param context The context to use for {@code WifiManager}
      * @param accessPoint The {@link AccessPoint} of the Wi-Fi network
      */
-    public static boolean isSupportConfiguratorQrCodeGenerator(AccessPoint accessPoint) {
-        return isSupportZxing(accessPoint.getSecurity());
+    public static boolean isSupportConfiguratorQrCodeGenerator(Context context,
+            AccessPoint accessPoint) {
+        return isSupportZxing(context, accessPoint.getSecurity());
     }
 
     /**
      * Checks if this device supports to be configured by the Wi-Fi network of the security
      *
-     * @param context The context to use for {@link WifiManager#isEasyConnectSupported()}
+     * @param context The context to use for {@code WifiManager}
      * @param accesspointSecurity The security constants defined in {@link AccessPoint}
      */
     public static boolean isSupportEnrolleeQrCodeScanner(Context context,
             int accesspointSecurity) {
         return isSupportWifiDpp(context, accesspointSecurity) ||
-                isSupportZxing(accesspointSecurity);
+                isSupportZxing(context, accesspointSecurity);
     }
 
     private static boolean isSupportHotspotConfiguratorQrCodeGenerator(
@@ -376,19 +381,38 @@
         }
 
         // DPP 1.0 only supports SAE and PSK.
-        if (accesspointSecurity == AccessPoint.SECURITY_SAE ||
-                accesspointSecurity == AccessPoint.SECURITY_PSK) {
-            return true;
+        final WifiManager wifiManager = context.getSystemService(WifiManager.class);
+        switch (accesspointSecurity) {
+            case AccessPoint.SECURITY_SAE:
+                if (wifiManager.isWpa3SaeSupported()) {
+                    return true;
+                }
+                break;
+            case AccessPoint.SECURITY_PSK:
+                return true;
+            default:
         }
         return false;
     }
 
-    // TODO (b/124131581 b/129396816): TO support WPA3 securities (SAE & OWE), change here at first
-    private static boolean isSupportZxing(int accesspointSecurity) {
-        if (accesspointSecurity == AccessPoint.SECURITY_PSK ||
-                accesspointSecurity == AccessPoint.SECURITY_WEP ||
-                accesspointSecurity == AccessPoint.SECURITY_NONE) {
-            return true;
+    private static boolean isSupportZxing(Context context, int accesspointSecurity) {
+        final WifiManager wifiManager = context.getSystemService(WifiManager.class);
+        switch (accesspointSecurity) {
+            case AccessPoint.SECURITY_PSK:
+            case AccessPoint.SECURITY_WEP:
+            case AccessPoint.SECURITY_NONE:
+                return true;
+            case AccessPoint.SECURITY_SAE:
+                if (wifiManager.isWpa3SaeSupported()) {
+                    return true;
+                }
+                break;
+            case AccessPoint.SECURITY_OWE:
+                if (wifiManager.isEnhancedOpenSupported()) {
+                    return true;
+                }
+                break;
+            default:
         }
         return false;
     }
diff --git a/src/com/android/settings/wifi/dpp/WifiNetworkConfig.java b/src/com/android/settings/wifi/dpp/WifiNetworkConfig.java
index fdc74d8..7423561 100644
--- a/src/com/android/settings/wifi/dpp/WifiNetworkConfig.java
+++ b/src/com/android/settings/wifi/dpp/WifiNetworkConfig.java
@@ -32,6 +32,9 @@
 
 import androidx.annotation.VisibleForTesting;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * Wraps the parameters of ZXing reader library's Wi-Fi Network config format.
  * Please check {@code WifiQrCode} for detail of the format.
@@ -203,50 +206,63 @@
         return mIsHotspot;
     }
 
-    public void connect(Context context, WifiManager.ActionListener listener) {
-        WifiConfiguration wifiConfiguration = getWifiConfigurationOrNull();
-        if (wifiConfiguration == null) {
-            if (listener != null) {
-                listener.onFailure(WifiManager.ERROR);
-            }
-            return;
-        }
-
-        WifiManager wifiManager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
-        wifiManager.connect(wifiConfiguration, listener);
-    }
-
     public boolean isSupportWifiDpp(Context context) {
         if (!WifiDppUtils.isWifiDppEnabled(context)) {
             return false;
         }
 
-        // DPP 1.0 only supports SAE and PSK.
-        if (SECURITY_SAE.equals(mSecurity) || SECURITY_WPA_PSK.equals(mSecurity)) {
-            return true;
+        if (TextUtils.isEmpty(mSecurity)) {
+            return false;
         }
 
+        // DPP 1.0 only supports SAE and PSK.
+        final WifiManager wifiManager = context.getSystemService(WifiManager.class);
+        switch (mSecurity) {
+            case SECURITY_SAE:
+                if (wifiManager.isWpa3SaeSupported()) {
+                    return true;
+                }
+                break;
+            case SECURITY_WPA_PSK:
+                return true;
+            default:
+        }
         return false;
     }
 
     /**
      * This is a simplified method from {@code WifiConfigController.getConfig()}
+     *
+     * TODO (b/129021867): WifiConfiguration is a deprecated class, should replace it with
+     *       {@code android.net.wifi.WifiNetworkSuggestion}
+     *
+     * @return When it's a open network, returns 2 WifiConfiguration in the List, the 1st is
+     *         open network and the 2nd is enhanced open network. Returns 1 WifiConfiguration in the
+     *         List for all other supported Wi-Fi securities.
      */
-    WifiConfiguration getWifiConfigurationOrNull() {
-        if (!isValidConfig(this)) {
-            return null;
-        }
+    List<WifiConfiguration> getWifiConfigurations() {
+        final List<WifiConfiguration> wifiConfigurations = new ArrayList<>();
 
-        final WifiConfiguration wifiConfiguration = new WifiConfiguration();
-        wifiConfiguration.SSID = addQuotationIfNeeded(mSsid);
-        wifiConfiguration.hiddenSSID = mHiddenSsid;
-        wifiConfiguration.networkId = mNetworkId;
+        if (!isValidConfig(this)) {
+            return wifiConfigurations;
+        }
 
         if (TextUtils.isEmpty(mSecurity) || SECURITY_NO_PASSWORD.equals(mSecurity)) {
-            wifiConfiguration.allowedKeyManagement.set(KeyMgmt.NONE);
-            return wifiConfiguration;
+            // TODO (b/129835824): we add both open network and enhanced open network to WifiManager
+            //                     for android Q, should improve it in the future.
+            final WifiConfiguration openNetworkWifiConfiguration = getBasicWifiConfiguration();
+            openNetworkWifiConfiguration.allowedKeyManagement.set(KeyMgmt.NONE);
+            wifiConfigurations.add(openNetworkWifiConfiguration);
+
+            final WifiConfiguration enhancedOpenNetworkWifiConfiguration =
+                    getBasicWifiConfiguration();
+            enhancedOpenNetworkWifiConfiguration.allowedKeyManagement.set(KeyMgmt.OWE);
+            enhancedOpenNetworkWifiConfiguration.requirePMF = true;
+            wifiConfigurations.add(enhancedOpenNetworkWifiConfiguration);
+            return wifiConfigurations;
         }
 
+        final WifiConfiguration wifiConfiguration = getBasicWifiConfiguration();
         if (mSecurity.startsWith(SECURITY_WEP)) {
             wifiConfiguration.allowedKeyManagement.set(KeyMgmt.NONE);
             wifiConfiguration.allowedAuthAlgorithms.set(AuthAlgorithm.OPEN);
@@ -268,11 +284,27 @@
             } else {
                 wifiConfiguration.preSharedKey = addQuotationIfNeeded(mPreSharedKey);
             }
+        } else if (mSecurity.startsWith(SECURITY_SAE)) {
+            wifiConfiguration.allowedKeyManagement.set(KeyMgmt.SAE);
+            wifiConfiguration.requirePMF = true;
+            if (mPreSharedKey.length() != 0) {
+                wifiConfiguration.preSharedKey = addQuotationIfNeeded(mPreSharedKey);
+            }
         } else {
             Log.w(TAG, "Unsupported security");
-            return null;
+            return wifiConfigurations;
         }
 
+        wifiConfigurations.add(wifiConfiguration);
+        return wifiConfigurations;
+    }
+
+    private WifiConfiguration getBasicWifiConfiguration() {
+        final WifiConfiguration wifiConfiguration = new WifiConfiguration();
+
+        wifiConfiguration.SSID = addQuotationIfNeeded(mSsid);
+        wifiConfiguration.hiddenSSID = mHiddenSsid;
+        wifiConfiguration.networkId = mNetworkId;
         return wifiConfiguration;
     }
 
diff --git a/src/com/android/settings/wifi/dpp/WifiQrCode.java b/src/com/android/settings/wifi/dpp/WifiQrCode.java
index 8296a62..40ae111 100644
--- a/src/com/android/settings/wifi/dpp/WifiQrCode.java
+++ b/src/com/android/settings/wifi/dpp/WifiQrCode.java
@@ -64,10 +64,10 @@
     public static final String DELIMITER_QR_CODE = ";";
 
     // Ignores password if security is SECURITY_NO_PASSWORD or absent
-    public static final String SECURITY_NO_PASSWORD = "nopass";
+    public static final String SECURITY_NO_PASSWORD = "nopass"; //open network or OWE
     public static final String SECURITY_WEP = "WEP";
     public static final String SECURITY_WPA_PSK = "WPA";
-    public static final String SECURITY_SAE = "WPA3";
+    public static final String SECURITY_SAE = "SAE";
 
     private String mQrCode;
 
diff --git a/src/com/android/settings/wifi/qrcode/QrCamera.java b/src/com/android/settings/wifi/qrcode/QrCamera.java
index 45de6b5..b7d41ba 100644
--- a/src/com/android/settings/wifi/qrcode/QrCamera.java
+++ b/src/com/android/settings/wifi/qrcode/QrCamera.java
@@ -401,4 +401,14 @@
             mScannerCallback.handleSuccessfulResult(qrCode.getText());
         }
     }
+
+    /**
+     * After {@link #start(SurfaceTexture)}, DecodingTask runs continuously to capture images and
+     * decode QR code. DecodingTask become null After {@link #stop()}.
+     *
+     * Uses this method in test case to prevent power consumption problem.
+     */
+    public boolean isDecodeTaskAlive() {
+        return mDecodeTask != null;
+    }
 }
diff --git a/tests/robotests/res/values-mcc999/config.xml b/tests/robotests/res/values-mcc999/config.xml
index 1fe4bbe..cacecd6 100644
--- a/tests/robotests/res/values-mcc999/config.xml
+++ b/tests/robotests/res/values-mcc999/config.xml
@@ -46,7 +46,6 @@
     <bool name="config_show_show_password">false</bool>
     <bool name="config_show_trust_agent_click_intent">false</bool>
     <bool name="config_show_wallpaper_attribution">false</bool>
-    <bool name="config_show_default_home">false</bool>
     <bool name="config_show_assist_and_voice_input">false</bool>
     <bool name="config_show_phone_language">false</bool>
     <bool name="config_show_virtual_keyboard_pref">false</bool>
diff --git a/tests/robotests/src/com/android/settings/applications/DefaultAppSettingsTest.java b/tests/robotests/src/com/android/settings/applications/DefaultAppSettingsTest.java
deleted file mode 100644
index 1ab086c..0000000
--- a/tests/robotests/src/com/android/settings/applications/DefaultAppSettingsTest.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.applications;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.os.UserManager;
-import android.telephony.TelephonyManager;
-
-import com.android.settings.R;
-import com.android.settings.applications.defaultapps.DefaultBrowserPreferenceController;
-import com.android.settings.applications.defaultapps.DefaultPhonePreferenceController;
-import com.android.settings.applications.defaultapps.DefaultSmsPreferenceController;
-import com.android.settings.dashboard.SummaryLoader;
-import com.android.settings.testutils.XmlTestUtils;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.util.ReflectionHelpers;
-
-import java.util.List;
-
-@RunWith(RobolectricTestRunner.class)
-public class DefaultAppSettingsTest {
-
-    private Context mContext;
-
-    private DefaultAppSettings mFragment;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-        mContext = RuntimeEnvironment.application;
-        mFragment = new DefaultAppSettings();
-        mFragment.onAttach(mContext);
-    }
-
-    @Test
-    public void getPreferenceScreenResId_shouldUseAppDefaultSettingPrefLayout() {
-        assertThat(mFragment.getPreferenceScreenResId()).isEqualTo(R.xml.app_default_settings);
-    }
-
-    @Test
-    public void setListening_shouldUpdateSummary() {
-        final SummaryLoader summaryLoader = mock(SummaryLoader.class);
-        final DefaultAppSettings.SummaryProvider summaryProvider =
-                new DefaultAppSettings.SummaryProvider(mContext, summaryLoader);
-        final DefaultSmsPreferenceController defaultSms =
-                mock(DefaultSmsPreferenceController.class);
-        final DefaultBrowserPreferenceController defaultBrowser =
-                mock(DefaultBrowserPreferenceController.class);
-        final DefaultPhonePreferenceController defaultPhone =
-                mock(DefaultPhonePreferenceController.class);
-        ReflectionHelpers.setField(summaryProvider, "mDefaultSmsPreferenceController", defaultSms);
-        ReflectionHelpers.setField(
-                summaryProvider, "mDefaultBrowserPreferenceController", defaultBrowser);
-        ReflectionHelpers.setField(
-                summaryProvider, "mDefaultPhonePreferenceController", defaultPhone);
-
-        // all available
-        when(defaultSms.getDefaultAppLabel()).thenReturn("Sms1");
-        when(defaultBrowser.getDefaultAppLabel()).thenReturn("Browser1");
-        when(defaultPhone.getDefaultAppLabel()).thenReturn("Phone1");
-        summaryProvider.setListening(true);
-
-        verify(summaryLoader).setSummary(summaryProvider, "Browser1, Phone1, and Sms1");
-
-        // 2 available
-        when(defaultSms.getDefaultAppLabel()).thenReturn(null);
-        when(defaultBrowser.getDefaultAppLabel()).thenReturn("Browser1");
-        when(defaultPhone.getDefaultAppLabel()).thenReturn("Phone1");
-        summaryProvider.setListening(true);
-
-        verify(summaryLoader).setSummary(summaryProvider, "Browser1 and Phone1");
-
-        when(defaultSms.getDefaultAppLabel()).thenReturn("Sms1");
-        when(defaultBrowser.getDefaultAppLabel()).thenReturn(null);
-        when(defaultPhone.getDefaultAppLabel()).thenReturn("Phone1");
-        summaryProvider.setListening(true);
-
-        verify(summaryLoader).setSummary(summaryProvider, "Phone1 and Sms1");
-
-        when(defaultSms.getDefaultAppLabel()).thenReturn("Sms1");
-        when(defaultBrowser.getDefaultAppLabel()).thenReturn("Browser1");
-        when(defaultPhone.getDefaultAppLabel()).thenReturn(null);
-        summaryProvider.setListening(true);
-
-        verify(summaryLoader).setSummary(summaryProvider, "Browser1 and Sms1");
-
-        // 1 available
-        when(defaultSms.getDefaultAppLabel()).thenReturn(null);
-        when(defaultBrowser.getDefaultAppLabel()).thenReturn("Browser1");
-        when(defaultPhone.getDefaultAppLabel()).thenReturn(null);
-        summaryProvider.setListening(true);
-
-        verify(summaryLoader).setSummary(summaryProvider, "Browser1");
-
-        when(defaultSms.getDefaultAppLabel()).thenReturn("Sms1");
-        when(defaultBrowser.getDefaultAppLabel()).thenReturn(null);
-        when(defaultPhone.getDefaultAppLabel()).thenReturn(null);
-        summaryProvider.setListening(true);
-
-        verify(summaryLoader).setSummary(summaryProvider, "Sms1");
-
-        when(defaultSms.getDefaultAppLabel()).thenReturn(null);
-        when(defaultBrowser.getDefaultAppLabel()).thenReturn(null);
-        when(defaultPhone.getDefaultAppLabel()).thenReturn("Phone1");
-        summaryProvider.setListening(true);
-
-        verify(summaryLoader).setSummary(summaryProvider, "Phone1");
-
-        // None available
-        when(defaultSms.getDefaultAppLabel()).thenReturn(null);
-        when(defaultBrowser.getDefaultAppLabel()).thenReturn(null);
-        when(defaultPhone.getDefaultAppLabel()).thenReturn(null);
-        summaryProvider.setListening(true);
-
-        verify(summaryLoader, never()).setSummary(summaryProvider, eq(anyString()));
-    }
-
-    @Test
-    public void testNonIndexableKeys_existInXmlLayout() {
-        final Context context = spy(RuntimeEnvironment.application);
-        when(context.getApplicationContext()).thenReturn(context);
-        final UserManager userManager = mock(UserManager.class, RETURNS_DEEP_STUBS);
-
-        when(context.getSystemService(Context.USER_SERVICE))
-                .thenReturn(userManager);
-        when(userManager.getUserInfo(anyInt()).isRestricted()).thenReturn(true);
-
-        when(context.getSystemService(Context.TELEPHONY_SERVICE))
-                .thenReturn(mock(TelephonyManager.class));
-        when(context.getPackageManager())
-                .thenReturn(mock(PackageManager.class));
-        final List<String> niks = DefaultAppSettings.SEARCH_INDEX_DATA_PROVIDER
-                .getNonIndexableKeys(context);
-
-        final int xmlId = new DefaultAppSettings().getPreferenceScreenResId();
-
-        final List<String> keys = XmlTestUtils.getKeysFromPreferenceXml(context, xmlId);
-
-        assertThat(keys).containsAllIn(niks);
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/applications/DefaultAppsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/DefaultAppsPreferenceControllerTest.java
new file mode 100644
index 0000000..6d53179
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/applications/DefaultAppsPreferenceControllerTest.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright (C) 2019 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 com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.when;
+
+import android.app.role.RoleManager;
+import android.content.Context;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+
+import java.util.Collections;
+
+@RunWith(RobolectricTestRunner.class)
+public class DefaultAppsPreferenceControllerTest {
+
+    private static final String PREFERENCE_KEY = "DefaultApps";
+
+    private static final String BROWSER_PACKAGE_NAME = "com.example.browser1";
+    private static final String DIALER_PACKAGE_NAME = "com.example.dialer1";
+    private static final String SMS_PACKAGE_NAME = "com.example.sms1";
+
+    @Mock
+    private Context mContext;
+    @Mock
+    private PackageManager mPackageManager;
+    @Mock
+    private RoleManager mRoleManager;
+    @Mock
+    private ApplicationInfo mBrowserApplicationInfo;
+    @Mock
+    private ApplicationInfo mDialerApplicationInfo;
+    @Mock
+    private ApplicationInfo mSmsApplicationInfo;
+
+    private DefaultAppsPreferenceController mPreferenceController;
+
+    @Before
+    public void setUp() throws PackageManager.NameNotFoundException {
+        MockitoAnnotations.initMocks(this);
+
+        when(mContext.getPackageManager()).thenReturn(mPackageManager);
+        when(mContext.getSystemService(RoleManager.class)).thenReturn(mRoleManager);
+
+        when(mBrowserApplicationInfo.loadLabel(mPackageManager)).thenReturn("Browser1");
+        when(mPackageManager.getApplicationInfo(eq(BROWSER_PACKAGE_NAME), anyInt())).thenReturn(
+                mBrowserApplicationInfo);
+        when(mDialerApplicationInfo.loadLabel(mPackageManager)).thenReturn("Phone1");
+        when(mPackageManager.getApplicationInfo(eq(DIALER_PACKAGE_NAME), anyInt())).thenReturn(
+                mDialerApplicationInfo);
+        when(mSmsApplicationInfo.loadLabel(mPackageManager)).thenReturn("Sms1");
+        when(mPackageManager.getApplicationInfo(eq(SMS_PACKAGE_NAME), anyInt())).thenReturn(
+                mSmsApplicationInfo);
+
+        mPreferenceController = new DefaultAppsPreferenceController(mContext, PREFERENCE_KEY);
+    }
+
+    @Test
+    public void isAvailable_shouldReturnTrue() {
+        assertThat(mPreferenceController.isAvailable()).isTrue();
+    }
+
+    @Test
+    public void getSummary_allAvailable_shouldReturnAll() {
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
+                Collections.singletonList(BROWSER_PACKAGE_NAME));
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
+                Collections.singletonList(DIALER_PACKAGE_NAME));
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(
+                Collections.singletonList(SMS_PACKAGE_NAME));
+
+        assertThat(mPreferenceController.getSummary()).isEqualTo("Browser1, Phone1, and Sms1");
+    }
+
+    @Test
+    public void getSummary_browserAndDialerAvailable_shouldReturnBrowserAndDialer() {
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
+                Collections.singletonList(BROWSER_PACKAGE_NAME));
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
+                Collections.singletonList(DIALER_PACKAGE_NAME));
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(Collections.emptyList());
+
+        assertThat(mPreferenceController.getSummary()).isEqualTo("Browser1 and Phone1");
+    }
+
+    @Test
+    public void getSummary_browserAndSmsAvailable_shouldReturnBrowserAndSms() {
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
+                Collections.singletonList(BROWSER_PACKAGE_NAME));
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
+                Collections.emptyList());
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(
+                Collections.singletonList(SMS_PACKAGE_NAME));
+
+        assertThat(mPreferenceController.getSummary()).isEqualTo("Browser1 and Sms1");
+    }
+
+    @Test
+    public void getSummary_dialerAndSmsAvailable_shouldReturnDialerAndSms() {
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
+                Collections.emptyList());
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
+                Collections.singletonList(DIALER_PACKAGE_NAME));
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(
+                Collections.singletonList(SMS_PACKAGE_NAME));
+
+        assertThat(mPreferenceController.getSummary()).isEqualTo("Phone1 and Sms1");
+    }
+
+    @Test
+    public void getSummary_browserAvailable_shouldReturnBrowser() {
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
+                Collections.singletonList(BROWSER_PACKAGE_NAME));
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
+                Collections.emptyList());
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(Collections.emptyList());
+
+        assertThat(mPreferenceController.getSummary()).isEqualTo("Browser1");
+    }
+
+    @Test
+    public void getSummary_dialerAvailable_shouldReturnDialer() {
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
+                Collections.emptyList());
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
+                Collections.singletonList(DIALER_PACKAGE_NAME));
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(Collections.emptyList());
+
+        assertThat(mPreferenceController.getSummary()).isEqualTo("Phone1");
+    }
+
+    @Test
+    public void getSummary_smsAvailable_shouldReturnSms() {
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
+                Collections.emptyList());
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
+                Collections.emptyList());
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(
+                Collections.singletonList(SMS_PACKAGE_NAME));
+
+        assertThat(mPreferenceController.getSummary()).isEqualTo("Sms1");
+    }
+
+    @Test
+    public void getSummary_noneAvailable_shouldReturnNull() {
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
+                Collections.emptyList());
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
+                Collections.emptyList());
+        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(Collections.emptyList());
+
+        assertThat(mPreferenceController.getSummary()).isNull();
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPickerTest.java
deleted file mode 100644
index 3386d83..0000000
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPickerTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.os.UserManager;
-
-import com.android.settings.testutils.FakeFeatureFactory;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Answers;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.util.ReflectionHelpers;
-
-@RunWith(RobolectricTestRunner.class)
-public class DefaultBrowserPickerTest {
-
-    private static final String TEST_APP_KEY = "";
-
-    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
-    private Activity mActivity;
-    @Mock
-    private UserManager mUserManager;
-    @Mock
-    private PackageManager mPackageManager;
-
-    private DefaultBrowserPicker mPicker;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-        FakeFeatureFactory.setupForTest();
-        when(mActivity.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
-
-        mPicker = new DefaultBrowserPicker();
-        mPicker.onAttach(mActivity);
-
-        ReflectionHelpers.setField(mPicker, "mPm", mPackageManager);
-    }
-
-    @Test
-    public void setDefaultAppKey_shouldUpdateDefaultBrowser() {
-        mPicker.setDefaultKey(TEST_APP_KEY);
-        verify(mPackageManager).setDefaultBrowserPackageNameAsUser(eq(TEST_APP_KEY), anyInt());
-    }
-
-    @Test
-    public void getDefaultAppKey_shouldReturnDefaultBrowser() {
-        mPicker.getDefaultKey();
-        verify(mPackageManager).getDefaultBrowserPackageNameAsUser(anyInt());
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceControllerTest.java
deleted file mode 100644
index 5197eb3..0000000
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultBrowserPreferenceControllerTest.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.ActivityInfo;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.ResolveInfo;
-import android.content.res.Resources;
-import android.os.UserManager;
-
-import androidx.preference.Preference;
-
-import com.android.settings.R;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Answers;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.util.ReflectionHelpers;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-@RunWith(RobolectricTestRunner.class)
-public class DefaultBrowserPreferenceControllerTest {
-
-    @Mock
-    private Context mContext;
-    @Mock
-    private UserManager mUserManager;
-    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
-    private PackageManager mPackageManager;
-
-    private DefaultBrowserPreferenceController mController;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-        when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
-
-        mController = new DefaultBrowserPreferenceController(mContext);
-        ReflectionHelpers.setField(mController, "mPackageManager", mPackageManager);
-    }
-
-    @Test
-    public void isAvailable_noBrowser_shouldReturnFalse() {
-        when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
-                .thenReturn(null);
-        assertThat(mController.isAvailable()).isFalse();
-    }
-
-    @Test
-    public void isAvailable_hasBrowser_shouldReturnTrue() {
-        when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
-            .thenReturn(Collections.singletonList(createResolveInfo("com.test.pkg")));
-
-        assertThat(mController.isAvailable()).isTrue();
-    }
-
-    @Test
-    public void getSoleAppLabel_hasNoApp_shouldNotReturnLabel() {
-        when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
-                .thenReturn(null);
-        final Preference pref = mock(Preference.class);
-
-        mController.updateState(pref);
-        verify(pref).setSummary(R.string.app_list_preference_none);
-    }
-
-    @Test
-    public void getDefaultAppLabel_hasAppWithMultipleResolvedInfo_shouldReturnLabel()
-            throws NameNotFoundException {
-        DefaultBrowserPreferenceController spyController = spy(mController);
-        doReturn(null).when(spyController).getDefaultAppIcon();
-        final List<ResolveInfo> resolveInfos = new ArrayList<>();
-        final CharSequence PACKAGE_NAME = "com.test.package";
-
-        // This ResolveInfo will return a non-null label from loadLabel.
-        final ResolveInfo info1 = createResolveInfo(PACKAGE_NAME.toString());
-        info1.nonLocalizedLabel = PACKAGE_NAME;
-        resolveInfos.add(info1);
-
-        // This ResolveInfo will return a null label from loadLabel.
-        final ResolveInfo info2 = createResolveInfo(PACKAGE_NAME.toString());
-        resolveInfos.add(info2);
-
-        when(mPackageManager.getDefaultBrowserPackageNameAsUser(anyInt())).thenReturn(null);
-        when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
-            .thenReturn(resolveInfos);
-        when(mPackageManager.getApplicationInfoAsUser(
-            eq(PACKAGE_NAME.toString()), anyInt(), anyInt()))
-            .thenReturn(createApplicationInfo(PACKAGE_NAME.toString()));
-
-        assertThat(spyController.getDefaultAppLabel()).isEqualTo(PACKAGE_NAME);
-    }
-
-    @Test
-    public void getDefaultApp_shouldGetDefaultBrowserPackage() {
-        mController.getDefaultAppInfo();
-
-        verify(mPackageManager).getDefaultBrowserPackageNameAsUser(anyInt());
-    }
-
-    @Test
-    public void getDefaultApp_shouldGetApplicationInfoAsUser() throws NameNotFoundException {
-        final String PACKAGE_NAME = "com.test.package";
-        when(mPackageManager.getDefaultBrowserPackageNameAsUser(anyInt())).thenReturn(PACKAGE_NAME);
-
-        mController.getDefaultAppInfo();
-
-        verify(mPackageManager).getApplicationInfoAsUser(eq(PACKAGE_NAME), anyInt(), anyInt());
-    }
-
-    @Test
-    public void isBrowserDefault_onlyApp_shouldReturnTrue() {
-        when(mPackageManager.getDefaultBrowserPackageNameAsUser(anyInt())).thenReturn(null);
-        final List<ResolveInfo> resolveInfos = new ArrayList<>();
-        final String PACKAGE_ONE = "pkg";
-        resolveInfos.add(createResolveInfo(PACKAGE_ONE));
-        when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
-            .thenReturn(resolveInfos);
-
-        assertThat(mController.isBrowserDefault("pkg", 0)).isTrue();
-    }
-
-    @Test
-    public void getCandidates_shouldNotIncludeDuplicatePackageName() throws NameNotFoundException {
-        final List<ResolveInfo> resolveInfos = new ArrayList<>();
-        final String PACKAGE_ONE = "com.first.package";
-        final String PACKAGE_TWO = "com.second.package";
-        resolveInfos.add(createResolveInfo(PACKAGE_ONE));
-        resolveInfos.add(createResolveInfo(PACKAGE_TWO));
-        resolveInfos.add(createResolveInfo(PACKAGE_ONE));
-        resolveInfos.add(createResolveInfo(PACKAGE_TWO));
-        when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
-            .thenReturn(resolveInfos);
-        when(mPackageManager.getApplicationInfoAsUser(eq(PACKAGE_ONE), anyInt(), anyInt()))
-            .thenReturn(createApplicationInfo(PACKAGE_ONE));
-        when(mPackageManager.getApplicationInfoAsUser(eq(PACKAGE_TWO), anyInt(), anyInt()))
-            .thenReturn(createApplicationInfo(PACKAGE_TWO));
-
-        final List<ResolveInfo> defaultBrowserInfo =
-            DefaultBrowserPreferenceController.getCandidates(mPackageManager, 0 /* userId */);
-
-        assertThat(defaultBrowserInfo.size()).isEqualTo(2);
-    }
-
-    @Test
-    public void getCandidates_shouldQueryActivityWithMatchAll() {
-        DefaultBrowserPreferenceController.getCandidates(mPackageManager, 0 /* userId */);
-
-        verify(mPackageManager).queryIntentActivitiesAsUser(
-            any(Intent.class), eq(PackageManager.MATCH_ALL), eq(0) /* userId */);
-    }
-
-    @Test
-    public void getOnlyAppIcon_shouldGetApplicationInfoAsUser() throws NameNotFoundException {
-        final List<ResolveInfo> resolveInfos = new ArrayList<>();
-        final String PACKAGE_NAME = "com.test.package";
-        resolveInfos.add(createResolveInfo(PACKAGE_NAME));
-        when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
-            .thenReturn(resolveInfos);
-        when(mContext.getPackageManager()).thenReturn(mPackageManager);
-        when(mContext.getSystemService(UserManager.class)).thenReturn(mUserManager);
-        when(mContext.getResources()).thenReturn(mock(Resources.class));
-
-        mController.getOnlyAppIcon();
-
-        verify(mPackageManager).getApplicationInfoAsUser(
-            eq(PACKAGE_NAME), eq(0) /* flags */, eq(0) /* userId */);
-    }
-
-    @Test
-    public void hasBrowserPreference_shouldQueryIntentActivitiesAsUser() {
-        when(mContext.getPackageManager()).thenReturn(mPackageManager);
-
-        DefaultBrowserPreferenceController
-            .hasBrowserPreference("com.test.package", mContext, 0 /* userId */);
-
-        verify(mPackageManager).queryIntentActivitiesAsUser(
-            any(Intent.class), eq(0) /* flags */, eq(0) /* userId */);
-    }
-
-    private ResolveInfo createResolveInfo(String packageName) {
-        final ResolveInfo info = new ResolveInfo();
-        info.handleAllWebDataURI = true;
-        info.activityInfo = new ActivityInfo();
-        info.activityInfo.packageName = packageName;
-        info.activityInfo.applicationInfo = createApplicationInfo(packageName);
-        return info;
-    }
-
-    private ApplicationInfo createApplicationInfo(String packageName) {
-        final ApplicationInfo info = new ApplicationInfo();
-        info.packageName = packageName;
-        return info;
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultEmergencyPickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultEmergencyPickerTest.java
deleted file mode 100644
index b7b046c..0000000
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultEmergencyPickerTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.eq;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.app.Activity;
-import android.app.role.RoleManager;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.os.UserHandle;
-import android.os.UserManager;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Answers;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.shadows.ShadowApplication;
-import org.robolectric.util.ReflectionHelpers;
-
-import java.util.Arrays;
-import java.util.concurrent.Executor;
-import java.util.function.Consumer;
-
-@RunWith(RobolectricTestRunner.class)
-public class DefaultEmergencyPickerTest {
-    private static final String TAG = DefaultEmergencyPickerTest.class.getSimpleName();
-    private static final String TEST_APP_KEY = "test_app";
-
-    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
-    private Activity mActivity;
-    @Mock
-    private UserManager mUserManager;
-    @Mock
-    private PackageManager mPackageManager;
-    @Mock
-    private RoleManager mRoleManager;
-
-    private DefaultEmergencyPicker mPicker;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-        ShadowApplication shadowApplication = ShadowApplication.getInstance();
-        shadowApplication.setSystemService(Context.ROLE_SERVICE, mRoleManager);
-        when(mActivity.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
-
-        mPicker = spy(new DefaultEmergencyPicker());
-        mPicker.onAttach(mActivity);
-
-        ReflectionHelpers.setField(mPicker, "mPm", mPackageManager);
-        when(mPicker.getContext()).thenReturn(RuntimeEnvironment.application);
-    }
-
-    @Test
-    public void setDefaultAppKey_shouldUpdateDefault() {
-        mPicker.setDefaultKey(TEST_APP_KEY);
-        verify(mRoleManager).addRoleHolderAsUser(
-            eq(RoleManager.ROLE_EMERGENCY),
-            eq(TEST_APP_KEY),
-            eq(0),
-            any(UserHandle.class),
-            any(Executor.class),
-            any(Consumer.class));
-    }
-
-    @Test
-    public void getDefaultAppKey_shouldReturnDefault() {
-      when(mRoleManager.getRoleHolders(RoleManager.ROLE_EMERGENCY))
-              .thenReturn(Arrays.asList(TEST_APP_KEY));
-      assertThat(mPicker.getDefaultKey()).isEqualTo(TEST_APP_KEY);
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePickerTest.java
deleted file mode 100644
index be4fdbf..0000000
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePickerTest.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyList;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doReturn;
-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.Activity;
-import android.app.AppOpsManager;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.IntentFilter;
-import android.content.pm.ActivityInfo;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.ResolveInfo;
-import android.content.pm.UserInfo;
-import android.os.Build;
-import android.os.UserManager;
-
-import com.android.settings.testutils.FakeFeatureFactory;
-import com.android.settingslib.applications.DefaultAppInfo;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Answers;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.util.ReflectionHelpers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@RunWith(RobolectricTestRunner.class)
-public class DefaultHomePickerTest {
-
-    private static final String TEST_APP_KEY = "com.android.settings/DefaultEmergencyPickerTest";
-
-    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
-    private Activity mActivity;
-    @Mock
-    private UserManager mUserManager;
-    @Mock
-    private AppOpsManager mAppOpsManager;
-    @Mock
-    private PackageManager mPackageManager;
-
-    private Context mContext;
-    private DefaultHomePicker mPicker;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-
-        FakeFeatureFactory.setupForTest();
-
-        when(mActivity.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
-        when(mActivity.getSystemService(Context.APP_OPS_SERVICE)).thenReturn(mAppOpsManager);
-        when(mActivity.getApplicationContext()).thenReturn(RuntimeEnvironment.application);
-
-        mPicker = spy(new DefaultHomePicker());
-        mPicker.onAttach((Context) mActivity);
-
-        ReflectionHelpers.setField(mPicker, "mPm", mPackageManager);
-        mContext = spy(RuntimeEnvironment.application);
-        doReturn(mContext).when(mPicker).getContext();
-    }
-
-    @Test
-    public void setDefaultAppKey_shouldUpdateDefault() {
-        assertThat(mPicker.setDefaultKey(TEST_APP_KEY)).isTrue();
-
-        verify(mPackageManager).replacePreferredActivity(any(IntentFilter.class),
-                anyInt(), any(ComponentName[].class), any(ComponentName.class));
-        verify(mContext).startActivity(any());
-    }
-
-    @Test
-    public void getDefaultAppKey_shouldReturnDefault() {
-        final ComponentName cn = mock(ComponentName.class);
-        when(mPackageManager.getHomeActivities(anyList())).thenReturn(cn);
-        mPicker.getDefaultKey();
-        verify(cn).flattenToString();
-    }
-
-    @Test
-    public void getCandidates_allLaunchersAvailableIfNoManagedProfile() {
-        addLaunchers();
-        List<DefaultAppInfo> candidates = mPicker.getCandidates();
-        assertThat(candidates.size()).isEqualTo(2);
-        assertThat(candidates.get(0).summary).isNull();
-        assertThat(candidates.get(0).enabled).isTrue();
-        assertThat(candidates.get(1).summary).isNull();
-        assertThat(candidates.get(1).enabled).isTrue();
-    }
-
-    @Test
-    public void getCandidates_onlyLollipopPlusLaunchersAvailableIfManagedProfile() {
-        List<UserInfo> profiles = new ArrayList<>();
-        profiles.add(new UserInfo(/*id=*/ 10, "TestUserName", UserInfo.FLAG_MANAGED_PROFILE));
-        when(mUserManager.getProfiles(anyInt())).thenReturn(profiles);
-
-        addLaunchers();
-        List<DefaultAppInfo> candidates = mPicker.getCandidates();
-        assertThat(candidates.size()).isEqualTo(2);
-        DefaultAppInfo lollipopPlusLauncher = candidates.get(0);
-        assertThat(lollipopPlusLauncher.summary).isNull();
-        assertThat(lollipopPlusLauncher.enabled).isTrue();
-
-        DefaultAppInfo preLollipopLauncher = candidates.get(1);
-        assertThat(preLollipopLauncher.summary).isNotNull();
-        assertThat(preLollipopLauncher.enabled).isFalse();
-    }
-
-    private ResolveInfo createLauncher(
-            String packageName, String className, int targetSdk) throws NameNotFoundException {
-        ResolveInfo launcher = new ResolveInfo();
-        launcher.activityInfo = new ActivityInfo();
-        launcher.activityInfo.packageName = packageName;
-        launcher.activityInfo.name = className;
-        ApplicationInfo launcherAppInfo = new ApplicationInfo();
-        launcherAppInfo.targetSdkVersion = targetSdk;
-        when(mPackageManager.getApplicationInfo(eq(launcher.activityInfo.packageName), anyInt()))
-                .thenReturn(launcherAppInfo);
-        return launcher;
-    }
-
-    private void addLaunchers() {
-        doAnswer(invocation -> {
-                // The result of this method is stored in the first parameter...
-                List<ResolveInfo> parameter = (List<ResolveInfo>) invocation.getArguments()[0];
-                parameter.add(createLauncher(
-                        "package.1", "LollipopPlusLauncher", Build.VERSION_CODES.LOLLIPOP));
-                parameter.add(createLauncher(
-                        "package.2", "PreLollipopLauncher", Build.VERSION_CODES.KITKAT));
-                return null;
-                })
-                .when(mPackageManager).getHomeActivities(anyList());
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceControllerTest.java
deleted file mode 100644
index c19b315..0000000
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultHomePreferenceControllerTest.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyList;
-import static org.mockito.Mockito.atLeastOnce;
-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.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.ActivityInfo;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
-import android.os.UserManager;
-
-import androidx.preference.Preference;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Answers;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.Config;
-import org.robolectric.util.ReflectionHelpers;
-
-@RunWith(RobolectricTestRunner.class)
-public class DefaultHomePreferenceControllerTest {
-
-    private static final String TEST_PACKAGE = "test.pkg";
-    private static final String TEST_CLASS = "class";
-
-    @Mock
-    private UserManager mUserManager;
-    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
-    private PackageManager mPackageManager;
-
-    private Context mContext;
-    private DefaultHomePreferenceController mController;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-        mContext = spy(RuntimeEnvironment.application);
-        when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
-
-        mController = spy(new DefaultHomePreferenceController(mContext));
-        ReflectionHelpers.setField(mController, "mPackageManager", mPackageManager);
-    }
-
-    @Test
-    public void testDefaultHome_byDefault_shouldBeShown() {
-        assertThat(mController.isAvailable()).isTrue();
-    }
-
-    @Test
-    @Config(qualifiers = "mcc999")
-    public void testDefaultHome_ifDisabled_shouldNotBeShown() {
-        assertThat(mController.isAvailable()).isFalse();
-    }
-
-    @Test
-    public void getDefaultApp_shouldGetDefaultBrowserPackage() {
-        assertThat(mController.getDefaultAppInfo()).isNotNull();
-
-        verify(mPackageManager).getHomeActivities(anyList());
-    }
-
-    @Test
-    public void getDefaultApp_noDefaultHome_shouldReturnNull() {
-        when(mPackageManager.getHomeActivities(anyList())).thenReturn(null);
-
-        assertThat(mController.getDefaultAppInfo()).isNull();
-    }
-
-    @Test
-    public void updateState_noDefaultApp_shouldAskPackageManagerForOnlyApp() {
-        when(mPackageManager.getHomeActivities(anyList())).thenReturn(null);
-        mController.updateState(mock(Preference.class));
-
-        verify(mPackageManager, atLeastOnce()).getHomeActivities(anyList());
-    }
-
-    @Test
-    public void testIsHomeDefault_noDefaultSet_shouldReturnTrue() {
-        when(mPackageManager.getHomeActivities(anyList())).thenReturn(null);
-        assertThat(DefaultHomePreferenceController.isHomeDefault(TEST_PACKAGE, mPackageManager))
-                .isTrue();
-    }
-
-    @Test
-    public void testIsHomeDefault_defaultSetToPkg_shouldReturnTrue() {
-        final String pkgName = TEST_PACKAGE;
-        final ComponentName defaultHome = new ComponentName(pkgName, TEST_CLASS);
-
-        when(mPackageManager.getHomeActivities(anyList())).thenReturn(defaultHome);
-
-        assertThat(DefaultHomePreferenceController.isHomeDefault(pkgName, mPackageManager))
-                .isTrue();
-    }
-
-    @Test
-    public void testIsHomeDefault_defaultSetToOtherPkg_shouldReturnFalse() {
-        final String pkgName = TEST_PACKAGE;
-        final ComponentName defaultHome = new ComponentName("not" + pkgName, TEST_CLASS);
-
-        when(mPackageManager.getHomeActivities(anyList())).thenReturn(defaultHome);
-
-        assertThat(DefaultHomePreferenceController.isHomeDefault(pkgName, mPackageManager))
-                .isFalse();
-    }
-
-    @Test
-    public void testGetSettingIntent_homeHasNoSetting_shouldNotReturnSettingIntent() {
-        when(mPackageManager.getHomeActivities(anyList()))
-            .thenReturn(new ComponentName(TEST_PACKAGE, TEST_CLASS));
-        when(mPackageManager.resolveActivity(any(Intent.class), anyInt()))
-            .thenReturn(null);
-
-        assertThat(mController.getSettingIntent(mController.getDefaultAppInfo())).isNull();
-    }
-
-    @Test
-    public void testGetSettingIntent_homeHasOneSetting_shouldReturnSettingIntent() {
-        when(mPackageManager.getHomeActivities(anyList()))
-            .thenReturn(new ComponentName(TEST_PACKAGE, TEST_CLASS));
-        final ResolveInfo info = mock(ResolveInfo.class);
-        info.activityInfo = mock(ActivityInfo.class);
-        info.activityInfo.name = TEST_CLASS;
-        info.activityInfo.applicationInfo = mock(ApplicationInfo.class);
-        info.activityInfo.applicationInfo.packageName = TEST_PACKAGE;
-        when(mPackageManager.resolveActivity(any(Intent.class), anyInt()))
-            .thenReturn(info);
-
-        Intent intent = mController.getSettingIntent(mController.getDefaultAppInfo());
-        assertThat(intent).isNotNull();
-        assertThat(intent.getPackage()).isEqualTo(TEST_PACKAGE);
-    }
-
-    @Test
-    public void testGetSettingIntent_noDefauldHome_shouldReturnNull() {
-        when(mPackageManager.getHomeActivities(anyList())).thenReturn(null);
-        assertThat(mController.getSettingIntent(mController.getDefaultAppInfo())).isNull();
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPhonePickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPhonePickerTest.java
deleted file mode 100644
index 743b096..0000000
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPhonePickerTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.os.UserManager;
-
-import com.android.settings.fuelgauge.BatteryUtils;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Answers;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.util.ReflectionHelpers;
-
-@RunWith(RobolectricTestRunner.class)
-public class DefaultPhonePickerTest {
-
-    private static final String TEST_APP_KEY = "com.android.settings/PickerTest";
-
-    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
-    private Activity mActivity;
-    @Mock
-    private UserManager mUserManager;
-    @Mock
-    private DefaultPhonePicker.DefaultKeyUpdater mDefaultKeyUpdater;
-    @Mock
-    private PackageManager mPackageManager;
-    @Mock
-    private BatteryUtils mBatteryUtils;
-
-    private DefaultPhonePicker mPicker;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-        when(mActivity.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
-        when(mActivity.getSystemService(Context.TELECOM_SERVICE)).thenReturn(null);
-        mPicker = spy(new DefaultPhonePicker());
-        mPicker.onAttach(mActivity);
-
-        ReflectionHelpers.setField(mPicker, "mPm", mPackageManager);
-        ReflectionHelpers.setField(mPicker, "mDefaultKeyUpdater", mDefaultKeyUpdater);
-        ReflectionHelpers.setField(mPicker, "mBatteryUtils", mBatteryUtils);
-        doReturn(RuntimeEnvironment.application).when(mPicker).getContext();
-    }
-
-    @Test
-    public void getSystemDefaultPackage_shouldAskDefaultKeyUpdater() {
-        mPicker.getSystemDefaultKey();
-
-        verify(mDefaultKeyUpdater).getSystemDialerPackage();
-    }
-
-    @Test
-    public void setDefaultAppKey_shouldUpdateDefault() {
-        mPicker.setDefaultKey(TEST_APP_KEY);
-
-        verify(mDefaultKeyUpdater)
-            .setDefaultDialerApplication(any(Context.class), eq(TEST_APP_KEY), anyInt());
-    }
-
-    @Test
-    public void getDefaultAppKey_shouldReturnDefault() {
-        mPicker.getDefaultKey();
-
-        verify(mDefaultKeyUpdater).getDefaultDialerApplication(any(Context.class), anyInt());
-    }
-
-    @Test
-    public void setDefaultKey_shouldUnrestrictApp() {
-        mPicker.setDefaultKey(TEST_APP_KEY);
-
-        verify(mBatteryUtils).clearForceAppStandby(TEST_APP_KEY);
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultSmsPickerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultSmsPickerTest.java
deleted file mode 100644
index 6fd65b2..0000000
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultSmsPickerTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2017 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.defaultapps;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.os.UserManager;
-
-import com.android.settings.fuelgauge.BatteryUtils;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Answers;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-import org.robolectric.RuntimeEnvironment;
-import org.robolectric.util.ReflectionHelpers;
-
-@RunWith(RobolectricTestRunner.class)
-public class DefaultSmsPickerTest {
-
-    private static final String TEST_APP_KEY = "com.android.settings/PickerTest";
-
-    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
-    private Activity mActivity;
-    @Mock
-    private UserManager mUserManager;
-    @Mock
-    private DefaultSmsPicker.DefaultKeyUpdater mDefaultKeyUpdater;
-    @Mock
-    private PackageManager mPackageManager;
-    @Mock
-    private BatteryUtils mBatteryUtils;
-
-    private DefaultSmsPicker mPicker;
-
-    @Before
-    public void setUp() {
-        MockitoAnnotations.initMocks(this);
-        when(mActivity.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
-        mPicker = spy(new DefaultSmsPicker());
-        mPicker.onAttach(mActivity);
-
-        ReflectionHelpers.setField(mPicker, "mPm", mPackageManager);
-        ReflectionHelpers.setField(mPicker, "mDefaultKeyUpdater", mDefaultKeyUpdater);
-        ReflectionHelpers.setField(mPicker, "mBatteryUtils", mBatteryUtils);
-        doReturn(RuntimeEnvironment.application).when(mPicker).getContext();
-    }
-
-    @Test
-    public void setDefaultAppKey_shouldUpdateDefault() {
-        mPicker.setDefaultKey(TEST_APP_KEY);
-
-        verify(mDefaultKeyUpdater).setDefaultApplication(any(Context.class), eq(TEST_APP_KEY));
-    }
-
-    @Test
-    public void getDefaultAppKey_shouldReturnDefault() {
-        mPicker.getDefaultKey();
-
-        verify(mDefaultKeyUpdater).getDefaultApplication(any(Context.class));
-    }
-
-    @Test
-    public void setDefaultKey_shouldUnrestrictApp() {
-        mPicker.setDefaultKey(TEST_APP_KEY);
-
-        verify(mBatteryUtils).clearForceAppStandby(TEST_APP_KEY);
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/RolesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/defaultapps/RolesPreferenceControllerTest.java
deleted file mode 100644
index 92468a0..0000000
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/RolesPreferenceControllerTest.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (C) 2018 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.defaultapps;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import android.app.role.RoleManager;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.provider.Settings;
-
-import androidx.preference.Preference;
-
-import com.android.settings.core.BasePreferenceController;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.robolectric.RobolectricTestRunner;
-
-import java.util.Collections;
-
-@RunWith(RobolectricTestRunner.class)
-public class RolesPreferenceControllerTest {
-
-    private static final String PREFERENCE_KEY = "roles";
-    private static final String DIFFERENT_PREFERENCE_KEY = "different";
-
-    private static final String PERMISSION_CONTROLLER_PACKAGE_NAME =
-            "com.android.permissioncontroller";
-
-    private static final String BROWSER_PACKAGE_NAME = "com.example.browser1";
-    private static final String DIALER_PACKAGE_NAME = "com.example.dialer1";
-    private static final String SMS_PACKAGE_NAME = "com.example.sms1";
-
-    @Mock
-    private Context mContext;
-    @Mock
-    private PackageManager mPackageManager;
-    @Mock
-    private RoleManager mRoleManager;
-    @Mock
-    private ApplicationInfo mBrowserApplicationInfo;
-    @Mock
-    private ApplicationInfo mDialerApplicationInfo;
-    @Mock
-    private ApplicationInfo mSmsApplicationInfo;
-
-    @Before
-    public void setUp() throws PackageManager.NameNotFoundException {
-        MockitoAnnotations.initMocks(this);
-
-        when(mContext.getPackageManager()).thenReturn(mPackageManager);
-        when(mContext.getSystemService(RoleManager.class)).thenReturn(mRoleManager);
-
-        when(mBrowserApplicationInfo.loadLabel(mPackageManager)).thenReturn("Browser1");
-        when(mPackageManager.getApplicationInfo(eq(BROWSER_PACKAGE_NAME), anyInt())).thenReturn(
-                mBrowserApplicationInfo);
-        when(mDialerApplicationInfo.loadLabel(mPackageManager)).thenReturn("Phone1");
-        when(mPackageManager.getApplicationInfo(eq(DIALER_PACKAGE_NAME), anyInt())).thenReturn(
-                mDialerApplicationInfo);
-        when(mSmsApplicationInfo.loadLabel(mPackageManager)).thenReturn("Sms1");
-        when(mPackageManager.getApplicationInfo(eq(SMS_PACKAGE_NAME), anyInt())).thenReturn(
-                mSmsApplicationInfo);
-    }
-
-    @Test
-    public void getAvailabilityStatus_noPermissionController_shouldReturnUnsupportedOnDevice() {
-        when(mPackageManager.getPermissionControllerPackageName()).thenReturn(null);
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-
-        assertThat(preferenceController.getAvailabilityStatus())
-                .isEqualTo(BasePreferenceController.UNSUPPORTED_ON_DEVICE);
-    }
-
-    @Test
-    public void getAvailabilityStatus_hasPermissionController_shouldReturnAvailableUnsearchable() {
-        when(mPackageManager.getPermissionControllerPackageName())
-                .thenReturn(PERMISSION_CONTROLLER_PACKAGE_NAME);
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-
-        assertThat(preferenceController.getAvailabilityStatus())
-                .isEqualTo(BasePreferenceController.AVAILABLE_UNSEARCHABLE);
-    }
-
-    @Test
-    public void handlePreferenceTreeClick_differentKey_shouldReturnFalse() {
-        when(mPackageManager.getPermissionControllerPackageName())
-                .thenReturn(PERMISSION_CONTROLLER_PACKAGE_NAME);
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-        Preference preference = mock(Preference.class);
-        when(preference.getKey()).thenReturn(DIFFERENT_PREFERENCE_KEY);
-
-        assertThat(preferenceController.handlePreferenceTreeClick(preference)).isFalse();
-    }
-
-    @Test
-    public void handlePreferenceTreeClick_sameKey_shouldReturnTrue() {
-        when(mPackageManager.getPermissionControllerPackageName())
-                .thenReturn(PERMISSION_CONTROLLER_PACKAGE_NAME);
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-        Preference preference = mock(Preference.class);
-        when(preference.getKey()).thenReturn(PREFERENCE_KEY);
-
-        assertThat(preferenceController.handlePreferenceTreeClick(preference)).isTrue();
-    }
-
-    @Test
-    public void handlePreferenceTreeClick_noPermissionController_shouldNotStartActivity() {
-        when(mPackageManager.getPermissionControllerPackageName()).thenReturn(null);
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-        Preference preference = mock(Preference.class);
-        when(preference.getKey()).thenReturn(PREFERENCE_KEY);
-        preferenceController.handlePreferenceTreeClick(preference);
-
-        verify(mContext, never()).startActivity(any(Intent.class));
-    }
-
-    @Test
-    public void handlePreferenceTreeClick_hasPermissionController_shouldStartActivityWithIntent() {
-        when(mPackageManager.getPermissionControllerPackageName())
-                .thenReturn(PERMISSION_CONTROLLER_PACKAGE_NAME);
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-        Preference preference = mock(Preference.class);
-        when(preference.getKey()).thenReturn(PREFERENCE_KEY);
-        preferenceController.handlePreferenceTreeClick(preference);
-        ArgumentCaptor<Intent> intent = ArgumentCaptor.forClass(Intent.class);
-
-        verify(mContext).startActivity(intent.capture());
-        assertThat(intent.getValue().getAction())
-                .isEqualTo(Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS);
-        assertThat(intent.getValue().getPackage()).isEqualTo(PERMISSION_CONTROLLER_PACKAGE_NAME);
-    }
-
-    @Test
-    public void getSummary_allAvailable_shouldReturnAll() {
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
-                Collections.singletonList(BROWSER_PACKAGE_NAME));
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
-                Collections.singletonList(DIALER_PACKAGE_NAME));
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(
-                Collections.singletonList(SMS_PACKAGE_NAME));
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-
-        assertThat(preferenceController.getSummary()).isEqualTo("Browser1, Phone1, and Sms1");
-    }
-
-    @Test
-    public void getSummary_browserAndDialerAvailable_shouldReturnBrowserAndDialer() {
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
-                Collections.singletonList(BROWSER_PACKAGE_NAME));
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
-                Collections.singletonList(DIALER_PACKAGE_NAME));
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(Collections.emptyList());
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-
-        assertThat(preferenceController.getSummary()).isEqualTo("Browser1 and Phone1");
-    }
-
-    @Test
-    public void getSummary_browserAndSmsAvailable_shouldReturnBrowserAndSms() {
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
-                Collections.singletonList(BROWSER_PACKAGE_NAME));
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
-                Collections.emptyList());
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(
-                Collections.singletonList(SMS_PACKAGE_NAME));
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-
-        assertThat(preferenceController.getSummary()).isEqualTo("Browser1 and Sms1");
-    }
-
-    @Test
-    public void getSummary_dialerAndSmsAvailable_shouldReturnDialerAndSms() {
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
-                Collections.emptyList());
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
-                Collections.singletonList(DIALER_PACKAGE_NAME));
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(
-                Collections.singletonList(SMS_PACKAGE_NAME));
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-
-        assertThat(preferenceController.getSummary()).isEqualTo("Phone1 and Sms1");
-    }
-
-    @Test
-    public void getSummary_browserAvailable_shouldReturnBrowser() {
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
-                Collections.singletonList(BROWSER_PACKAGE_NAME));
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
-                Collections.emptyList());
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(Collections.emptyList());
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-
-        assertThat(preferenceController.getSummary()).isEqualTo("Browser1");
-    }
-
-    @Test
-    public void getSummary_dialerAvailable_shouldReturnDialer() {
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
-                Collections.emptyList());
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
-                Collections.singletonList(DIALER_PACKAGE_NAME));
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(Collections.emptyList());
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-
-        assertThat(preferenceController.getSummary()).isEqualTo("Phone1");
-    }
-
-    @Test
-    public void getSummary_smsAvailable_shouldReturnSms() {
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
-                Collections.emptyList());
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
-                Collections.emptyList());
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(
-                Collections.singletonList(SMS_PACKAGE_NAME));
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-
-        assertThat(preferenceController.getSummary()).isEqualTo("Sms1");
-    }
-
-    @Test
-    public void getSummary_noneAvailable_shouldReturnNull() {
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_BROWSER)).thenReturn(
-                Collections.emptyList());
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_DIALER)).thenReturn(
-                Collections.emptyList());
-        when(mRoleManager.getRoleHolders(RoleManager.ROLE_SMS)).thenReturn(Collections.emptyList());
-        RolesPreferenceController preferenceController = new RolesPreferenceController(mContext,
-                PREFERENCE_KEY);
-
-        assertThat(preferenceController.getSummary()).isNull();
-    }
-}
diff --git a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPaymentSettingsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/specialaccess/DefaultPaymentSettingsPreferenceControllerTest.java
similarity index 70%
rename from tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPaymentSettingsPreferenceControllerTest.java
rename to tests/robotests/src/com/android/settings/applications/specialaccess/DefaultPaymentSettingsPreferenceControllerTest.java
index c9f9363..a287ea6 100644
--- a/tests/robotests/src/com/android/settings/applications/defaultapps/DefaultPaymentSettingsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/specialaccess/DefaultPaymentSettingsPreferenceControllerTest.java
@@ -14,13 +14,11 @@
  * limitations under the License.
  */
 
-package com.android.settings.applications.defaultapps;
+package com.android.settings.applications.specialaccess;
 
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import android.content.Context;
@@ -28,17 +26,12 @@
 import android.nfc.NfcAdapter;
 import android.os.UserManager;
 
-import androidx.preference.Preference;
-
-import com.android.settings.nfc.PaymentBackend;
-
 import org.junit.Before;
 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.util.ReflectionHelpers;
 
 @RunWith(RobolectricTestRunner.class)
@@ -52,11 +45,8 @@
     private UserManager mUserManager;
     @Mock
     private PackageManager mPackageManager;
-    @Mock
-    private PaymentBackend mPaymentBackend;
 
     private DefaultPaymentSettingsPreferenceController mController;
-    private Preference mPreference;
 
     @Before
     public void setUp() {
@@ -64,11 +54,9 @@
 
         when(mContext.getApplicationContext()).thenReturn(mContext);
         when(mContext.getPackageManager()).thenReturn(mPackageManager);
-        when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
-        mController = new DefaultPaymentSettingsPreferenceController(mContext);
+        when(mContext.getSystemService(UserManager.class)).thenReturn(mUserManager);
+        mController = new DefaultPaymentSettingsPreferenceController(mContext, "key");
         ReflectionHelpers.setField(mController, "mNfcAdapter", mNfcAdapter);
-
-        mPreference = new Preference(RuntimeEnvironment.application);
     }
 
     @Test
@@ -88,17 +76,4 @@
 
         assertThat(mController.isAvailable()).isFalse();
     }
-
-    @Test
-    public void updateState_shouldSetSummaryToDefaultPaymentApp() {
-        final PaymentBackend.PaymentAppInfo defaultApp = mock(PaymentBackend.PaymentAppInfo.class);
-        defaultApp.label = "test_payment_app";
-        when(mPaymentBackend.getDefaultApp()).thenReturn(defaultApp);
-        ReflectionHelpers.setField(mController, "mPaymentBackend", mPaymentBackend);
-
-        mController.updateState(mPreference);
-
-        verify(mPaymentBackend).refresh();
-        assertThat(mPreference.getSummary()).isEqualTo(defaultApp.label);
-    }
 }
diff --git a/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java
index 2166e97..223e81b 100644
--- a/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/details/WifiDetailPreferenceControllerTest.java
@@ -36,6 +36,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageManager;
+import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
 import android.net.ConnectivityManager;
@@ -69,6 +70,7 @@
 import com.android.settings.R;
 import com.android.settings.core.FeatureFlags;
 import com.android.settings.development.featureflags.FeatureFlagPersistent;
+import com.android.settings.Utils;
 import com.android.settings.testutils.shadow.ShadowDevicePolicyManager;
 import com.android.settings.testutils.shadow.ShadowEntityHeaderController;
 import com.android.settings.widget.EntityHeaderController;
@@ -1458,6 +1460,36 @@
         verify(mockSignalStrengthPref, times(2)).setVisible(false);
     }
 
+    @Test
+    public void testRedrawIconForHeader_shouldEnlarge() {
+        ArgumentCaptor<BitmapDrawable> drawableCaptor =
+                ArgumentCaptor.forClass(BitmapDrawable.class);
+        Drawable original = mContext.getDrawable(Utils.getWifiIconResource(LEVEL)).mutate();
+        when(mockIconInjector.getIcon(anyInt())).thenReturn(original);
+
+        displayAndResume();
+
+        verify(mockHeaderController, times(1)).setIcon(drawableCaptor.capture());
+
+        int expectedSize = mContext.getResources().getDimensionPixelSize(
+                R.dimen.wifi_detail_page_header_image_size);
+        BitmapDrawable icon = drawableCaptor.getValue();
+        assertThat(icon.getMinimumWidth()).isEqualTo(expectedSize);
+        assertThat(icon.getMinimumHeight()).isEqualTo(expectedSize);
+    }
+
+    @Test
+    public void testRedrawIconForHeader_shouldNotEnlargeIfNotVectorDrawable() {
+        ArgumentCaptor<ColorDrawable> drawableCaptor =
+                ArgumentCaptor.forClass(ColorDrawable.class);
+
+        displayAndResume();
+
+        verify(mockHeaderController, times(1)).setIcon(drawableCaptor.capture());
+        ColorDrawable icon = drawableCaptor.getValue();
+        assertThat(icon).isNotNull();
+    }
+
     private ActionButtonsPreference createMock() {
         final ActionButtonsPreference pref = mock(ActionButtonsPreference.class);
         when(pref.setButton1Text(anyInt())).thenReturn(pref);
diff --git a/tests/unit/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragmentTest.java b/tests/unit/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragmentTest.java
index 16be216..d633689 100644
--- a/tests/unit/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragmentTest.java
+++ b/tests/unit/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragmentTest.java
@@ -16,9 +16,16 @@
 
 package com.android.settings.wifi.dpp;
 
+import static com.android.settings.wifi.dpp.WifiDppUtils.TAG_FRAGMENT_QR_CODE_SCANNER;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.app.Instrumentation;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
 
+import androidx.fragment.app.FragmentManager;
+import androidx.test.InstrumentationRegistry;
 import androidx.test.rule.ActivityTestRule;
 import androidx.test.runner.AndroidJUnit4;
 
@@ -38,6 +45,7 @@
         Intent intent = new Intent(WifiDppConfiguratorActivity.ACTION_CONFIGURATOR_QR_CODE_SCANNER);
         intent.putExtra(WifiDppUtils.EXTRA_WIFI_SECURITY, "WEP");
         intent.putExtra(WifiDppUtils.EXTRA_WIFI_SSID, "GoogleGuest");
+        intent.putExtra(WifiDppUtils.EXTRA_WIFI_PRE_SHARED_KEY, "password");
         mActivityRule.launchActivity(intent);
     }
 
@@ -48,4 +56,21 @@
         mActivityRule.getActivity().setRequestedOrientation(
                 ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
     }
+
+    @Test
+    public void onPause_shouldNotDecodeQrCode() {
+        final WifiDppConfiguratorActivity hostActivity =
+                (WifiDppConfiguratorActivity) mActivityRule.getActivity();
+        final FragmentManager fragmentManager = hostActivity.getSupportFragmentManager();
+        final WifiDppQrCodeScannerFragment scannerFragment =
+                (WifiDppQrCodeScannerFragment) fragmentManager
+                .findFragmentByTag(TAG_FRAGMENT_QR_CODE_SCANNER);
+        final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
+
+        instrumentation.runOnMainSync(() -> {
+            instrumentation.callActivityOnPause(hostActivity);
+
+            assertThat(scannerFragment.isDecodeTaskAlive()).isEqualTo(false);
+        });
+    }
 }
diff --git a/tests/unit/src/com/android/settings/wifi/dpp/WifiQrCodeTest.java b/tests/unit/src/com/android/settings/wifi/dpp/WifiQrCodeTest.java
index 3595597..e4d3a7b 100644
--- a/tests/unit/src/com/android/settings/wifi/dpp/WifiQrCodeTest.java
+++ b/tests/unit/src/com/android/settings/wifi/dpp/WifiQrCodeTest.java
@@ -41,9 +41,13 @@
             "SN=4774LH2b4044";
 
     // Valid ZXing reader library's Wi-Fi Network config format & it's parameters
-    private static final String VALID_ZXING_WIFI_QR_CODE =
+    private static final String VALID_ZXING_WIFI_QR_CODE_WPA =
             "WIFI:T:WPA;S:mynetwork;P:mypass;H:true;;";
 
+     // Valid ZXing reader library's Wi-Fi Network config format - security type SAE
+    private static final String VALID_ZXING_WIFI_QR_CODE_SAE =
+            "WIFI:T:SAE;S:mynetwork;P:mypass;H:true;;";
+
     // Valid ZXing reader library's Wi-Fi Network config format - security type nopass and no password
     private static final String VALID_ZXING_WIFI_QR_CODE_NOPASS_AND_NO_PASSWORD =
             "WIFI:T:nopass;S:mynetwork;;";
@@ -52,7 +56,8 @@
     private static final String VALID_ZXING_WIFI_QR_CODE_NO_SECURITY_AND_NO_PASSWORD =
             "WIFI:T:;S:mynetwork;P:;H:false;;";
 
-    private static final String SECURITY_OF_VALID_ZXING_WIFI_QR_CODE = "WPA";
+    private static final String SECURITY_OF_VALID_ZXING_WIFI_QR_CODE_WPA = "WPA";
+    private static final String SECURITY_OF_VALID_ZXING_WIFI_QR_CODE_SAE = "SAE";
     private static final String SECURITY_OF_VALID_ZXING_WIFI_QR_CODE_NOPASS = "nopass";
     private static final String SSID_OF_VALID_ZXING_WIFI_QR_CODE = "mynetwork";
     private static final String PASSWORD_OF_VALID_ZXING_WIFI_QR_CODE = "mypass";
@@ -94,12 +99,25 @@
 
     @Test
     public void parseValidZxingWifiQrCode() {
-        WifiQrCode wifiQrCode = new WifiQrCode(VALID_ZXING_WIFI_QR_CODE);
+        WifiQrCode wifiQrCode = new WifiQrCode(VALID_ZXING_WIFI_QR_CODE_WPA);
         WifiNetworkConfig config = wifiQrCode.getWifiNetworkConfig();
 
         assertEquals(WifiQrCode.SCHEME_ZXING_WIFI_NETWORK_CONFIG, wifiQrCode.getScheme());
         assertNotNull(config);
-        assertEquals(SECURITY_OF_VALID_ZXING_WIFI_QR_CODE, config.getSecurity());
+        assertEquals(SECURITY_OF_VALID_ZXING_WIFI_QR_CODE_WPA, config.getSecurity());
+        assertEquals(SSID_OF_VALID_ZXING_WIFI_QR_CODE, config.getSsid());
+        assertEquals(PASSWORD_OF_VALID_ZXING_WIFI_QR_CODE, config.getPreSharedKey());
+        assertEquals(true, config.getHiddenSsid());
+    }
+
+    @Test
+    public void parseValidZxingWifiQrCodeSae() {
+        WifiQrCode wifiQrCode = new WifiQrCode(VALID_ZXING_WIFI_QR_CODE_SAE);
+        WifiNetworkConfig config = wifiQrCode.getWifiNetworkConfig();
+
+        assertEquals(WifiQrCode.SCHEME_ZXING_WIFI_NETWORK_CONFIG, wifiQrCode.getScheme());
+        assertNotNull(config);
+        assertEquals(SECURITY_OF_VALID_ZXING_WIFI_QR_CODE_SAE, config.getSecurity());
         assertEquals(SSID_OF_VALID_ZXING_WIFI_QR_CODE, config.getSsid());
         assertEquals(PASSWORD_OF_VALID_ZXING_WIFI_QR_CODE, config.getPreSharedKey());
         assertEquals(true, config.getHiddenSsid());
@@ -138,7 +156,7 @@
 
         assertEquals(WifiQrCode.SCHEME_ZXING_WIFI_NETWORK_CONFIG, wifiQrCode.getScheme());
         assertNotNull(config);
-        assertEquals(SECURITY_OF_VALID_ZXING_WIFI_QR_CODE, config.getSecurity());
+        assertEquals(SECURITY_OF_VALID_ZXING_WIFI_QR_CODE_WPA, config.getSecurity());
         assertEquals(SSID_OF_VALID_ZXING_WIFI_QR_CODE, config.getSsid());
         assertEquals(PASSWORD_OF_VALID_ZXING_WIFI_QR_CODE_SPECIAL_CHARACTERS,
                 config.getPreSharedKey());