Merge "Fix flicker for Device admin apps." into tm-dev
diff --git a/res/layout/accessibility_text_reading_preview_app_grid.xml b/res/layout/accessibility_text_reading_preview_app_grid.xml
index 2b4a1f2..979c053 100644
--- a/res/layout/accessibility_text_reading_preview_app_grid.xml
+++ b/res/layout/accessibility_text_reading_preview_app_grid.xml
@@ -20,8 +20,8 @@
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:numColumns="4"
+    android:numColumns="3"
     android:gravity="center"
     android:nestedScrollingEnabled="true"
     android:importantForAccessibility="noHideDescendants"
-    app:appCount="8"/>
+    app:appCount="6"/>
diff --git a/res/layout/slice_preference_layout.xml b/res/layout/slice_preference_layout.xml
index f78b1cf..ff4e613 100644
--- a/res/layout/slice_preference_layout.xml
+++ b/res/layout/slice_preference_layout.xml
@@ -18,6 +18,7 @@
 <androidx.slice.widget.SliceView
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/slice_view"
+    style="@style/Widget.SliceView.Bluetooth"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:paddingTop="12dp"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index cd5f71a..03fc59f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -184,6 +184,19 @@
     <!-- Keywords for bluetooth pairing item [CHAR LIMIT=30] -->
     <string name="keywords_add_bt_device">bluetooth</string>
 
+    <!-- Connected devices settings. Title of the dialog to hint user to pair other ear of the hearing aid device. Shows when only one of the hearing aid device set is connected. [CHAR LIMIT=25] -->
+    <string name="bluetooth_pair_other_ear_dialog_title">Pair your other ear</string>
+    <!-- Connected devices settings. Message of the dialog to hint user to pair right ear of the hearing aid device. Shows when only left side of hearing aid device set is connected. [CHAR LIMIT=NONE] -->
+    <string name="bluetooth_pair_other_ear_dialog_left_ear_message">Your left hearing aid is connected.\n\nTo pair the right one, make sure it\u2019s turned on and ready to pair.</string>
+    <!-- Connected devices settings. Message of the dialog to hint user to pair other ear of the hearing aid device. Shows when only right side of the hearing aid device set is connected. [CHAR LIMIT=NONE] -->
+    <string name="bluetooth_pair_other_ear_dialog_right_ear_message">Your right hearing aid is connected.\n\nTo pair the left one, make sure it\u2019s turned on and ready to pair.</string>
+    <!-- Connected devices settings. Positive button of the dialog to help user to pair right ear of the hearing aid device. Dialog shows when only one of the hearing aid device set is connected. [CHAR LIMIT=20] -->
+    <string name="bluetooth_pair_other_ear_dialog_right_ear_positive_button">Pair right ear</string>
+    <!-- Connected devices settings. Positive button of the dialog to help user to pair left ear of the hearing aid device. Dialog shows when only one of the hearing aid device set is connected. [CHAR LIMIT=20] -->
+    <string name="bluetooth_pair_other_ear_dialog_left_ear_positive_button">Pair left ear</string>
+
+    <!-- Title for related tools section. This section will list related tools below. [CHAR LIMIT=15] -->
+    <string name="bluetooth_screen_related">Related</string>
     <!-- Bluetooth Visibility message.  This message informs the user that their device is now visible to other bluetooth devices.  [CHAR LIMIT=NONE] -->
     <string name="bluetooth_is_visible_message"><xliff:g id="device_name">%1$s</xliff:g> is visible to nearby devices while Bluetooth settings is open.</string>
     <!-- Bluetooth mac address message.  This message shows the bluetooth mac address for this device.  [CHAR LIMIT=120] -->
@@ -5276,13 +5289,23 @@
     <!-- Title for the entry of the text reading options. [CHAR LIMIT=NONE] -->
     <string name="accessibility_text_reading_options_suggestion_title">Change how text displays</string>
     <!-- Subject for the mail content of the accessibility text reading preview. [CHAR LIMIT=NONE] -->
-    <string name="accessibility_text_reading_preview_mail_subject">Email: Plans for time machine, v2</string>
+    <string name="accessibility_text_reading_preview_mail_subject">Subject: Hot air balloon designs</string>
     <!-- Message for the mail content of the accessibility text reading preview. [CHAR LIMIT=NONE] -->
-    <string name="accessibility_text_reading_preview_mail_from">From: bill@email.com</string>
+    <string name="accessibility_text_reading_preview_mail_from">From: Bill</string>
     <!-- Content for the mail content of the accessibility text reading preview. [CHAR LIMIT=NONE] -->
-    <string name="accessibility_text_reading_preview_mail_content">Good morning! Following up on our last conversation, I’d like to check in on the progress of your time machine development plan. Will you be able to have a prototype ready to demo at E3 this year?</string>
-    <!-- Title for the reset button of the accessibility text reading page to reset all preferences state. [CHAR LIMIT=NONE] -->
-    <string name="accessibility_text_reading_reset_button_title">Reset</string>
+    <string name="accessibility_text_reading_preview_mail_content">Good morning! Following up on our last conversation, I\u2019d like to check in on the progress of your time machine development plan. Will you be able to have a prototype ready to demo at E3 this year?</string>
+    <!-- Title for the reset button of the accessibility text reading page to reset all preferences state. [CHAR LIMIT=25] -->
+    <string name="accessibility_text_reading_reset_button_title">Reset settings</string>
+    <!-- Title for the confirm dialog of reset settings. [CHAR LIMIT=NONE] -->
+    <string name="accessibility_text_reading_confirm_dialog_title">Reset display size and text?</string>
+    <!-- Message for the confirm dialog of reset settings. [CHAR LIMIT=NONE] -->
+    <string name="accessibility_text_reading_confirm_dialog_message">Your display size and text preferences will reset to the phone\u2019s original settings</string>
+    <!-- Title for the reset button of the confirm dialog of reset settings. [CHAR LIMIT=25] -->
+    <string name="accessibility_text_reading_confirm_dialog_reset_button">Reset</string>
+    <!-- Conversation message for the messaging app preview screen. [CHAR LIMIT=NONE] -->
+    <string name="accessibility_text_reading_conversation_message_1">Any weekend plans?</string>
+    <!-- Conversation message for the messaging app preview screen. [CHAR LIMIT=NONE] -->
+    <string name="accessibility_text_reading_conversation_message_2">Heading to the beach. Want to join?</string>
     <!-- Title for the footer text to explain what option accessibility service does. [CHAR LIMIT=35] -->
     <string name="accessibility_screen_option">Options</string>
     <!-- Summary for the accessibility preference to enable screen magnification. [CHAR LIMIT=25] -->
@@ -5633,10 +5656,20 @@
     <string name="accessibility_hearingaid_not_connected_summary">No hearing aids connected</string>
     <!-- Summary for the accessibility preference for hearing aid when adding new devices. [CHAR LIMIT=50] -->
     <string name="accessibility_hearingaid_adding_summary">Add hearing aids</string>
-    <!-- Message to ask the user to make sure that their hearing aid devices are in pairing mode. [CHAR LIMIT=NONE] -->
-    <string name="accessibility_hearingaid_pair_instructions_message">To pair your hearing aids, find and tap your device on the next screen. Make sure your hearing aids are in pairing mode.</string>
+    <!-- Title of the pair instruction dialog. Dialog shows to ask the user to make sure that their hearing aid devices are in pairing mode. [CHAR LIMIT=25] -->
+    <string name="accessibility_hearingaid_pair_instructions_title">Pair hearing aids</string>
+    <!-- Message of the pair instruction dialog. Dialog shows to ask the user to make sure that their hearing aid devices are in pairing mode. [CHAR LIMIT=NONE] -->
+    <string name="accessibility_hearingaid_pair_instructions_message">On the next screen, tap on your hearing aids. You may need to pair the left and right ears separately.\n\nMake sure your hearing aids are turned on and ready to pair.</string>
     <!-- Summary for the accessibility preference for hearing aid when there is an active device. [CHAR LIMIT=50] -->
-    <string name="accessibility_hearingaid_active_device_summary"><xliff:g id="device_name">%1$s</xliff:g> active</string>
+    <string name="accessibility_hearingaid_active_device_summary"><xliff:g id="device_name"  example="GN Hearing Aids">%1$s</xliff:g> active</string>
+    <!-- Summary for the accessibility preference for hearing aid when there is only left side active. [CHAR LIMIT=50] -->
+    <string name="accessibility_hearingaid_left_side_device_summary"><xliff:g id="device_name"  example="GN Hearing Aids">%1$s</xliff:g>, left only</string>
+    <!-- Summary for the accessibility preference for hearing aid when there is only right side active. [CHAR LIMIT=50] -->
+    <string name="accessibility_hearingaid_right_side_device_summary"><xliff:g id="device_name"  example="GN Hearing Aids">%1$s</xliff:g>, right only</string>
+    <!-- Summary for the accessibility preference for hearing aid when both left side and right side are active. [CHAR LIMIT=50] -->
+    <string name="accessibility_hearingaid_left_and_right_side_device_summary"><xliff:g id="device_name"  example="GN Hearing Aids">%1$s</xliff:g>, left and right</string>
+    <!-- Summary for the accessibility preference for hearing aid when there are more than one set of devices are active. [CHAR LIMIT=50] -->
+    <string name="accessibility_hearingaid_more_device_summary"><xliff:g id="device_name" example="GN Hearing Aids">%1$s</xliff:g> +1 more</string>
     <!-- Summary for the accessibility preference for hearing aid when there are saved devices. [CHAR LIMIT=50] -->
     <plurals name="show_number_hearingaid_count">
         <item quantity="one"><xliff:g id="number_device_count">%1$d</xliff:g> saved hearing aid</item>
@@ -8561,6 +8594,24 @@
     <!-- Setting summary for controlling how caption text display in real time [CHAR LIMIT=NONE]-->
     <string name="live_caption_summary">Automatically caption media</string>
 
+    <!-- Output device type for the phone speaker that is available for spatializer effect. [CHAR LIMIT=NONE]-->
+    <string name="spatial_audio_speaker">Phone speaker</string>
+
+    <!-- Output device type for the wired headphones that is available for spatializer effect. [CHAR LIMIT=NONE]-->
+    <string name="spatial_audio_wired_headphones">Wired headphones</string>
+
+    <!-- Sound: Summary for the spatializer effect. [CHAR LIMIT=NONE]-->
+    <string name="spatial_audio_text">Spatial Audio creates immersive sound that seems like it’s coming from all around you. Only works with some media.</string>
+
+    <!-- Sound: Summary for the Spatial audio setting when it is off. [CHAR LIMIT=NONE]-->
+    <string name="spatial_summary_off">Off</string>
+
+    <!-- Sound: Summary for the Spatial audio setting when it is on with one output device enabled. [CHAR LIMIT=NONE]-->
+    <string name="spatial_summary_on_one">On / <xliff:g id="output device" example="Phone speaker">%1$s</xliff:g></string>
+
+    <!-- Sound: Summary for the Spatial audio setting when it is on with two output devices enabled. [CHAR LIMIT=NONE]-->
+    <string name="spatial_summary_on_two">On / <xliff:g id="output device" example="Phone speaker">%1$s</xliff:g> and <xliff:g id="output device" example="Wired headphones">%2$s</xliff:g></string>
+
     <!-- Sound: Summary for the Do not Disturb option that describes how many automatic rules (schedules) are enabled [CHAR LIMIT=NONE]-->
     <string name="zen_mode_settings_schedules_summary">
         {count, plural,
@@ -13831,9 +13882,11 @@
     <!-- Title for the various modifiers that alter the cost of TARE tasks based on battery status
     (charging, power save mode, etc.) [CHAR LIMIT=40]-->
     <string name="tare_modifiers">Modifiers</string>
-    <!-- Title for the various TARE policy's action's cost to produce and price paid by
-    apps [CHAR LIMIT=40]-->
-    <string name="tare_actions">Actions</string>
+    <!-- Title for the various TARE policy's actions' cost to produce. "Cost to produce" refers to
+     how many credits it costs the system to perform (produce) the action. [CHAR LIMIT=40]-->
+    <string name="tare_actions_ctp">Actions (Cost to Produce)</string>
+    <!-- Title for the various TARE policy's actions' starting prices [CHAR LIMIT=40]-->
+    <string name="tare_actions_base_price">Actions (Base Price)</string>
     <!-- Title for the instant, ongoing, and max rewards apps can obtain for different actions that
     benefit the user. [CHAR LIMIT=40]-->
     <string name="tare_rewards">Rewards</string>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index bd0aea1..4d63689 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -524,6 +524,13 @@
         <item name="rowStyle">@style/SliceRow.Slider</item>
     </style>
 
+    <style name="Widget.SliceView.Bluetooth">
+        <item name="titleSize">20dp</item>
+        <item name="subtitleSize">14dp</item>
+        <item name="headerTitleSize">20dp</item>
+        <item name="headerSubtitleSize">14dp</item>
+    </style>
+
     <style name="Widget.SliceView.Panel.Slider.LargeIcon">
         <item name="rowStyle">@style/SliceRow.Slider.LargeIcon</item>
     </style>
diff --git a/res/xml/battery_saver_settings.xml b/res/xml/battery_saver_settings.xml
index 862bcd7..52b8b1a 100644
--- a/res/xml/battery_saver_settings.xml
+++ b/res/xml/battery_saver_settings.xml
@@ -45,8 +45,6 @@
     <com.android.settingslib.widget.FooterPreference
         android:order="100"
         android:key="battery_saver_footer_preference"
-        android:selectable="true"
         android:title="@*android:string/battery_saver_description"
         settings:searchable="false"/>
-
 </PreferenceScreen>
diff --git a/res/xml/sound_settings.xml b/res/xml/sound_settings.xml
index d79594c..f25b6ec 100644
--- a/res/xml/sound_settings.xml
+++ b/res/xml/sound_settings.xml
@@ -111,6 +111,15 @@
         settings:keywords="@string/sound_settings"/>
 
     <!-- Live Caption -110 and Now Playing -105-->
+
+    <!-- Spatial audio -->
+    <Preference
+        android:key="spatial_audio_summary"
+        android:title="@string/spatial_audio_title"
+        android:fragment="com.android.settings.notification.SpatialAudioSettings"
+        android:order="-107"
+        settings:controller="com.android.settings.notification.SpatialAudioParentPreferenceController"/>
+
     <Preference
         android:key="media_controls_summary"
         android:title="@string/media_controls_title"
@@ -154,13 +163,6 @@
         android:ringtoneType="alarm"
         android:order="-60"/>
 
-    <!-- Spatial audio -->
-    <SwitchPreference
-        android:key="spatial_audio"
-        android:title="@string/spatial_audio_title"
-        android:order="-55"
-        settings:controller="com.android.settings.notification.SpatialAudioPreferenceController"/>
-
     <!-- Dial pad tones -->
     <SwitchPreference
         android:key="dial_pad_tones"
diff --git a/res/xml/spatial_audio_settings.xml b/res/xml/spatial_audio_settings.xml
new file mode 100644
index 0000000..da33986
--- /dev/null
+++ b/res/xml/spatial_audio_settings.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2022 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<PreferenceScreen
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:settings="http://schemas.android.com/apk/res-auto"
+    android:title="@string/spatial_audio_title">
+
+    <com.android.settingslib.widget.TopIntroPreference
+        android:key="spatial_audio_top_intro"
+        android:title="@string/spatial_audio_text"
+        settings:searchable="false"/>
+
+    <SwitchPreference
+        android:key="spatial_audio"
+        android:title="@string/spatial_audio_speaker"
+        settings:controller="com.android.settings.notification.SpatialAudioPreferenceController"/>
+
+    <SwitchPreference
+        android:key="spatial_audio_wired_headphones"
+        android:title="@string/spatial_audio_wired_headphones"
+        settings:controller="com.android.settings.notification.SpatialAudioWiredHeadphonesController"/>
+
+</PreferenceScreen>
diff --git a/src/com/android/settings/MainClear.java b/src/com/android/settings/MainClear.java
index 7eb4a5d..62462b3 100644
--- a/src/com/android/settings/MainClear.java
+++ b/src/com/android/settings/MainClear.java
@@ -500,10 +500,10 @@
                         context.getSystemService(DevicePolicyManager.class);
 
                 if (userInfo.isManagedProfile()) {
-                    titleText.setText(devicePolicyManager.getString(
+                    titleText.setText(devicePolicyManager.getResources().getString(
                             WORK_CATEGORY_HEADER, () -> getString(R.string.category_work)));
                 } else {
-                    titleText.setText(devicePolicyManager.getString(
+                    titleText.setText(devicePolicyManager.getResources().getString(
                             PERSONAL_CATEGORY_HEADER, () -> getString(R.string.category_personal)));
                 }
                 contents.addView(titleView);
diff --git a/src/com/android/settings/RemoteBugreportActivity.java b/src/com/android/settings/RemoteBugreportActivity.java
index 12dce90..1485287 100644
--- a/src/com/android/settings/RemoteBugreportActivity.java
+++ b/src/com/android/settings/RemoteBugreportActivity.java
@@ -54,7 +54,7 @@
 
         if (notificationType == DevicePolicyManager.NOTIFICATION_BUGREPORT_ACCEPTED_NOT_FINISHED) {
             AlertDialog dialog = new AlertDialog.Builder(this)
-                    .setMessage(devicePolicyManager.getString(
+                    .setMessage(devicePolicyManager.getResources().getString(
                             SHARING_REMOTE_BUGREPORT_MESSAGE,
                             () -> getString(R.string.sharing_remote_bugreport_dialog_message)))
                     .setOnDismissListener(new DialogInterface.OnDismissListener() {
@@ -85,9 +85,10 @@
                     : SHARE_REMOTE_BUGREPORT_FINISHED_REQUEST_CONSENT;
 
             AlertDialog dialog = new AlertDialog.Builder(this)
-                    .setTitle(devicePolicyManager.getString(SHARE_REMOTE_BUGREPORT_DIALOG_TITLE,
+                    .setTitle(devicePolicyManager.getResources().getString(
+                            SHARE_REMOTE_BUGREPORT_DIALOG_TITLE,
                             () -> getString(R.string.share_remote_bugreport_dialog_title)))
-                    .setMessage(devicePolicyManager.getString(overrideMessageId,
+                    .setMessage(devicePolicyManager.getResources().getString(overrideMessageId,
                             () -> getString(defaultMessageId)))
                     .setOnDismissListener(new DialogInterface.OnDismissListener() {
                         @Override
diff --git a/src/com/android/settings/TrustedCredentialsSettings.java b/src/com/android/settings/TrustedCredentialsSettings.java
index fffb8eb..735cb3b 100644
--- a/src/com/android/settings/TrustedCredentialsSettings.java
+++ b/src/com/android/settings/TrustedCredentialsSettings.java
@@ -389,10 +389,11 @@
 
             final TextView title = (TextView) convertView.findViewById(android.R.id.title);
             if (getUserInfoByGroup(groupPosition).isManagedProfile()) {
-                title.setText(mDevicePolicyManager.getString(WORK_CATEGORY_HEADER,
+                title.setText(mDevicePolicyManager.getResources().getString(WORK_CATEGORY_HEADER,
                         () -> getString(R.string.category_work)));
             } else {
-                title.setText(mDevicePolicyManager.getString(PERSONAL_CATEGORY_HEADER,
+                title.setText(mDevicePolicyManager.getResources().getString(
+                        PERSONAL_CATEGORY_HEADER,
                         () -> getString(R.string.category_personal)));
 
             }
diff --git a/src/com/android/settings/accessibility/AccessibilitySetupWizardUtils.java b/src/com/android/settings/accessibility/AccessibilitySetupWizardUtils.java
index 95b689b..c530214 100644
--- a/src/com/android/settings/accessibility/AccessibilitySetupWizardUtils.java
+++ b/src/com/android/settings/accessibility/AccessibilitySetupWizardUtils.java
@@ -47,7 +47,7 @@
         layout.setIcon(icon);
         layout.setDividerInsets(Integer.MAX_VALUE, 0);
 
-        if (ThemeHelper.shouldApplyExtendedPartnerConfig(context)) {
+        if (ThemeHelper.shouldApplyMaterialYouStyle(context)) {
             final LinearLayout headerLayout = layout.findManagedViewById(R.id.sud_layout_header);
             if (headerLayout != null) {
                 headerLayout.setPadding(0, layout.getPaddingTop(), 0,
diff --git a/src/com/android/settings/accounts/AccountPreferenceController.java b/src/com/android/settings/accounts/AccountPreferenceController.java
index 8f387d4..29198fb 100644
--- a/src/com/android/settings/accounts/AccountPreferenceController.java
+++ b/src/com/android/settings/accounts/AccountPreferenceController.java
@@ -199,7 +199,7 @@
                         UserHandle.myUserId())) {
                     final SearchIndexableRaw data = new SearchIndexableRaw(mContext);
                     data.key = PREF_KEY_REMOVE_PROFILE;
-                    data.title = mDpm.getString(
+                    data.title = mDpm.getResources().getString(
                             REMOVE_WORK_PROFILE,
                             () -> res.getString(R.string.remove_managed_profile_label));
                     data.screenTitle = screenTitle;
@@ -207,7 +207,7 @@
                 }
                 final SearchIndexableRaw data = new SearchIndexableRaw(mContext);
                 data.key = PREF_KEY_WORK_PROFILE_SETTING;
-                data.title = mDpm.getString(MANAGED_PROFILE_SETTINGS_TITLE,
+                data.title = mDpm.getResources().getString(MANAGED_PROFILE_SETTINGS_TITLE,
                         () -> res.getString(R.string.managed_profile_settings_title));
                 data.screenTitle = screenTitle;
                 rawData.add(data);
@@ -267,7 +267,7 @@
                 new SubSettingLauncher(mContext)
                         .setSourceMetricsCategory(metricsCategory)
                         .setDestination(ManagedProfileSettings.class.getName())
-                        .setTitleText(mDpm.getString(MANAGED_PROFILE_SETTINGS_TITLE,
+                        .setTitleText(mDpm.getResources().getString(MANAGED_PROFILE_SETTINGS_TITLE,
                                 () -> mContext.getString(R.string.managed_profile_settings_title)))
                         .setArguments(arguments)
                         .launch();
@@ -347,12 +347,12 @@
         } else if (userInfo.isManagedProfile()) {
             if (mType == ProfileSelectFragment.ProfileType.ALL) {
                 preferenceGroup.setTitle(
-                        mDpm.getString(WORK_CATEGORY_HEADER,
+                        mDpm.getResources().getString(WORK_CATEGORY_HEADER,
                                 () -> mContext.getString(R.string.category_work)));
                 final String workGroupSummary = getWorkGroupSummary(context, userInfo);
                 preferenceGroup.setSummary(workGroupSummary);
                 preferenceGroup.setContentDescription(
-                        mDpm.getString(ACCESSIBILITY_CATEGORY_WORK, () ->
+                        mDpm.getResources().getString(ACCESSIBILITY_CATEGORY_WORK, () ->
                         mContext.getString(
                                 R.string.accessibility_category_work, workGroupSummary)));
             }
@@ -363,10 +363,10 @@
         } else {
             if (mType == ProfileSelectFragment.ProfileType.ALL) {
                 preferenceGroup.setTitle(
-                        mDpm.getString(PERSONAL_CATEGORY_HEADER,
+                        mDpm.getResources().getString(PERSONAL_CATEGORY_HEADER,
                                 () -> mContext.getString(R.string.category_personal)));
                 preferenceGroup.setContentDescription(
-                        mDpm.getString(ACCESSIBILITY_CATEGORY_PERSONAL, () ->
+                        mDpm.getResources().getString(ACCESSIBILITY_CATEGORY_PERSONAL, () ->
                         mContext.getString(R.string.accessibility_category_personal)));
             }
         }
@@ -401,7 +401,7 @@
                 mFragment.getPreferenceManager().getContext());
         preference.setKey(PREF_KEY_REMOVE_PROFILE);
         preference.setTitle(
-                mDpm.getString(REMOVE_WORK_PROFILE,
+                mDpm.getResources().getString(REMOVE_WORK_PROFILE,
                         () -> mContext.getString(R.string.remove_managed_profile_label)));
         preference.setIcon(R.drawable.ic_delete);
         preference.setOnPreferenceClickListener(this);
@@ -413,7 +413,7 @@
     private Preference newManagedProfileSettings() {
         Preference preference = new Preference(mFragment.getPreferenceManager().getContext());
         preference.setKey(PREF_KEY_WORK_PROFILE_SETTING);
-        preference.setTitle(mDpm.getString(MANAGED_PROFILE_SETTINGS_TITLE,
+        preference.setTitle(mDpm.getResources().getString(MANAGED_PROFILE_SETTINGS_TITLE,
                 () -> mContext.getString(R.string.managed_profile_settings_title)));
         preference.setIcon(R.drawable.ic_settings_24dp);
         preference.setOnPreferenceClickListener(this);
@@ -428,7 +428,7 @@
             return null;
         }
         CharSequence appLabel = packageManager.getApplicationLabel(adminApplicationInfo);
-        return mDpm.getString(MANAGED_BY,
+        return mDpm.getResources().getString(MANAGED_BY,
                 () -> mContext.getString(R.string.managing_admin, appLabel), appLabel);
     }
 
@@ -508,7 +508,7 @@
             mProfileNotAvailablePreference.setIcon(R.drawable.empty_icon);
             mProfileNotAvailablePreference.setTitle(null);
             mProfileNotAvailablePreference.setSummary(
-                    mDpm.getString(
+                    mDpm.getResources().getString(
                             WORK_PROFILE_NOT_AVAILABLE, () -> mContext.getString(
                     R.string.managed_profile_not_available_label)));
             profileData.preferenceGroup.addPreference(mProfileNotAvailablePreference);
diff --git a/src/com/android/settings/accounts/AccountSyncSettings.java b/src/com/android/settings/accounts/AccountSyncSettings.java
index 7c72d6c..83f89d8 100644
--- a/src/com/android/settings/accounts/AccountSyncSettings.java
+++ b/src/com/android/settings/accounts/AccountSyncSettings.java
@@ -163,10 +163,11 @@
 
         String accessibilityTitle =
                 isWorkProfile
-                        ? devicePolicyManager.getString(ACCESSIBILITY_WORK_ACCOUNT_TITLE,
+                        ? devicePolicyManager.getResources().getString(
+                                ACCESSIBILITY_WORK_ACCOUNT_TITLE,
                                 () -> getString(R.string.accessibility_work_account_title,
                                         currentTitle), currentTitle)
-                                : devicePolicyManager.getString(
+                                : devicePolicyManager.getResources().getString(
                                         ACCESSIBILITY_PERSONAL_ACCOUNT_TITLE,
                                         () -> getString(
                                                 R.string.accessibility_personal_account_title,
diff --git a/src/com/android/settings/accounts/RemoveAccountPreferenceController.java b/src/com/android/settings/accounts/RemoveAccountPreferenceController.java
index 58ef7f1..60faab9 100644
--- a/src/com/android/settings/accounts/RemoveAccountPreferenceController.java
+++ b/src/com/android/settings/accounts/RemoveAccountPreferenceController.java
@@ -217,6 +217,7 @@
             return new AlertDialog.Builder(context)
                     .setTitle(R.string.remove_account_label)
                     .setMessage(getContext().getSystemService(DevicePolicyManager.class)
+                            .getResources()
                             .getString(REMOVE_ACCOUNT_FAILED_ADMIN_RESTRICTION,
                                     () -> getString(R.string.remove_account_failed)))
                     .setPositiveButton(android.R.string.ok, null)
diff --git a/src/com/android/settings/accounts/WorkModePreferenceController.java b/src/com/android/settings/accounts/WorkModePreferenceController.java
index aa54d33..f4ab195 100644
--- a/src/com/android/settings/accounts/WorkModePreferenceController.java
+++ b/src/com/android/settings/accounts/WorkModePreferenceController.java
@@ -87,13 +87,13 @@
     @Override
     public CharSequence getSummary() {
         if (isChecked()) {
-            return mDevicePolicyManager
-                    .getString(WORK_PROFILE_SETTING_ON_SUMMARY,
-                            () -> mContext.getString(R.string.work_mode_on_summary));
+            return mDevicePolicyManager.getResources().getString(
+                    WORK_PROFILE_SETTING_ON_SUMMARY,
+                    () -> mContext.getString(R.string.work_mode_on_summary));
         }
 
-        return mDevicePolicyManager
-                .getString(WORK_PROFILE_SETTING_OFF_SUMMARY,
+        return mDevicePolicyManager.getResources().getString(
+                WORK_PROFILE_SETTING_OFF_SUMMARY,
                         () -> mContext.getString(R.string.work_mode_off_summary));
     }
 
diff --git a/src/com/android/settings/applications/UsageAccessDetails.java b/src/com/android/settings/applications/UsageAccessDetails.java
index ef259d2..8085b69 100644
--- a/src/com/android/settings/applications/UsageAccessDetails.java
+++ b/src/com/android/settings/applications/UsageAccessDetails.java
@@ -97,7 +97,8 @@
                     new AlertDialog.Builder(getContext())
                             .setIcon(com.android.internal.R.drawable.ic_dialog_alert_material)
                             .setTitle(android.R.string.dialog_alert_title)
-                            .setMessage(mDpm.getString(WORK_PROFILE_DISABLE_USAGE_ACCESS_WARNING,
+                            .setMessage(mDpm.getResources().getString(
+                                    WORK_PROFILE_DISABLE_USAGE_ACCESS_WARNING,
                                     () -> getString(R.string.work_profile_usage_access_warning)))
                             .setPositiveButton(R.string.okay, null)
                             .show();
diff --git a/src/com/android/settings/applications/manageapplications/ManageApplications.java b/src/com/android/settings/applications/manageapplications/ManageApplications.java
index a6ce6fb..4d59839 100644
--- a/src/com/android/settings/applications/manageapplications/ManageApplications.java
+++ b/src/com/android/settings/applications/manageapplications/ManageApplications.java
@@ -532,12 +532,12 @@
         outState.putInt(EXTRA_SORT_ORDER, mSortOrder);
         outState.putInt(EXTRA_FILTER_TYPE, mFilter.getFilterType());
         outState.putBoolean(EXTRA_SHOW_SYSTEM, mShowSystem);
-        outState.putBoolean(EXTRA_HAS_ENTRIES, mApplications.mHasReceivedLoadEntries);
-        outState.putBoolean(EXTRA_HAS_BRIDGE, mApplications.mHasReceivedBridgeCallback);
         if (mSearchView != null) {
             outState.putBoolean(EXTRA_EXPAND_SEARCH_VIEW, !mSearchView.isIconified());
         }
         if (mApplications != null) {
+            outState.putBoolean(EXTRA_HAS_ENTRIES, mApplications.mHasReceivedLoadEntries);
+            outState.putBoolean(EXTRA_HAS_BRIDGE, mApplications.mHasReceivedBridgeCallback);
             mApplications.onSaveInstanceState(outState);
         }
     }
diff --git a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java
index de79739..7dbf333 100644
--- a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java
+++ b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java
@@ -335,7 +335,7 @@
 
             // Build and show the simplified dialog
             final Dialog dialog = new AlertDialog.Builder(this)
-                    .setTitle(mDPM.getString(SET_PROFILE_OWNER_DIALOG_TITLE,
+                    .setTitle(mDPM.getResources().getString(SET_PROFILE_OWNER_DIALOG_TITLE,
                             () -> getString(R.string.profile_owner_add_title_simplified)))
                     .setView(R.layout.profile_owner_add)
                     .setPositiveButton(R.string.allow, new DialogInterface.OnClickListener() {
@@ -358,7 +358,7 @@
             mAddMsg.setText(mAddMsgText);
             mAdminWarning = dialog.findViewById(R.id.admin_warning_simplified);
             mAdminWarning.setText(
-                    mDPM.getString(NEW_DEVICE_ADMIN_WARNING_SIMPLIFIED, () ->
+                    mDPM.getResources().getString(NEW_DEVICE_ADMIN_WARNING_SIMPLIFIED, () ->
                     getString(R.string.device_admin_warning_simplified,
                     mProfileOwnerName), mProfileOwnerName));
             return;
@@ -371,7 +371,7 @@
         mProfileOwnerWarning = (TextView) findViewById(R.id.profile_owner_warning);
 
         mProfileOwnerWarning.setText(
-                mDPM.getString(SET_PROFILE_OWNER_POSTSETUP_WARNING,
+                mDPM.getResources().getString(SET_PROFILE_OWNER_POSTSETUP_WARNING,
                         () -> getString(R.string.adding_profile_owner_warning)));
 
         mAddMsg = (TextView)findViewById(R.id.add_msg);
@@ -419,7 +419,7 @@
         });
 
         mUninstallButton = (Button) findViewById(R.id.uninstall_button);
-        mUninstallButton.setText(mDPM.getString(UNINSTALL_DEVICE_ADMIN,
+        mUninstallButton.setText(mDPM.getResources().getString(UNINSTALL_DEVICE_ADMIN,
                 () -> getString(R.string.uninstall_device_admin)));
         mUninstallButton.setFilterTouchesWhenObscured(true);
         mUninstallButton.setOnClickListener(new View.OnClickListener() {
@@ -681,9 +681,10 @@
             final boolean isManagedProfile = isManagedProfile(mDeviceAdmin);
             if (isProfileOwner && isManagedProfile) {
                 // Profile owner in a managed profile, user can remove profile to disable admin.
-                mAdminWarning.setText(mDPM.getString(WORK_PROFILE_ADMIN_POLICIES_WARNING,
+                mAdminWarning.setText(mDPM.getResources().getString(
+                        WORK_PROFILE_ADMIN_POLICIES_WARNING,
                         () -> getString(R.string.admin_profile_owner_message)));
-                mActionButton.setText(mDPM.getString(REMOVE_WORK_PROFILE,
+                mActionButton.setText(mDPM.getResources().getString(REMOVE_WORK_PROFILE,
                         () -> getString(R.string.remove_managed_profile_label)));
 
                 final EnforcedAdmin admin = getAdminEnforcingCantRemoveProfile();
@@ -698,32 +699,34 @@
                 // Profile owner in a user or device owner, user can't disable admin.
                 if (isProfileOwner) {
                     // Show profile owner in a user description.
-                    mAdminWarning.setText(mDPM.getString(USER_ADMIN_POLICIES_WARNING,
+                    mAdminWarning.setText(mDPM.getResources().getString(USER_ADMIN_POLICIES_WARNING,
                             () -> getString(R.string.admin_profile_owner_user_message)));
                 } else {
                     // Show device owner description.
                     if (isFinancedDevice()) {
                         mAdminWarning.setText(R.string.admin_financed_message);
                     } else {
-                        mAdminWarning.setText(mDPM.getString(DEVICE_ADMIN_POLICIES_WARNING,
+                        mAdminWarning.setText(mDPM.getResources().getString(
+                                DEVICE_ADMIN_POLICIES_WARNING,
                                 () -> getString(R.string.admin_device_owner_message)));
                     }
                 }
-                mActionButton.setText(mDPM.getString(REMOVE_DEVICE_ADMIN,
+                mActionButton.setText(mDPM.getResources().getString(REMOVE_DEVICE_ADMIN,
                         () -> getString(R.string.remove_device_admin)));
                 mActionButton.setEnabled(false);
             } else {
                 addDeviceAdminPolicies(false /* showDescription */);
                 CharSequence label = mDeviceAdmin.getActivityInfo().applicationInfo.loadLabel(
                         getPackageManager());
-                mAdminWarning.setText(mDPM.getString(ACTIVE_DEVICE_ADMIN_WARNING,
+                mAdminWarning.setText(mDPM.getResources().getString(ACTIVE_DEVICE_ADMIN_WARNING,
                         () -> getString(R.string.device_admin_status, label), label));
                 setTitle(R.string.active_device_admin_msg);
                 if (mUninstalling) {
-                    mActionButton.setText(mDPM.getString(REMOVE_AND_UNINSTALL_DEVICE_ADMIN,
+                    mActionButton.setText(mDPM.getResources().getString(
+                            REMOVE_AND_UNINSTALL_DEVICE_ADMIN,
                             () -> getString(R.string.remove_and_uninstall_device_admin)));
                 } else {
-                    mActionButton.setText(mDPM.getString(REMOVE_DEVICE_ADMIN,
+                    mActionButton.setText(mDPM.getResources().getString(REMOVE_DEVICE_ADMIN,
                             () -> getString(R.string.remove_device_admin)));
                 }
             }
@@ -740,12 +743,12 @@
             CharSequence label = mDeviceAdmin.getActivityInfo()
                     .applicationInfo.loadLabel(getPackageManager());
             mAdminWarning.setText(
-                    mDPM.getString(NEW_DEVICE_ADMIN_WARNING, () ->
+                    mDPM.getResources().getString(NEW_DEVICE_ADMIN_WARNING, () ->
                     getString(R.string.device_admin_warning, label
                     ), label));
-            setTitle(mDPM.getString(ACTIVATE_DEVICE_ADMIN_APP,
+            setTitle(mDPM.getResources().getString(ACTIVATE_DEVICE_ADMIN_APP,
                     () -> getString(R.string.add_device_admin_msg)));
-            mActionButton.setText(mDPM.getString(ACTIVATE_THIS_DEVICE_ADMIN_APP,
+            mActionButton.setText(mDPM.getResources().getString(ACTIVATE_THIS_DEVICE_ADMIN_APP,
                     () -> getString(R.string.add_device_admin)));
             if (isAdminUninstallable()) {
                 mUninstallButton.setVisibility(View.VISIBLE);
diff --git a/src/com/android/settings/applications/specialaccess/interactacrossprofiles/InteractAcrossProfilesDetails.java b/src/com/android/settings/applications/specialaccess/interactacrossprofiles/InteractAcrossProfilesDetails.java
index e85a513..e316125 100644
--- a/src/com/android/settings/applications/specialaccess/interactacrossprofiles/InteractAcrossProfilesDetails.java
+++ b/src/com/android/settings/applications/specialaccess/interactacrossprofiles/InteractAcrossProfilesDetails.java
@@ -156,7 +156,7 @@
         }
 
         preference.setSummary(
-                mDevicePolicyManager.getString(overrideKey,
+                mDevicePolicyManager.getResources().getString(overrideKey,
                         () -> getString(resource)));
     }
 
@@ -296,19 +296,20 @@
 
         final TextView dialogTitle = dialogView.findViewById(
                 R.id.interact_across_profiles_consent_dialog_title);
-        dialogTitle.setText(mDpm.getString(CONNECT_APPS_DIALOG_TITLE, () ->
+        dialogTitle.setText(mDpm.getResources().getString(CONNECT_APPS_DIALOG_TITLE, () ->
                 getString(R.string.interact_across_profiles_consent_dialog_title, mAppLabel),
                 mAppLabel));
 
         final TextView appDataSummary = dialogView.findViewById(R.id.app_data_summary);
         appDataSummary.setText(
-                mDpm.getString(APP_CAN_ACCESS_PERSONAL_DATA,
+                mDpm.getResources().getString(APP_CAN_ACCESS_PERSONAL_DATA,
                         () -> getString(
                                 R.string.interact_across_profiles_consent_dialog_app_data_summary,
                                 mAppLabel), mAppLabel));
 
         final TextView permissionsSummary = dialogView.findViewById(R.id.permissions_summary);
-        permissionsSummary.setText(mDpm.getString(APP_CAN_ACCESS_PERSONAL_PERMISSIONS,
+        permissionsSummary.setText(mDpm.getResources().getString(
+                APP_CAN_ACCESS_PERSONAL_PERMISSIONS,
                 () -> getString(
                         R.string.interact_across_profiles_consent_dialog_permissions_summary,
                         mAppLabel),
@@ -316,7 +317,7 @@
 
         final TextView dialogSummary =
                 dialogView.findViewById(R.id.interact_across_profiles_consent_dialog_summary);
-        dialogSummary.setText(mDpm.getString(CONNECT_APPS_DIALOG_SUMMARY,
+        dialogSummary.setText(mDpm.getResources().getString(CONNECT_APPS_DIALOG_SUMMARY,
                 () -> getString(
                         R.string.interact_across_profiles_consent_dialog_summary)));
 
@@ -445,7 +446,7 @@
         }
         if (!mInstalledInPersonal) {
             mInstallBanner.setTitle(
-                    mDpm.getString(INSTALL_IN_PERSONAL_PROFILE_TO_CONNECT_PROMPT,
+                    mDpm.getResources().getString(INSTALL_IN_PERSONAL_PROFILE_TO_CONNECT_PROMPT,
                             () -> getString(
                                     R.string.interact_across_profiles_install_personal_app_title,
                                     mAppLabel),
@@ -459,7 +460,7 @@
         }
         if (!mInstalledInWork) {
             mInstallBanner.setTitle(
-                    mDpm.getString(INSTALL_IN_WORK_PROFILE_TO_CONNECT_PROMPT,
+                    mDpm.getResources().getString(INSTALL_IN_WORK_PROFILE_TO_CONNECT_PROMPT,
                             () -> getString(
                                     R.string.interact_across_profiles_install_work_app_title,
                                     mAppLabel),
diff --git a/src/com/android/settings/applications/specialaccess/interactacrossprofiles/InteractAcrossProfilesSettings.java b/src/com/android/settings/applications/specialaccess/interactacrossprofiles/InteractAcrossProfilesSettings.java
index 05ec3e9..6ce0869 100644
--- a/src/com/android/settings/applications/specialaccess/interactacrossprofiles/InteractAcrossProfilesSettings.java
+++ b/src/com/android/settings/applications/specialaccess/interactacrossprofiles/InteractAcrossProfilesSettings.java
@@ -95,7 +95,8 @@
                 @Override
                 public boolean onPreferenceClick(Preference preference) {
                     AppInfoBase.startAppInfoFragment(InteractAcrossProfilesDetails.class,
-                            mDevicePolicyManager.getString(CONNECTED_WORK_AND_PERSONAL_APPS_TITLE,
+                            mDevicePolicyManager.getResources().getString(
+                                    CONNECTED_WORK_AND_PERSONAL_APPS_TITLE,
                                     () -> getString(R.string.interact_across_profiles_title)),
                             packageName,
                             appInfo.uid,
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java
index b622c1c..efb200f 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java
@@ -225,7 +225,7 @@
     @Override
     protected String getDescriptionDisabledByAdmin() {
         DevicePolicyManager devicePolicyManager = getSystemService(DevicePolicyManager.class);
-        return devicePolicyManager.getString(
+        return devicePolicyManager.getResources().getString(
                 FACE_UNLOCK_DISABLED,
                 () -> getString(R.string.security_settings_face_enroll_introduction_message_unlock_disabled));
     }
diff --git a/src/com/android/settings/biometrics/face/FaceProfileStatusPreferenceController.java b/src/com/android/settings/biometrics/face/FaceProfileStatusPreferenceController.java
index abfd3a2..a2e11af 100644
--- a/src/com/android/settings/biometrics/face/FaceProfileStatusPreferenceController.java
+++ b/src/com/android/settings/biometrics/face/FaceProfileStatusPreferenceController.java
@@ -80,7 +80,7 @@
         super.updateState(preference);
 
         preference.setTitle(
-                mDevicePolicyManager.getString(FACE_SETTINGS_FOR_WORK_TITLE, () ->
+                mDevicePolicyManager.getResources().getString(FACE_SETTINGS_FOR_WORK_TITLE, () ->
                 mContext.getResources().getString(
                 R.string.security_settings_face_profile_preference_title)));
     }
diff --git a/src/com/android/settings/biometrics/face/FaceSettings.java b/src/com/android/settings/biometrics/face/FaceSettings.java
index f3a7f2c..dc94376 100644
--- a/src/com/android/settings/biometrics/face/FaceSettings.java
+++ b/src/com/android/settings/biometrics/face/FaceSettings.java
@@ -162,9 +162,9 @@
 
         if (mUserManager.getUserInfo(mUserId).isManagedProfile()) {
             getActivity().setTitle(
-                    mDevicePolicyManager.getString(FACE_SETTINGS_FOR_WORK_TITLE, () ->
-                    getActivity().getResources().getString(
-                    R.string.security_settings_face_profile_preference_title)));
+                    mDevicePolicyManager.getResources().getString(FACE_SETTINGS_FOR_WORK_TITLE,
+                            () -> getActivity().getResources().getString(
+                                    R.string.security_settings_face_profile_preference_title)));
         }
 
         mLockscreenController = Utils.isMultipleBiometricsSupported(context)
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollIntroduction.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollIntroduction.java
index 23595fb..82b76c3 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollIntroduction.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollIntroduction.java
@@ -186,7 +186,7 @@
 
     @Override
     protected String getDescriptionDisabledByAdmin() {
-        return mDevicePolicyManager.getString(
+        return mDevicePolicyManager.getResources().getString(
                 FINGERPRINT_UNLOCK_DISABLED,
                 () -> getString(R.string.security_settings_fingerprint_enroll_introduction_message_unlock_disabled));
     }
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java b/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
index a5832ea..2282192 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
@@ -19,7 +19,7 @@
 
 import static android.app.admin.DevicePolicyResources.Strings.Settings.FINGERPRINT_UNLOCK_DISABLED_EXPLANATION;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_FINGERPRINT_LAST_DELETE_MESSAGE;
-import static android.app.admin.DevicePolicyResources.Strings.UNDEFINED;
+import static android.app.admin.DevicePolicyResources.UNDEFINED;
 
 import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
 
@@ -366,7 +366,7 @@
             if (admin != null) {
                 DevicePolicyManager devicePolicyManager =
                         getSystemService(DevicePolicyManager.class);
-                String footerText = devicePolicyManager.getString(
+                String footerText = devicePolicyManager.getResources().getString(
                         FINGERPRINT_UNLOCK_DISABLED_EXPLANATION,
                         () -> getString(R.string.security_settings_fingerprint_enroll_disclaimer_lockscreen_disabled));
 
@@ -457,10 +457,8 @@
             final Preference addPreference = findPreference(KEY_FINGERPRINT_ADD);
 
             /* Disable preference if too many fingerprints added */
-            final List<FingerprintSensorPropertiesInternal> props =
-                    mFingerprintManager.getSensorPropertiesInternal();
-            // This will need to be updated for devices with multiple fingerprint sensors
-            final int max = props.get(0).maxEnrollmentsPerUser;
+            final int max = getContext().getResources().getInteger(
+                    com.android.internal.R.integer.config_fingerprintMaxTemplatesPerUser);
             boolean tooMany = mFingerprintManager.getEnrolledFingerprints(mUserId).size() >= max;
             // retryFingerprint() will be called when remove finishes
             // need to disable enroll or have a way to determine if enroll is in progress
@@ -948,7 +946,7 @@
 
                 final AlertDialog alertDialog = new AlertDialog.Builder(getActivity())
                         .setTitle(R.string.fingerprint_last_delete_title)
-                        .setMessage(devicePolicyManager.getString(
+                        .setMessage(devicePolicyManager.getResources().getString(
                                 messageId, () -> getContext().getString(defaultMessageId)))
                         .setPositiveButton(R.string.fingerprint_last_delete_confirm,
                                 new DialogInterface.OnClickListener() {
diff --git a/src/com/android/settings/bugreporthandler/BugReportHandlerPicker.java b/src/com/android/settings/bugreporthandler/BugReportHandlerPicker.java
index 25b15c7..276e7aa 100644
--- a/src/com/android/settings/bugreporthandler/BugReportHandlerPicker.java
+++ b/src/com/android/settings/bugreporthandler/BugReportHandlerPicker.java
@@ -196,10 +196,10 @@
                 context.getSystemService(DevicePolicyManager.class);
 
         if (userInfo != null && userInfo.isManagedProfile()) {
-            return devicePolicyManager.getString(WORK_PROFILE_APP_SUBTEXT,
+            return devicePolicyManager.getResources().getString(WORK_PROFILE_APP_SUBTEXT,
                     () -> context.getString(R.string.work_profile_app_subtext));
         }
-        return devicePolicyManager.getString(PERSONAL_PROFILE_APP_SUBTEXT,
+        return devicePolicyManager.getResources().getString(PERSONAL_PROFILE_APP_SUBTEXT,
                 () -> context.getString(R.string.personal_profile_app_subtext));
     }
 
diff --git a/src/com/android/settings/dashboard/DashboardFragment.java b/src/com/android/settings/dashboard/DashboardFragment.java
index 26fe1b1..6ac0fa4 100644
--- a/src/com/android/settings/dashboard/DashboardFragment.java
+++ b/src/com/android/settings/dashboard/DashboardFragment.java
@@ -545,7 +545,7 @@
         }
 
         preference.setTitle(
-                mDevicePolicyManager.getString(overrideKey,
+                mDevicePolicyManager.getResources().getString(overrideKey,
                         () -> getString(resource)));
     }
 
@@ -558,7 +558,7 @@
         }
 
         preference.setSummary(
-                mDevicePolicyManager.getString(overrideKey,
+                mDevicePolicyManager.getResources().getString(overrideKey,
                         () -> getString(resource)));
     }
 }
diff --git a/src/com/android/settings/dashboard/profileselector/ProfileSelectFragment.java b/src/com/android/settings/dashboard/profileselector/ProfileSelectFragment.java
index 47eaf84..30b971c 100644
--- a/src/com/android/settings/dashboard/profileselector/ProfileSelectFragment.java
+++ b/src/com/android/settings/dashboard/profileselector/ProfileSelectFragment.java
@@ -189,11 +189,11 @@
                 getContext().getSystemService(DevicePolicyManager.class);
 
         if (position == WORK_TAB) {
-            return devicePolicyManager.getString(WORK_CATEGORY_HEADER,
+            return devicePolicyManager.getResources().getString(WORK_CATEGORY_HEADER,
                     () -> getContext().getString(R.string.category_work));
         }
 
-        return devicePolicyManager.getString(PERSONAL_CATEGORY_HEADER,
+        return devicePolicyManager.getResources().getString(PERSONAL_CATEGORY_HEADER,
                 () -> getContext().getString(R.string.category_personal));
     }
 
diff --git a/src/com/android/settings/dashboard/profileselector/UserAdapter.java b/src/com/android/settings/dashboard/profileselector/UserAdapter.java
index abf22df..ae5351e 100644
--- a/src/com/android/settings/dashboard/profileselector/UserAdapter.java
+++ b/src/com/android/settings/dashboard/profileselector/UserAdapter.java
@@ -59,9 +59,9 @@
             UserInfo userInfo = um.getUserInfo(mUserHandle.getIdentifier());
             Drawable icon;
             if (userInfo.isManagedProfile()) {
-                mName = context.getSystemService(DevicePolicyManager.class).getString(
-                        WORK_PROFILE_USER_LABEL,
-                        () -> context.getString(R.string.managed_user_title));
+                mName = context.getSystemService(DevicePolicyManager.class).getResources()
+                        .getString(WORK_PROFILE_USER_LABEL,
+                                () -> context.getString(R.string.managed_user_title));
                 icon = context.getPackageManager().getUserBadgeForDensityNoBackground(
                         userHandle, /* density= */ 0);
             } else {
@@ -119,10 +119,10 @@
         int userHandle = user.mUserHandle.getIdentifier();
         if (userHandle == UserHandle.USER_CURRENT
                 || userHandle == ActivityManager.getCurrentUser()) {
-            return mDevicePolicyManager.getString(PERSONAL_CATEGORY_HEADER,
+            return mDevicePolicyManager.getResources().getString(PERSONAL_CATEGORY_HEADER,
                     () -> mContext.getString(R.string.category_personal));
         } else {
-            return mDevicePolicyManager.getString(WORK_CATEGORY_HEADER,
+            return mDevicePolicyManager.getResources().getString(WORK_CATEGORY_HEADER,
                     () -> mContext.getString(R.string.category_work));
         }
     }
diff --git a/src/com/android/settings/development/tare/AlarmManagerFragment.java b/src/com/android/settings/development/tare/AlarmManagerFragment.java
index fe76b12..c4dca37 100644
--- a/src/com/android/settings/development/tare/AlarmManagerFragment.java
+++ b/src/com/android/settings/development/tare/AlarmManagerFragment.java
@@ -95,7 +95,8 @@
                 resources.getString(R.string.tare_consumption_limits),
                 resources.getString(R.string.tare_balances),
                 // resources.getString(R.string.tare_modifiers),
-                // resources.getString(R.string.tare_actions),
+                resources.getString(R.string.tare_actions_ctp),
+                resources.getString(R.string.tare_actions_base_price),
                 // resources.getString(R.string.tare_rewards)
         };
 
@@ -104,7 +105,8 @@
                 resources.getStringArray(R.array.tare_app_balance_subfactors),
                 // TODO: support
                 // resources.getStringArray(R.array.tare_modifiers_subfactors),
-                // resources.getStringArray(R.array.tare_alarm_manager_actions),
+                resources.getStringArray(R.array.tare_alarm_manager_actions),
+                resources.getStringArray(R.array.tare_alarm_manager_actions),
                 // resources.getStringArray(R.array.tare_rewards_subfactors)
         };
 
@@ -120,7 +122,31 @@
                         EconomyManager.KEY_AM_MIN_SATIATED_BALANCE_OTHER_APP
                 },
                 // {},
-                // {},
+                {
+                        EconomyManager.KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_EXACT_WAKEUP_CTP,
+                        EconomyManager.KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_WAKEUP_CTP,
+                        EconomyManager.KEY_AM_ACTION_ALARM_EXACT_WAKEUP_CTP,
+                        EconomyManager.KEY_AM_ACTION_ALARM_INEXACT_WAKEUP_CTP,
+                        EconomyManager.KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_EXACT_NONWAKEUP_CTP,
+                        EconomyManager.KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_NONWAKEUP_CTP,
+                        EconomyManager.KEY_AM_ACTION_ALARM_EXACT_NONWAKEUP_CTP,
+                        EconomyManager.KEY_AM_ACTION_ALARM_INEXACT_NONWAKEUP_CTP,
+                        EconomyManager.KEY_AM_ACTION_ALARM_ALARMCLOCK_CTP
+                },
+                {
+                        EconomyManager.KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_EXACT_WAKEUP_BASE_PRICE,
+                        EconomyManager
+                                .KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_WAKEUP_BASE_PRICE,
+                        EconomyManager.KEY_AM_ACTION_ALARM_EXACT_WAKEUP_BASE_PRICE,
+                        EconomyManager.KEY_AM_ACTION_ALARM_INEXACT_WAKEUP_BASE_PRICE,
+                        EconomyManager
+                                .KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_EXACT_NONWAKEUP_BASE_PRICE,
+                        EconomyManager
+                                .KEY_AM_ACTION_ALARM_ALLOW_WHILE_IDLE_INEXACT_NONWAKEUP_BASE_PRICE,
+                        EconomyManager.KEY_AM_ACTION_ALARM_EXACT_NONWAKEUP_BASE_PRICE,
+                        EconomyManager.KEY_AM_ACTION_ALARM_INEXACT_NONWAKEUP_BASE_PRICE,
+                        EconomyManager.KEY_AM_ACTION_ALARM_ALARMCLOCK_BASE_PRICE
+                },
                 // {},
         };
     }
diff --git a/src/com/android/settings/development/tare/JobSchedulerFragment.java b/src/com/android/settings/development/tare/JobSchedulerFragment.java
index 1c6598c..275e012 100644
--- a/src/com/android/settings/development/tare/JobSchedulerFragment.java
+++ b/src/com/android/settings/development/tare/JobSchedulerFragment.java
@@ -96,7 +96,8 @@
                 resources.getString(R.string.tare_consumption_limits),
                 resources.getString(R.string.tare_balances),
                 // mResources.getString(R.string.tare_modifiers),
-                // mResources.getString(R.string.tare_actions),
+                resources.getString(R.string.tare_actions_ctp),
+                resources.getString(R.string.tare_actions_base_price),
                 // mResources.getString(R.string.tare_rewards)
         };
 
@@ -105,7 +106,8 @@
                 resources.getStringArray(R.array.tare_app_balance_subfactors),
                 // TODO: support
                 // mResources.getStringArray(R.array.tare_modifiers_subfactors),
-                // mResources.getStringArray(R.array.tare_job_scheduler_actions),
+                resources.getStringArray(R.array.tare_job_scheduler_actions),
+                resources.getStringArray(R.array.tare_job_scheduler_actions),
                 // mResources.getStringArray(R.array.tare_rewards_subfactors)
         };
 
@@ -121,7 +123,32 @@
                         EconomyManager.KEY_JS_MIN_SATIATED_BALANCE_OTHER_APP
                 },
                 // {},
-                // {},
+                {
+                        EconomyManager.KEY_JS_ACTION_JOB_MAX_START_CTP,
+                        EconomyManager.KEY_JS_ACTION_JOB_MAX_RUNNING_CTP,
+                        EconomyManager.KEY_JS_ACTION_JOB_HIGH_START_CTP,
+                        EconomyManager.KEY_JS_ACTION_JOB_HIGH_RUNNING_CTP,
+                        EconomyManager.KEY_JS_ACTION_JOB_DEFAULT_START_CTP,
+                        EconomyManager.KEY_JS_ACTION_JOB_DEFAULT_RUNNING_CTP,
+                        EconomyManager.KEY_JS_ACTION_JOB_LOW_START_CTP,
+                        EconomyManager.KEY_JS_ACTION_JOB_LOW_RUNNING_CTP,
+                        EconomyManager.KEY_JS_ACTION_JOB_MIN_START_CTP,
+                        EconomyManager.KEY_JS_ACTION_JOB_MIN_RUNNING_CTP,
+                        EconomyManager.KEY_JS_ACTION_JOB_TIMEOUT_PENALTY_CTP
+                },
+                {
+                        EconomyManager.KEY_JS_ACTION_JOB_MAX_START_BASE_PRICE,
+                        EconomyManager.KEY_JS_ACTION_JOB_MAX_RUNNING_BASE_PRICE,
+                        EconomyManager.KEY_JS_ACTION_JOB_HIGH_START_BASE_PRICE,
+                        EconomyManager.KEY_JS_ACTION_JOB_HIGH_RUNNING_BASE_PRICE,
+                        EconomyManager.KEY_JS_ACTION_JOB_DEFAULT_START_BASE_PRICE,
+                        EconomyManager.KEY_JS_ACTION_JOB_DEFAULT_RUNNING_BASE_PRICE,
+                        EconomyManager.KEY_JS_ACTION_JOB_LOW_START_BASE_PRICE,
+                        EconomyManager.KEY_JS_ACTION_JOB_LOW_RUNNING_BASE_PRICE,
+                        EconomyManager.KEY_JS_ACTION_JOB_MIN_START_BASE_PRICE,
+                        EconomyManager.KEY_JS_ACTION_JOB_MIN_RUNNING_BASE_PRICE,
+                        EconomyManager.KEY_JS_ACTION_JOB_TIMEOUT_PENALTY_BASE_PRICE
+                },
                 // {},
         };
     }
diff --git a/src/com/android/settings/deviceinfo/StorageWizardMoveProgress.java b/src/com/android/settings/deviceinfo/StorageWizardMoveProgress.java
index 454de9d..0c5e4a0 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardMoveProgress.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardMoveProgress.java
@@ -89,7 +89,7 @@
             case PackageManager.MOVE_FAILED_INSUFFICIENT_STORAGE:
                 return getString(R.string.insufficient_storage);
             case PackageManager.MOVE_FAILED_DEVICE_ADMIN:
-                return getSystemService(DevicePolicyManager.class)
+                return getSystemService(DevicePolicyManager.class).getResources()
                         .getString(ERROR_MOVE_DEVICE_ADMIN,
                                 () -> getString(R.string.move_error_device_admin));
             case PackageManager.MOVE_FAILED_DOESNT_EXIST:
diff --git a/src/com/android/settings/display/ScreenTimeoutPreferenceController.java b/src/com/android/settings/display/ScreenTimeoutPreferenceController.java
index 65f0853..94041ee 100644
--- a/src/com/android/settings/display/ScreenTimeoutPreferenceController.java
+++ b/src/com/android/settings/display/ScreenTimeoutPreferenceController.java
@@ -62,6 +62,7 @@
         if (admin != null) {
             preference.setEnabled(false);
             preference.setSummary(mContext.getSystemService(DevicePolicyManager.class)
+                    .getResources()
                     .getString(DISABLED_BY_IT_ADMIN_TITLE,
                             () -> mContext.getString(R.string.disabled_by_policy_title)));
             ((RestrictedPreference) preference).setDisabledByAdmin(admin);
diff --git a/src/com/android/settings/display/ScreenTimeoutSettings.java b/src/com/android/settings/display/ScreenTimeoutSettings.java
index 43ec864..25bf852 100644
--- a/src/com/android/settings/display/ScreenTimeoutSettings.java
+++ b/src/com/android/settings/display/ScreenTimeoutSettings.java
@@ -223,7 +223,7 @@
 
     @VisibleForTesting
     void setupDisabledFooterPreference() {
-        final String textDisabledByAdmin = mDevicePolicyManager.getString(
+        final String textDisabledByAdmin = mDevicePolicyManager.getResources().getString(
                 OTHER_OPTIONS_DISABLED_BY_ADMIN, () -> getResources().getString(
                         R.string.admin_disabled_other_options));
         final String textMoreDetails = getResources().getString(R.string.admin_more_details);
diff --git a/src/com/android/settings/emergency/EmergencyDashboardFragment.java b/src/com/android/settings/emergency/EmergencyDashboardFragment.java
index 3356645..aa5a2ec 100644
--- a/src/com/android/settings/emergency/EmergencyDashboardFragment.java
+++ b/src/com/android/settings/emergency/EmergencyDashboardFragment.java
@@ -66,5 +66,10 @@
     }
 
     public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
-            new BaseSearchIndexProvider(R.xml.emergency_settings);
+            new BaseSearchIndexProvider(R.xml.emergency_settings) {
+                @Override
+                protected boolean isPageSearchEnabled(Context context) {
+                    return context.getResources().getBoolean(R.bool.config_show_emergency_settings);
+                }
+            };
 }
diff --git a/src/com/android/settings/enterprise/ActionDisabledByAdminDialogHelper.java b/src/com/android/settings/enterprise/ActionDisabledByAdminDialogHelper.java
index 055e868..b61813b 100644
--- a/src/com/android/settings/enterprise/ActionDisabledByAdminDialogHelper.java
+++ b/src/com/android/settings/enterprise/ActionDisabledByAdminDialogHelper.java
@@ -73,7 +73,7 @@
                 mActivity.getSystemService(DevicePolicyManager.class);
 
         TextView title = mDialogView.findViewById(R.id.admin_support_dialog_title);
-        title.setText(devicePolicyManager.getString(DISABLED_BY_IT_ADMIN_TITLE,
+        title.setText(devicePolicyManager.getResources().getString(DISABLED_BY_IT_ADMIN_TITLE,
                 () -> mActivity.getString(R.string.disabled_by_policy_title)));
 
     }
diff --git a/src/com/android/settings/enterprise/AdminActionPreferenceControllerBase.java b/src/com/android/settings/enterprise/AdminActionPreferenceControllerBase.java
index d5c10b4..e5484db 100644
--- a/src/com/android/settings/enterprise/AdminActionPreferenceControllerBase.java
+++ b/src/com/android/settings/enterprise/AdminActionPreferenceControllerBase.java
@@ -52,7 +52,7 @@
     }
 
     private String getEnterprisePrivacyNone() {
-        return mContext.getSystemService(DevicePolicyManager.class)
+        return mContext.getSystemService(DevicePolicyManager.class).getResources()
                 .getString(ADMIN_ACTION_NONE,
                         () -> mContext.getString(R.string.enterprise_privacy_none));
     }
diff --git a/src/com/android/settings/enterprise/AlwaysOnVpnCurrentUserPreferenceController.java b/src/com/android/settings/enterprise/AlwaysOnVpnCurrentUserPreferenceController.java
index e883ac3..f1f9a61 100644
--- a/src/com/android/settings/enterprise/AlwaysOnVpnCurrentUserPreferenceController.java
+++ b/src/com/android/settings/enterprise/AlwaysOnVpnCurrentUserPreferenceController.java
@@ -44,13 +44,13 @@
     public void updateState(Preference preference) {
         if (mFeatureProvider.isInCompMode()) {
             preference.setTitle(
-                    mDevicePolicyManager.getString(
+                    mDevicePolicyManager.getResources().getString(
                             ALWAYS_ON_VPN_PERSONAL_PROFILE,
                             () -> mContext.getString(
                                     R.string.enterprise_privacy_always_on_vpn_personal)));
         } else {
             preference.setTitle(
-                    mDevicePolicyManager.getString(ALWAYS_ON_VPN_DEVICE,
+                    mDevicePolicyManager.getResources().getString(ALWAYS_ON_VPN_DEVICE,
                             () -> mContext.getString(
                                     R.string.enterprise_privacy_always_on_vpn_device)));
         }
diff --git a/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceController.java b/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceController.java
index 76aa6bc..394de07 100644
--- a/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceController.java
+++ b/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceController.java
@@ -47,11 +47,11 @@
         super.updateState(preference);
 
         if (mFeatureProvider.isInCompMode()) {
-            preference.setTitle(mDevicePolicyManager.getString(
+            preference.setTitle(mDevicePolicyManager.getResources().getString(
                     CA_CERTS_PERSONAL_PROFILE,
                     () -> mContext.getString(R.string.enterprise_privacy_ca_certs_personal)));
         } else {
-            preference.setTitle(mDevicePolicyManager.getString(
+            preference.setTitle(mDevicePolicyManager.getResources().getString(
                     CA_CERTS_DEVICE,
                     () -> mContext.getString(R.string.enterprise_privacy_ca_certs_device)));
         }
diff --git a/src/com/android/settings/enterprise/DeviceAdminStringProviderImpl.java b/src/com/android/settings/enterprise/DeviceAdminStringProviderImpl.java
index 696baca..422ffe9 100644
--- a/src/com/android/settings/enterprise/DeviceAdminStringProviderImpl.java
+++ b/src/com/android/settings/enterprise/DeviceAdminStringProviderImpl.java
@@ -39,7 +39,7 @@
 
     @Override
     public String getDefaultDisabledByPolicyTitle() {
-        return mDevicePolicyManager.getString(DISABLED_BY_IT_ADMIN_TITLE,
+        return mDevicePolicyManager.getResources().getString(DISABLED_BY_IT_ADMIN_TITLE,
                 () -> mContext.getString(R.string.disabled_by_policy_title));
     }
 
@@ -75,13 +75,13 @@
 
     @Override
     public String getDefaultDisabledByPolicyContent() {
-        return mDevicePolicyManager.getString(CONTACT_YOUR_IT_ADMIN,
+        return mDevicePolicyManager.getResources().getString(CONTACT_YOUR_IT_ADMIN,
                 () -> mContext.getString(R.string.default_admin_support_msg));
     }
 
     @Override
     public String getLearnMoreHelpPageUrl() {
-        return mDevicePolicyManager.getString(IT_ADMIN_POLICY_DISABLING_INFO_URL,
+        return mDevicePolicyManager.getResources().getString(IT_ADMIN_POLICY_DISABLING_INFO_URL,
                 () -> mContext.getString(R.string.help_url_action_disabled_by_it_admin));
     }
 
diff --git a/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java b/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java
index 76b2e24..6cadbda 100644
--- a/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java
+++ b/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java
@@ -98,11 +98,11 @@
         final SpannableStringBuilder disclosure = new SpannableStringBuilder();
         final CharSequence organizationName = mDpm.getDeviceOwnerOrganizationName();
         if (organizationName != null) {
-            disclosure.append(mDpm.getString(DEVICE_MANAGED_WITH_NAME,
+            disclosure.append(mDpm.getResources().getString(DEVICE_MANAGED_WITH_NAME,
                     () -> mResources.getString(R.string.do_disclosure_with_name,
                     organizationName), organizationName));
         } else {
-            disclosure.append(mDpm.getString(DEVICE_MANAGED_WITHOUT_NAME,
+            disclosure.append(mDpm.getResources().getString(DEVICE_MANAGED_WITHOUT_NAME,
                     () -> mResources.getString(R.string.do_disclosure_generic)));
         }
         return disclosure;
diff --git a/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListPreferenceController.java b/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListPreferenceController.java
index 34d098d..3c090ed 100644
--- a/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListPreferenceController.java
+++ b/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListPreferenceController.java
@@ -134,11 +134,11 @@
                 final PreferenceCategory category = new PreferenceCategory(prefContext);
                 screen.addPreference(category);
                 if (userInfo.isManagedProfile()) {
-                    category.setTitle(devicePolicyManager.getString(
+                    category.setTitle(devicePolicyManager.getResources().getString(
                             WORK_CATEGORY_HEADER,
                             () -> mContext.getString(R.string.category_work)));
                 } else {
-                    category.setTitle(devicePolicyManager.getString(
+                    category.setTitle(devicePolicyManager.getResources().getString(
                             PERSONAL_CATEGORY_HEADER,
                             () -> mContext.getString(R.string.category_personal)));
                 }
diff --git a/src/com/android/settings/enterprise/ImePreferenceController.java b/src/com/android/settings/enterprise/ImePreferenceController.java
index 25dcdaf..2adf52c 100644
--- a/src/com/android/settings/enterprise/ImePreferenceController.java
+++ b/src/com/android/settings/enterprise/ImePreferenceController.java
@@ -41,7 +41,7 @@
     @Override
     public void updateState(Preference preference) {
         preference.setSummary(
-                mContext.getSystemService(DevicePolicyManager.class)
+                mContext.getSystemService(DevicePolicyManager.class).getResources()
                         .getString(ADMIN_ACTION_SET_INPUT_METHOD_NAME, () ->
                                 mContext.getResources().getString(
                                         R.string.enterprise_privacy_input_method_name,
diff --git a/src/com/android/settings/enterprise/ManageDeviceAdminPreferenceController.java b/src/com/android/settings/enterprise/ManageDeviceAdminPreferenceController.java
index 934659d..71bd3d1 100644
--- a/src/com/android/settings/enterprise/ManageDeviceAdminPreferenceController.java
+++ b/src/com/android/settings/enterprise/ManageDeviceAdminPreferenceController.java
@@ -42,7 +42,7 @@
                 = mFeatureProvider.getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile();
 
         if (activeAdmins == 0) {
-            return mDevicePolicyManager.getString(NUMBER_OF_DEVICE_ADMINS_NONE,
+            return mDevicePolicyManager.getResources().getString(NUMBER_OF_DEVICE_ADMINS_NONE,
                     () -> mContext.getResources().getString(R.string.number_of_device_admins_none));
         }
 
diff --git a/src/com/android/settings/enterprise/PrivacyPreferenceControllerHelper.java b/src/com/android/settings/enterprise/PrivacyPreferenceControllerHelper.java
index f6070bd..e582fb0 100644
--- a/src/com/android/settings/enterprise/PrivacyPreferenceControllerHelper.java
+++ b/src/com/android/settings/enterprise/PrivacyPreferenceControllerHelper.java
@@ -52,16 +52,16 @@
 
         final String organizationName = mFeatureProvider.getDeviceOwnerOrganizationName();
         if (organizationName == null) {
-            preference.setSummary(mDevicePolicyManager.getString(
+            preference.setSummary(mDevicePolicyManager.getResources().getString(
                     MANAGED_DEVICE_INFO_SUMMARY,
                     () -> mContext.getString(
                             R.string.enterprise_privacy_settings_summary_generic)));
         } else {
-            preference.setSummary(mDevicePolicyManager
-                    .getString(MANAGED_DEVICE_INFO_SUMMARY_WITH_NAME,
-                            () -> mContext.getResources().getString(
-                                    R.string.enterprise_privacy_settings_summary_with_name,
-                                    organizationName), organizationName));
+            preference.setSummary(mDevicePolicyManager.getResources().getString(
+                    MANAGED_DEVICE_INFO_SUMMARY_WITH_NAME,
+                    () -> mContext.getResources().getString(
+                            R.string.enterprise_privacy_settings_summary_with_name,
+                            organizationName), organizationName));
         }
     }
 
diff --git a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSettings.java b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSettings.java
index 3943ac5..2ea9954 100644
--- a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSettings.java
+++ b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSettings.java
@@ -83,7 +83,6 @@
     void addHelpLink() {
         FooterPreference pref = getPreferenceScreen().findPreference(KEY_FOOTER_PREFERENCE);
         if (pref != null) {
-            pref.setSelectable(false);
             pref.setLearnMoreAction(v -> {
                 mMetricsFeatureProvider.action(getContext(),
                         SettingsEnums.ACTION_APP_BATTERY_LEARN_MORE);
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/WorkModeConditionController.java b/src/com/android/settings/homepage/contextualcards/conditional/WorkModeConditionController.java
index 1927421..beef59f 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/WorkModeConditionController.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/WorkModeConditionController.java
@@ -89,7 +89,7 @@
 
     @Override
     public ContextualCard buildContextualCard() {
-        String conditionWorkTitle = mDpm.getString(WORK_PROFILE_OFF_CONDITION_TITLE,
+        String conditionWorkTitle = mDpm.getResources().getString(WORK_PROFILE_OFF_CONDITION_TITLE,
                 () -> mAppContext.getString(R.string.condition_work_title));
         return new ConditionalContextualCard.Builder()
                 .setConditionId(ID)
diff --git a/src/com/android/settings/localepicker/OWNERS b/src/com/android/settings/localepicker/OWNERS
new file mode 100644
index 0000000..12ab32f
--- /dev/null
+++ b/src/com/android/settings/localepicker/OWNERS
@@ -0,0 +1,7 @@
+allenwtsu@google.com

+calvinpan@google.com

+danielwbhuang@google.com

+goldmanj@google.com

+jamescflin@google.com

+joshhou@google.com

+tomhsu@google.com
\ No newline at end of file
diff --git a/src/com/android/settings/network/SubscriptionsPreferenceController.java b/src/com/android/settings/network/SubscriptionsPreferenceController.java
index 87c4697..218e3ec 100644
--- a/src/com/android/settings/network/SubscriptionsPreferenceController.java
+++ b/src/com/android/settings/network/SubscriptionsPreferenceController.java
@@ -41,7 +41,6 @@
 import android.telephony.TelephonyManager;
 import android.text.Html;
 import android.util.ArraySet;
-import android.util.Log;
 
 import androidx.annotation.VisibleForTesting;
 import androidx.collection.ArrayMap;
@@ -194,7 +193,6 @@
         mSignalStrengthListener.pause();
         mTelephonyDisplayInfoListener.pause();
         unRegisterReceiver();
-        resetProviderPreferenceSummary();
     }
 
     @Override
@@ -276,7 +274,6 @@
         String result = mSubsPrefCtrlInjector.getNetworkType(
                 mContext, mConfig, mTelephonyDisplayInfo, subId, isCarrierNetworkActive);
         if (mSubsPrefCtrlInjector.isActiveCellularNetwork(mContext) || isCarrierNetworkActive) {
-            Log.i(TAG, "Active cellular network or active carrier network.");
             result = mContext.getString(R.string.preference_summary_default_combination,
                     mContext.getString(R.string.mobile_data_connection_active), result);
         } else if (!isDataInService) {
@@ -327,13 +324,6 @@
         return icon;
     }
 
-    private void resetProviderPreferenceSummary() {
-        if (mSubsGearPref == null) {
-            return;
-        }
-        mSubsGearPref.setSummary("");
-    }
-
     @VisibleForTesting
     boolean shouldInflateSignalStrength(int subId) {
         return SignalStrengthUtil.shouldInflateSignalStrength(mContext, subId);
diff --git a/src/com/android/settings/notification/NotificationAccessSettings.java b/src/com/android/settings/notification/NotificationAccessSettings.java
index 0daa818..4ec9ccd 100644
--- a/src/com/android/settings/notification/NotificationAccessSettings.java
+++ b/src/com/android/settings/notification/NotificationAccessSettings.java
@@ -107,7 +107,7 @@
         if (UserManager.get(mContext).isManagedProfile()) {
             // Apps in the work profile do not support notification listeners.
             Toast.makeText(mContext,
-                    mDpm.getString(WORK_APPS_CANNOT_ACCESS_NOTIFICATION_SETTINGS,
+                    mDpm.getResources().getString(WORK_APPS_CANNOT_ACCESS_NOTIFICATION_SETTINGS,
                             () -> mContext.getString(R.string.notification_settings_work_profile)),
                     Toast.LENGTH_SHORT).show();
             finish();
@@ -168,7 +168,8 @@
             if (managedProfileId != UserHandle.USER_NULL
                     && !mDpm.isNotificationListenerServicePermitted(
                     service.packageName, managedProfileId)) {
-                pref.setSummary(mDpm.getString(WORK_PROFILE_NOTIFICATION_LISTENER_BLOCKED,
+                pref.setSummary(mDpm.getResources().getString(
+                        WORK_PROFILE_NOTIFICATION_LISTENER_BLOCKED,
                         () -> getString(
                                 R.string.work_profile_notification_access_blocked_summary)));
             }
diff --git a/src/com/android/settings/notification/SoundWorkSettingsController.java b/src/com/android/settings/notification/SoundWorkSettingsController.java
index bcaf4af..c14a7fe 100644
--- a/src/com/android/settings/notification/SoundWorkSettingsController.java
+++ b/src/com/android/settings/notification/SoundWorkSettingsController.java
@@ -257,9 +257,9 @@
     private void enableWorkSyncSettings() {
         mWorkUsePersonalSounds.setChecked(true);
 
-        String summary = mContext.getSystemService(DevicePolicyManager.class).getString(
-                WORK_PROFILE_SYNC_WITH_PERSONAL_SOUNDS_ACTIVE_SUMMARY,
-                () -> mContext.getString(R.string.work_sound_same_as_personal)
+        String summary = mContext.getSystemService(DevicePolicyManager.class).getResources()
+                .getString(WORK_PROFILE_SYNC_WITH_PERSONAL_SOUNDS_ACTIVE_SUMMARY,
+                        () -> mContext.getString(R.string.work_sound_same_as_personal)
         );
 
         if (mWorkPhoneRingtonePreference != null) {
@@ -355,10 +355,10 @@
                     context.getSystemService(DevicePolicyManager.class);
 
             return new AlertDialog.Builder(getActivity())
-                    .setTitle(devicePolicyManager.getString(
+                    .setTitle(devicePolicyManager.getResources().getString(
                             ENABLE_WORK_PROFILE_SYNC_WITH_PERSONAL_SOUNDS_DIALOG_TITLE,
                             () -> context.getString(R.string.work_sync_dialog_title)))
-                    .setMessage(devicePolicyManager.getString(
+                    .setMessage(devicePolicyManager.getResources().getString(
                             ENABLE_WORK_PROFILE_SYNC_WITH_PERSONAL_SOUNDS_DIALOG_MESSAGE,
                             () -> context.getString(R.string.work_sync_dialog_message)))
                     .setPositiveButton(R.string.work_sync_dialog_yes,
diff --git a/src/com/android/settings/notification/SpatialAudioParentPreferenceController.java b/src/com/android/settings/notification/SpatialAudioParentPreferenceController.java
new file mode 100644
index 0000000..c9eaa65
--- /dev/null
+++ b/src/com/android/settings/notification/SpatialAudioParentPreferenceController.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.notification;
+
+import android.content.Context;
+import android.media.AudioManager;
+import android.media.Spatializer;
+import android.util.Log;
+
+import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
+
+/**
+ * Parent menu summary of the Spatial audio settings
+ */
+public class SpatialAudioParentPreferenceController extends BasePreferenceController {
+    private static final String TAG = "SpatialAudioSetting";
+    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+
+    private final Spatializer mSpatializer;
+    private SpatialAudioPreferenceController mSpatialAudioPreferenceController;
+    private SpatialAudioWiredHeadphonesController mSpatialAudioWiredHeadphonesController;
+
+    public SpatialAudioParentPreferenceController(Context context, String key) {
+        super(context, key);
+        AudioManager audioManager = context.getSystemService(AudioManager.class);
+        mSpatializer = audioManager.getSpatializer();
+        mSpatialAudioPreferenceController = new SpatialAudioPreferenceController(context, "unused");
+        mSpatialAudioWiredHeadphonesController = new SpatialAudioWiredHeadphonesController(context,
+                "unused");
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        int level = mSpatializer.getImmersiveAudioLevel();
+        if (DEBUG) {
+            Log.d(TAG, "spatialization level: " + level);
+        }
+        return level == Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_NONE
+                ? UNSUPPORTED_ON_DEVICE : AVAILABLE;
+    }
+
+    @Override
+    public CharSequence getSummary() {
+        boolean speakerOn = mSpatialAudioPreferenceController.isAvailable()
+                && mSpatialAudioWiredHeadphonesController.isChecked();
+        boolean wiredHeadphonesOn = mSpatialAudioWiredHeadphonesController.isAvailable()
+                && mSpatialAudioWiredHeadphonesController.isChecked();
+        if (speakerOn && wiredHeadphonesOn) {
+            return mContext.getString(R.string.spatial_summary_on_two,
+                    mContext.getString(R.string.spatial_audio_speaker),
+                    mContext.getString(R.string.spatial_audio_wired_headphones));
+        } else if (speakerOn) {
+            return mContext.getString(R.string.spatial_summary_on_one,
+                    mContext.getString(R.string.spatial_audio_speaker));
+        } else if (wiredHeadphonesOn) {
+            return mContext.getString(R.string.spatial_summary_on_one,
+                    mContext.getString(R.string.spatial_audio_wired_headphones));
+        } else {
+            return mContext.getString(R.string.spatial_summary_off);
+        }
+    }
+}
diff --git a/src/com/android/settings/notification/SpatialAudioPreferenceController.java b/src/com/android/settings/notification/SpatialAudioPreferenceController.java
index 7bca516..707340f 100644
--- a/src/com/android/settings/notification/SpatialAudioPreferenceController.java
+++ b/src/com/android/settings/notification/SpatialAudioPreferenceController.java
@@ -17,46 +17,55 @@
 package com.android.settings.notification;
 
 import android.content.Context;
+import android.media.AudioDeviceAttributes;
+import android.media.AudioDeviceInfo;
 import android.media.AudioManager;
 import android.media.Spatializer;
 
+import androidx.annotation.VisibleForTesting;
+
 import com.android.settings.R;
 import com.android.settings.core.TogglePreferenceController;
 
 /**
- * The controller of the Spatial audio setting in the SoundSettings.
+ * The controller of the Spatial audio setting for speaker in the SoundSettings.
  */
 public class SpatialAudioPreferenceController extends TogglePreferenceController {
 
-    private static final String KEY_SPATIAL_AUDIO = "spatial_audio";
-
     private final Spatializer mSpatializer;
+    @VisibleForTesting
+    final AudioDeviceAttributes mSpeaker = new AudioDeviceAttributes(
+            AudioDeviceAttributes.ROLE_OUTPUT, AudioDeviceInfo.TYPE_BUILTIN_SPEAKER, ""
+    );
 
-    public SpatialAudioPreferenceController(Context context) {
-        super(context, KEY_SPATIAL_AUDIO);
+    public SpatialAudioPreferenceController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
         AudioManager audioManager = context.getSystemService(AudioManager.class);
         mSpatializer = audioManager.getSpatializer();
     }
 
     @Override
     public int getAvailabilityStatus() {
-        return mSpatializer.getImmersiveAudioLevel() == Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_NONE
-                ? UNSUPPORTED_ON_DEVICE : AVAILABLE;
+        return mSpatializer.isAvailableForDevice(mSpeaker) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
     }
 
     @Override
     public boolean isChecked() {
-        return mSpatializer.isEnabled();
+        return mSpatializer.getCompatibleAudioDevices().contains(mSpeaker);
     }
 
     @Override
     public boolean setChecked(boolean isChecked) {
-        mSpatializer.setEnabled(isChecked);
+        if (isChecked) {
+            mSpatializer.addCompatibleAudioDevice(mSpeaker);
+        } else {
+            mSpatializer.removeCompatibleAudioDevice(mSpeaker);
+        }
         return isChecked == isChecked();
     }
 
     @Override
     public int getSliceHighlightMenuRes() {
-        return R.string.menu_key_notifications;
+        return R.string.menu_key_sound;
     }
 }
diff --git a/src/com/android/settings/notification/SpatialAudioSettings.java b/src/com/android/settings/notification/SpatialAudioSettings.java
new file mode 100644
index 0000000..001c617
--- /dev/null
+++ b/src/com/android/settings/notification/SpatialAudioSettings.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.notification;
+
+import android.app.settings.SettingsEnums;
+
+import com.android.settings.R;
+import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settingslib.search.SearchIndexable;
+
+/**
+ * Spatial audio settings located in the sound menu
+ */
+@SearchIndexable
+public class SpatialAudioSettings extends DashboardFragment {
+
+    private static final String TAG = "SpatialAudioSettings";
+
+    @Override
+    public int getMetricsCategory() {
+        return SettingsEnums.SETTINGS_SPATIAL_AUDIO;
+    }
+
+    @Override
+    protected int getPreferenceScreenResId() {
+        return R.xml.spatial_audio_settings;
+    }
+
+    @Override
+    protected String getLogTag() {
+        return TAG;
+    }
+
+    public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+            new BaseSearchIndexProvider(R.xml.spatial_audio_settings);
+}
diff --git a/src/com/android/settings/notification/SpatialAudioWiredHeadphonesController.java b/src/com/android/settings/notification/SpatialAudioWiredHeadphonesController.java
new file mode 100644
index 0000000..9ff6a7f
--- /dev/null
+++ b/src/com/android/settings/notification/SpatialAudioWiredHeadphonesController.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.notification;
+
+import android.content.Context;
+import android.media.AudioDeviceAttributes;
+import android.media.AudioDeviceInfo;
+import android.media.AudioManager;
+import android.media.Spatializer;
+
+import androidx.annotation.VisibleForTesting;
+
+import com.android.settings.R;
+import com.android.settings.core.TogglePreferenceController;
+
+/**
+ * The controller of the Spatial audio setting for wired headphones in the SoundSettings.
+ */
+public class SpatialAudioWiredHeadphonesController extends TogglePreferenceController {
+
+    private final Spatializer mSpatializer;
+    @VisibleForTesting
+    final AudioDeviceAttributes mWiredHeadphones = new AudioDeviceAttributes(
+            AudioDeviceAttributes.ROLE_OUTPUT, AudioDeviceInfo.TYPE_WIRED_HEADPHONES, ""
+    );
+
+    public SpatialAudioWiredHeadphonesController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+        AudioManager audioManager = context.getSystemService(AudioManager.class);
+        mSpatializer = audioManager.getSpatializer();
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return mSpatializer.isAvailableForDevice(mWiredHeadphones) ? AVAILABLE
+                : UNSUPPORTED_ON_DEVICE;
+    }
+
+    @Override
+    public boolean isChecked() {
+        return mSpatializer.getCompatibleAudioDevices().contains(mWiredHeadphones);
+    }
+
+    @Override
+    public boolean setChecked(boolean isChecked) {
+        if (isChecked) {
+            mSpatializer.addCompatibleAudioDevice(mWiredHeadphones);
+        } else {
+            mSpatializer.removeCompatibleAudioDevice(mWiredHeadphones);
+        }
+        return isChecked == isChecked();
+    }
+
+    @Override
+    public int getSliceHighlightMenuRes() {
+        return R.string.menu_key_sound;
+    }
+}
diff --git a/src/com/android/settings/password/ChooseLockGeneric.java b/src/com/android/settings/password/ChooseLockGeneric.java
index a28f237..841d1f9 100644
--- a/src/com/android/settings/password/ChooseLockGeneric.java
+++ b/src/com/android/settings/password/ChooseLockGeneric.java
@@ -396,16 +396,18 @@
                 }
             } else {
                 if (mIsManagedProfile) {
-                    textView.setText(mDpm.getString(WORK_PROFILE_SCREEN_LOCK_SETUP_MESSAGE,
+                    textView.setText(mDpm.getResources().getString(
+                            WORK_PROFILE_SCREEN_LOCK_SETUP_MESSAGE,
                             () -> getString(R.string.lock_settings_picker_profile_message)));
                 } else {
                     int profileUserId = Utils.getManagedProfileId(mUserManager, mUserId);
                     if (mController.isScreenLockRestrictedByAdmin()
                             && profileUserId != UserHandle.USER_NULL) {
                         final StringBuilder description = new StringBuilder(
-                                mDpm.getString(WORK_PROFILE_IT_ADMIN_CANT_RESET_SCREEN_LOCK, () ->
-                                getString(
-                                R.string.lock_settings_picker_admin_restricted_personal_message)));
+                                mDpm.getResources().getString(
+                                        WORK_PROFILE_IT_ADMIN_CANT_RESET_SCREEN_LOCK,
+                                        () -> getString(
+                                                R.string.lock_settings_picker_admin_restricted_personal_message)));
                         final LinkifyUtils.OnClickListener clickListener = () -> {
                             final Bundle extras = new Bundle();
                             extras.putInt(Intent.EXTRA_USER_ID, profileUserId);
diff --git a/src/com/android/settings/password/ChooseLockPassword.java b/src/com/android/settings/password/ChooseLockPassword.java
index 9f307cb..7b0955e 100644
--- a/src/com/android/settings/password/ChooseLockPassword.java
+++ b/src/com/android/settings/password/ChooseLockPassword.java
@@ -24,7 +24,7 @@
 import static android.app.admin.DevicePolicyResources.Strings.Settings.REENTER_WORK_PROFILE_PIN_HEADER;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.SET_WORK_PROFILE_PASSWORD_HEADER;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.SET_WORK_PROFILE_PIN_HEADER;
-import static android.app.admin.DevicePolicyResources.Strings.UNDEFINED;
+import static android.app.admin.DevicePolicyResources.UNDEFINED;
 
 import static com.android.internal.widget.LockPatternUtils.CREDENTIAL_TYPE_NONE;
 import static com.android.internal.widget.PasswordValidationError.CONTAINS_INVALID_CHARACTERS;
@@ -389,7 +389,7 @@
                     } else if (type == TYPE_BIOMETRIC) {
                         return context.getString(alphaHintForBiometrics);
                     } else if (isProfile) {
-                        return context.getSystemService(DevicePolicyManager.class)
+                        return context.getSystemService(DevicePolicyManager.class).getResources()
                                 .getString(alphaHintOverrideForProfile,
                                         () -> context.getString(alphaHintForProfile));
                     } else {
@@ -403,7 +403,7 @@
                     } else if (type == TYPE_BIOMETRIC) {
                         return context.getString(numericHintForBiometrics);
                     } else if (isProfile) {
-                        return context.getSystemService(DevicePolicyManager.class)
+                        return context.getSystemService(DevicePolicyManager.class).getResources()
                                 .getString(numericHintOverrideForProfile,
                                         () -> context.getString(numericHintForProfile));
                     } else {
@@ -848,11 +848,11 @@
                         DevicePolicyManager devicePolicyManager =
                                 getContext().getSystemService(DevicePolicyManager.class);
                         if (mIsAlphaMode) {
-                            messages.add(devicePolicyManager.getString(
+                            messages.add(devicePolicyManager.getResources().getString(
                                     PASSWORD_RECENTLY_USED,
                                     () -> getString(R.string.lockpassword_password_recently_used)));
                         } else {
-                            messages.add(devicePolicyManager.getString(
+                            messages.add(devicePolicyManager.getResources().getString(
                                     PIN_RECENTLY_USED,
                                     () -> getString(R.string.lockpassword_pin_recently_used)));
                         }
diff --git a/src/com/android/settings/password/ChooseLockPattern.java b/src/com/android/settings/password/ChooseLockPattern.java
index 64fe9ef..6558262 100644
--- a/src/com/android/settings/password/ChooseLockPattern.java
+++ b/src/com/android/settings/password/ChooseLockPattern.java
@@ -482,7 +482,7 @@
             } else if (mForFace) {
                 msg = getString(R.string.lockpassword_choose_your_pattern_header_for_face);
             } else if (mIsManagedProfile) {
-                msg = getContext().getSystemService(DevicePolicyManager.class)
+                msg = getContext().getSystemService(DevicePolicyManager.class).getResources()
                         .getString(SET_WORK_PROFILE_PATTERN_HEADER,
                                 () -> getString(
                                         R.string.lockpassword_choose_your_profile_pattern_header));
diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
index 4b06fe0..3b5600f 100644
--- a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
+++ b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
@@ -272,7 +272,7 @@
             case LockPatternUtils.CREDENTIAL_TYPE_PIN:
 
                 if (isEffectiveUserManagedProfile) {
-                    return mDevicePolicyManager.getString(
+                    return mDevicePolicyManager.getResources().getString(
                             CONFIRM_WORK_PROFILE_PIN_HEADER,
                             () -> getString(R.string.lockpassword_confirm_your_work_pin_header));
                 }
@@ -280,7 +280,7 @@
                 return getString(R.string.lockpassword_confirm_your_pin_header);
             case LockPatternUtils.CREDENTIAL_TYPE_PATTERN:
                 if (isEffectiveUserManagedProfile) {
-                    return mDevicePolicyManager.getString(
+                    return mDevicePolicyManager.getResources().getString(
                             CONFIRM_WORK_PROFILE_PATTERN_HEADER,
                             () -> getString(
                                     R.string.lockpassword_confirm_your_work_pattern_header));
@@ -289,7 +289,7 @@
                 return getString(R.string.lockpassword_confirm_your_pattern_header);
             case LockPatternUtils.CREDENTIAL_TYPE_PASSWORD:
                 if (isEffectiveUserManagedProfile) {
-                    return mDevicePolicyManager.getString(
+                    return mDevicePolicyManager.getResources().getString(
                             CONFIRM_WORK_PROFILE_PASSWORD_HEADER,
                             () -> getString(
                                     R.string.lockpassword_confirm_your_work_password_header));
@@ -305,7 +305,7 @@
         switch (credentialType) {
             case LockPatternUtils.CREDENTIAL_TYPE_PIN:
                 if (isEffectiveUserManagedProfile) {
-                    return mDevicePolicyManager.getString(WORK_PROFILE_CONFIRM_PIN,
+                    return mDevicePolicyManager.getResources().getString(WORK_PROFILE_CONFIRM_PIN,
                             () -> getString(
                                     R.string.lockpassword_confirm_your_pin_generic_profile));
                 }
@@ -313,7 +313,8 @@
                 return getString(R.string.lockpassword_confirm_your_pin_generic);
             case LockPatternUtils.CREDENTIAL_TYPE_PATTERN:
                 if (isEffectiveUserManagedProfile) {
-                    return mDevicePolicyManager.getString(WORK_PROFILE_CONFIRM_PATTERN,
+                    return mDevicePolicyManager.getResources().getString(
+                            WORK_PROFILE_CONFIRM_PATTERN,
                             () -> getString(
                                     R.string.lockpassword_confirm_your_pattern_generic_profile));
                 }
@@ -321,7 +322,8 @@
                 return getString(R.string.lockpassword_confirm_your_pattern_generic);
             case LockPatternUtils.CREDENTIAL_TYPE_PASSWORD:
                 if (isEffectiveUserManagedProfile) {
-                    return mDevicePolicyManager.getString(WORK_PROFILE_CONFIRM_PASSWORD,
+                    return mDevicePolicyManager.getResources().getString(
+                            WORK_PROFILE_CONFIRM_PASSWORD,
                             () -> getString(
                                     R.string.lockpassword_confirm_your_password_generic_profile));
                 }
diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java b/src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java
index 9650a4d..793f600 100644
--- a/src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java
+++ b/src/com/android/settings/password/ConfirmDeviceCredentialBaseFragment.java
@@ -247,7 +247,7 @@
                     R.string.lock_last_attempt_before_wipe_warning_title);
             final String overrideMessageId = getLastTryOverrideErrorMessageId(userType);
             final int defaultMessageId = getLastTryDefaultErrorMessage(userType);
-            final String message = mDevicePolicyManager.getString(
+            final String message = mDevicePolicyManager.getResources().getString(
                     overrideMessageId, () -> getString(defaultMessageId));
             LastTryDialog.show(fragmentManager, title, message,
                     android.R.string.ok, false /* dismiss */);
@@ -279,7 +279,8 @@
             case USER_TYPE_PRIMARY:
                 return getString(R.string.lock_failed_attempts_now_wiping_device);
             case USER_TYPE_MANAGED_PROFILE:
-                return mDevicePolicyManager.getString(WORK_PROFILE_LOCK_ATTEMPTS_FAILED,
+                return mDevicePolicyManager.getResources().getString(
+                        WORK_PROFILE_LOCK_ATTEMPTS_FAILED,
                         () -> getString(R.string.lock_failed_attempts_now_wiping_profile));
             case USER_TYPE_SECONDARY:
                 return getString(R.string.lock_failed_attempts_now_wiping_user);
diff --git a/src/com/android/settings/password/ConfirmLockPassword.java b/src/com/android/settings/password/ConfirmLockPassword.java
index df7e2dd..7dcfc83 100644
--- a/src/com/android/settings/password/ConfirmLockPassword.java
+++ b/src/com/android/settings/password/ConfirmLockPassword.java
@@ -16,7 +16,6 @@
 
 package com.android.settings.password;
 
-import static android.app.admin.DevicePolicyResources.Strings.UNDEFINED;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.CONFIRM_WORK_PROFILE_PASSWORD_HEADER;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.CONFIRM_WORK_PROFILE_PIN_HEADER;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_CONFIRM_PASSWORD;
@@ -25,6 +24,7 @@
 import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_LAST_PIN_ATTEMPT_BEFORE_WIPE;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_PASSWORD_REQUIRED;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_PIN_REQUIRED;
+import static android.app.admin.DevicePolicyResources.UNDEFINED;
 
 import android.annotation.Nullable;
 import android.app.admin.DevicePolicyManager;
@@ -256,12 +256,12 @@
             }
             if (mIsManagedProfile) {
                 if (mIsAlpha) {
-                    return mDevicePolicyManager.getString(
+                    return mDevicePolicyManager.getResources().getString(
                             CONFIRM_WORK_PROFILE_PASSWORD_HEADER,
                             () -> getString(
                                     R.string.lockpassword_confirm_your_work_password_header));
                 }
-                return mDevicePolicyManager.getString(
+                return mDevicePolicyManager.getResources().getString(
                         CONFIRM_WORK_PROFILE_PIN_HEADER,
                         () -> getString(R.string.lockpassword_confirm_your_work_pin_header));
             }
@@ -278,7 +278,7 @@
             // Map boolean flags to an index by isStrongAuth << 2 + isManagedProfile << 1 + isAlpha.
             int index = ((isStrongAuthRequired ? 1 : 0) << 2) + ((mIsManagedProfile ? 1 : 0) << 1)
                     + (mIsAlpha ? 1 : 0);
-            return mDevicePolicyManager.getString(
+            return mDevicePolicyManager.getResources().getString(
                     DETAIL_TEXT_OVERRIDES[index], () -> getString(DETAIL_TEXTS[index]));
         }
 
diff --git a/src/com/android/settings/password/ConfirmLockPattern.java b/src/com/android/settings/password/ConfirmLockPattern.java
index f20a2a2..8b33aa5 100644
--- a/src/com/android/settings/password/ConfirmLockPattern.java
+++ b/src/com/android/settings/password/ConfirmLockPattern.java
@@ -16,11 +16,11 @@
 
 package com.android.settings.password;
 
-import static android.app.admin.DevicePolicyResources.Strings.UNDEFINED;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.CONFIRM_WORK_PROFILE_PATTERN_HEADER;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_CONFIRM_PATTERN;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_LAST_PATTERN_ATTEMPT_BEFORE_WIPE;
 import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROFILE_PATTERN_REQUIRED;
+import static android.app.admin.DevicePolicyResources.UNDEFINED;
 
 import android.annotation.Nullable;
 import android.annotation.SuppressLint;
@@ -271,11 +271,13 @@
             final boolean isStrongAuthRequired = isStrongAuthRequired();
             if (mIsManagedProfile) {
                 if (isStrongAuthRequired) {
-                    return mDevicePolicyManager.getString(WORK_PROFILE_PATTERN_REQUIRED,
+                    return mDevicePolicyManager.getResources().getString(
+                            WORK_PROFILE_PATTERN_REQUIRED,
                             () -> getString(
                                     R.string.lockpassword_strong_auth_required_work_pattern));
                 } else {
-                    return mDevicePolicyManager.getString(WORK_PROFILE_CONFIRM_PATTERN,
+                    return mDevicePolicyManager.getResources().getString(
+                            WORK_PROFILE_CONFIRM_PATTERN,
                             () -> getString(
                                     R.string.lockpassword_confirm_your_pattern_generic_profile));
                 }
@@ -368,7 +370,7 @@
             if (mFrp) return getString(R.string.lockpassword_confirm_your_pattern_header_frp);
 
             if (mIsManagedProfile) {
-                return mDevicePolicyManager.getString(
+                return mDevicePolicyManager.getResources().getString(
                         CONFIRM_WORK_PROFILE_PATTERN_HEADER,
                         () -> getString(R.string.lockpassword_confirm_your_work_pattern_header));
             }
diff --git a/src/com/android/settings/password/ForgotPasswordActivity.java b/src/com/android/settings/password/ForgotPasswordActivity.java
index d963a05..657139e 100644
--- a/src/com/android/settings/password/ForgotPasswordActivity.java
+++ b/src/com/android/settings/password/ForgotPasswordActivity.java
@@ -51,7 +51,7 @@
 
         DevicePolicyManager devicePolicyManager = getSystemService(DevicePolicyManager.class);
         TextView forgotPasswordText = (TextView) findViewById(R.id.forgot_password_text);
-        forgotPasswordText.setText(devicePolicyManager.getString(
+        forgotPasswordText.setText(devicePolicyManager.getResources().getString(
                 FORGOT_PASSWORD_TEXT, () -> getString(R.string.forgot_password_text)));
 
         final GlifLayout layout = findViewById(R.id.setup_wizard_layout);
diff --git a/src/com/android/settings/safetycenter/BiometricsSafetySource.java b/src/com/android/settings/safetycenter/BiometricsSafetySource.java
index 74d8e01..e6f25fc 100644
--- a/src/com/android/settings/safetycenter/BiometricsSafetySource.java
+++ b/src/com/android/settings/safetycenter/BiometricsSafetySource.java
@@ -25,6 +25,7 @@
 import android.os.UserHandle;
 import android.safetycenter.SafetyEvent;
 import android.safetycenter.SafetySourceData;
+import android.safetycenter.SafetySourceSeverity;
 import android.safetycenter.SafetySourceStatus;
 
 import com.android.settings.R;
@@ -40,7 +41,8 @@
 
     public static final String SAFETY_SOURCE_ID = "Biometrics";
 
-    private BiometricsSafetySource() {}
+    private BiometricsSafetySource() {
+    }
 
     /** Sets biometric safety data for Safety Center. */
     public static void setSafetySourceData(Context context, SafetyEvent safetyEvent) {
@@ -119,12 +121,12 @@
     private static void setBiometricSafetySourceData(Context context, String title, String summary,
             Intent clickIntent, boolean enabled, boolean hasEnrolled, SafetyEvent safetyEvent) {
         final PendingIntent pendingIntent = createPendingIntent(context, clickIntent);
-        final int statusLevel =
-                enabled && hasEnrolled ? SafetySourceStatus.STATUS_LEVEL_OK
-                        : SafetySourceStatus.STATUS_LEVEL_NONE;
+        final int severityLevel =
+                enabled && hasEnrolled ? SafetySourceSeverity.LEVEL_INFORMATION
+                        : SafetySourceSeverity.LEVEL_UNSPECIFIED;
 
-        final SafetySourceStatus status = new SafetySourceStatus.Builder(
-                title, summary, statusLevel, pendingIntent).setEnabled(enabled).build();
+        final SafetySourceStatus status = new SafetySourceStatus.Builder(title, summary,
+                severityLevel).setPendingIntent(pendingIntent).setEnabled(enabled).build();
         final SafetySourceData safetySourceData =
                 new SafetySourceData.Builder().setStatus(status).build();
 
diff --git a/src/com/android/settings/safetycenter/LockScreenSafetySource.java b/src/com/android/settings/safetycenter/LockScreenSafetySource.java
index 6cd7fa5..5e5f6d5 100644
--- a/src/com/android/settings/safetycenter/LockScreenSafetySource.java
+++ b/src/com/android/settings/safetycenter/LockScreenSafetySource.java
@@ -26,6 +26,7 @@
 import android.safetycenter.SafetyEvent;
 import android.safetycenter.SafetySourceData;
 import android.safetycenter.SafetySourceIssue;
+import android.safetycenter.SafetySourceSeverity;
 import android.safetycenter.SafetySourceStatus;
 import android.safetycenter.SafetySourceStatus.IconAction;
 
@@ -64,20 +65,26 @@
                 screenLockPreferenceDetailsUtils.getLaunchChooseLockGenericFragmentIntent());
         final IconAction gearMenuIconAction = createGearMenuIconAction(context,
                 screenLockPreferenceDetailsUtils);
+        final boolean enabled =
+                !screenLockPreferenceDetailsUtils.isPasswordQualityManaged(userId, admin);
+        final boolean isLockPatternSecure = screenLockPreferenceDetailsUtils.isLockPatternSecure();
+        final int severityLevel = enabled
+                ? isLockPatternSecure
+                        ? SafetySourceSeverity.LEVEL_INFORMATION
+                        : SafetySourceSeverity.LEVEL_RECOMMENDATION
+                : SafetySourceSeverity.LEVEL_UNSPECIFIED;
+
 
         final SafetySourceStatus status = new SafetySourceStatus.Builder(
                 context.getString(R.string.unlock_set_unlock_launch_picker_title),
                 screenLockPreferenceDetailsUtils.getSummary(UserHandle.myUserId()),
-                screenLockPreferenceDetailsUtils.isLockPatternSecure()
-                        ? SafetySourceStatus.STATUS_LEVEL_OK
-                        : SafetySourceStatus.STATUS_LEVEL_RECOMMENDATION,
-                pendingIntent)
-                .setEnabled(
-                        !screenLockPreferenceDetailsUtils.isPasswordQualityManaged(userId, admin))
+                severityLevel)
+                .setPendingIntent(pendingIntent)
+                .setEnabled(enabled)
                 .setIconAction(gearMenuIconAction).build();
         final SafetySourceData.Builder safetySourceDataBuilder =
                 new SafetySourceData.Builder().setStatus(status);
-        if (!screenLockPreferenceDetailsUtils.isLockPatternSecure()) {
+        if (enabled && !isLockPatternSecure) {
             safetySourceDataBuilder.addIssue(createNoScreenLockIssue(context, pendingIntent));
         }
         final SafetySourceData safetySourceData = safetySourceDataBuilder.build();
@@ -130,7 +137,7 @@
                 NO_SCREEN_LOCK_ISSUE_ID,
                 context.getString(R.string.no_screen_lock_issue_title),
                 context.getString(R.string.no_screen_lock_issue_summary),
-                SafetySourceIssue.SEVERITY_LEVEL_RECOMMENDATION,
+                SafetySourceSeverity.LEVEL_RECOMMENDATION,
                 NO_SCREEN_LOCK_ISSUE_TYPE_ID)
                 .setIssueCategory(SafetySourceIssue.ISSUE_CATEGORY_DEVICE)
                 .addAction(action).build();
diff --git a/src/com/android/settings/security/LockUnificationPreferenceController.java b/src/com/android/settings/security/LockUnificationPreferenceController.java
index ec7a6ed..d85d65b 100644
--- a/src/com/android/settings/security/LockUnificationPreferenceController.java
+++ b/src/com/android/settings/security/LockUnificationPreferenceController.java
@@ -192,7 +192,8 @@
      */
     public void startUnification() {
         // Confirm profile lock
-        final String title = mDpm.getString(WORK_PROFILE_SET_UNLOCK_LAUNCH_PICKER_TITLE,
+        final String title = mDpm.getResources().getString(
+                WORK_PROFILE_SET_UNLOCK_LAUNCH_PICKER_TITLE,
                 () -> mContext.getString(R.string.unlock_set_unlock_launch_picker_title_profile));
         final ChooseLockSettingsHelper.Builder builder =
                 new ChooseLockSettingsHelper.Builder(mHost.getActivity(), mHost);
diff --git a/src/com/android/settings/security/UnificationConfirmationDialog.java b/src/com/android/settings/security/UnificationConfirmationDialog.java
index 929751c..0238b0c 100644
--- a/src/com/android/settings/security/UnificationConfirmationDialog.java
+++ b/src/com/android/settings/security/UnificationConfirmationDialog.java
@@ -65,7 +65,7 @@
 
         return new AlertDialog.Builder(getActivity())
                 .setTitle(R.string.lock_settings_profile_unification_dialog_title)
-                .setMessage(getContext().getSystemService(DevicePolicyManager.class)
+                .setMessage(getContext().getSystemService(DevicePolicyManager.class).getResources()
                         .getString(overrideMessageId, () -> getString(defaultMessageId)))
                 .setPositiveButton(
                         compliant ? R.string.lock_settings_profile_unification_dialog_confirm
diff --git a/src/com/android/settings/security/screenlock/LockAfterTimeoutPreferenceController.java b/src/com/android/settings/security/screenlock/LockAfterTimeoutPreferenceController.java
index 17e7e01..180ed99 100644
--- a/src/com/android/settings/security/screenlock/LockAfterTimeoutPreferenceController.java
+++ b/src/com/android/settings/security/screenlock/LockAfterTimeoutPreferenceController.java
@@ -124,7 +124,7 @@
     private void updateLockAfterPreferenceSummary(TimeoutListPreference preference) {
         final CharSequence summary;
         if (preference.isDisabledByAdmin()) {
-            summary = mDPM.getString(DISABLED_BY_IT_ADMIN_TITLE,
+            summary = mDPM.getResources().getString(DISABLED_BY_IT_ADMIN_TITLE,
                     () -> mContext.getString(R.string.disabled_by_policy_title));
         } else {
             // Update summary message with current value
diff --git a/src/com/android/settings/users/UserDialogs.java b/src/com/android/settings/users/UserDialogs.java
index 4dcec4d..d28b798 100644
--- a/src/com/android/settings/users/UserDialogs.java
+++ b/src/com/android/settings/users/UserDialogs.java
@@ -63,13 +63,13 @@
                 .setPositiveButton(R.string.user_delete_button, onConfirmListener)
                 .setNegativeButton(android.R.string.cancel, null);
         if (userInfo.isManagedProfile()) {
-            builder.setTitle(dpm.getString(WORK_PROFILE_CONFIRM_REMOVE_TITLE,
+            builder.setTitle(dpm.getResources().getString(WORK_PROFILE_CONFIRM_REMOVE_TITLE,
                     () -> context.getString(R.string.work_profile_confirm_remove_title)));
             View view = createRemoveManagedUserDialogView(context, removingUserId);
             if (view != null) {
                 builder.setView(view);
             } else {
-                builder.setMessage(dpm.getString(WORK_PROFILE_CONFIRM_REMOVE_MESSAGE,
+                builder.setMessage(dpm.getResources().getString(WORK_PROFILE_CONFIRM_REMOVE_MESSAGE,
                         () -> context.getString(R.string.work_profile_confirm_remove_message)));
             }
         } else if (UserHandle.myUserId() == removingUserId) {
@@ -107,12 +107,14 @@
 
         TextView openingParagraph = (TextView)
                 view.findViewById(R.id.delete_managed_profile_opening_paragraph);
-        openingParagraph.setText(devicePolicyManager.getString(WORK_PROFILE_MANAGED_BY,
+        openingParagraph.setText(devicePolicyManager.getResources().getString(
+                WORK_PROFILE_MANAGED_BY,
                 () -> context.getString(
                         R.string.opening_paragraph_delete_profile_unknown_company)));
         TextView closingParagraph = (TextView)
                 view.findViewById(R.id.delete_managed_profile_closing_paragraph);
-        closingParagraph.setText(devicePolicyManager.getString(WORK_PROFILE_CONFIRM_REMOVE_MESSAGE,
+        closingParagraph.setText(devicePolicyManager.getResources().getString(
+                WORK_PROFILE_CONFIRM_REMOVE_MESSAGE,
                 () -> context.getString(R.string.work_profile_confirm_remove_message)));
 
         CharSequence appLabel = packageManager.getApplicationLabel(mdmApplicationInfo);
diff --git a/src/com/android/settings/utils/ManagedServiceSettings.java b/src/com/android/settings/utils/ManagedServiceSettings.java
index 06a8fff..a1e2b05 100644
--- a/src/com/android/settings/utils/ManagedServiceSettings.java
+++ b/src/com/android/settings/utils/ManagedServiceSettings.java
@@ -136,7 +136,8 @@
             if (managedProfileId != UserHandle.USER_NULL
                     && !mDpm.isNotificationListenerServicePermitted(
                             service.packageName, managedProfileId)) {
-                pref.setSummary(mDpm.getString(WORK_PROFILE_NOTIFICATION_LISTENER_BLOCKED,
+                pref.setSummary(mDpm.getResources().getString(
+                        WORK_PROFILE_NOTIFICATION_LISTENER_BLOCKED,
                         () -> getString(
                                 R.string.work_profile_notification_access_blocked_summary)));
             }
diff --git a/src/com/android/settings/wifi/p2p/WifiP2pSettings.java b/src/com/android/settings/wifi/p2p/WifiP2pSettings.java
index 404cdd3..5128682 100644
--- a/src/com/android/settings/wifi/p2p/WifiP2pSettings.java
+++ b/src/com/android/settings/wifi/p2p/WifiP2pSettings.java
@@ -353,6 +353,7 @@
             mWifiP2pManager.requestDeviceInfo(mChannel, WifiP2pSettings.this);
             mIsIgnoreInitConnectionInfoCallback = false;
             mWifiP2pManager.requestNetworkInfo(mChannel, networkInfo -> {
+                if (mChannel == null) return;
                 mWifiP2pManager.requestConnectionInfo(mChannel, wifip2pinfo -> {
                     if (!mIsIgnoreInitConnectionInfoCallback) {
                         if (networkInfo.isConnected()) {
diff --git a/tests/robotests/src/com/android/settings/notification/SpatialAudioParentPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/SpatialAudioParentPreferenceControllerTest.java
new file mode 100644
index 0000000..21fcea3
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/notification/SpatialAudioParentPreferenceControllerTest.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.notification;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.media.AudioManager;
+import android.media.Spatializer;
+
+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;
+
+@RunWith(RobolectricTestRunner.class)
+public class SpatialAudioParentPreferenceControllerTest {
+
+    private static final String KEY = "spatial_audio_summary";
+
+    @Mock
+    private Context mContext;
+    @Mock
+    private AudioManager mAudioManager;
+    @Mock
+    private Spatializer mSpatializer;
+
+    private SpatialAudioParentPreferenceController mController;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(RuntimeEnvironment.application);
+        when(mContext.getSystemService(AudioManager.class)).thenReturn(mAudioManager);
+        when(mAudioManager.getSpatializer()).thenReturn(mSpatializer);
+        mController = new SpatialAudioParentPreferenceController(mContext, KEY);
+    }
+
+    @Test
+    public void getAvailabilityStatus_levelNone_shouldReturnUnsupported() {
+        when(mSpatializer.getImmersiveAudioLevel()).thenReturn(
+                Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_NONE);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_levelMultiChannel_shouldReturnAvailable() {
+        when(mSpatializer.getImmersiveAudioLevel()).thenReturn(
+                Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_MULTICHANNEL);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/notification/SpatialAudioPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/SpatialAudioPreferenceControllerTest.java
index 66d18ec..e88b758 100644
--- a/tests/robotests/src/com/android/settings/notification/SpatialAudioPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/SpatialAudioPreferenceControllerTest.java
@@ -30,7 +30,6 @@
 import android.media.Spatializer;
 
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Answers;
@@ -39,7 +38,6 @@
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
 
-@Ignore("b/200896161")
 @RunWith(RobolectricTestRunner.class)
 public class SpatialAudioPreferenceControllerTest {
 
@@ -56,36 +54,36 @@
     public void setUp() {
         MockitoAnnotations.initMocks(this);
         mContext = spy(RuntimeEnvironment.application);
-        when((Object) mContext.getSystemService(AudioManager.class)).thenReturn(mAudioManager);
+        when(mContext.getSystemService(AudioManager.class)).thenReturn(mAudioManager);
         when(mAudioManager.getSpatializer()).thenReturn(mSpatializer);
-        mController = new SpatialAudioPreferenceController(mContext);
+        mController = new SpatialAudioPreferenceController(mContext, "unused");
     }
 
     @Test
-    public void getAvailabilityStatus_levelNone_shouldReturnUnsupported() {
-        when(mSpatializer.getImmersiveAudioLevel()).thenReturn(
-                Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_NONE);
+    public void getAvailabilityStatus_unavailable_shouldReturnUnavailable() {
+        when(mSpatializer.isAvailableForDevice(mController.mSpeaker)).thenReturn(false);
+
         assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
     }
 
     @Test
-    public void getAvailabilityStatus_levelMultiChannel_shouldReturnAvailable() {
-        when(mSpatializer.getImmersiveAudioLevel()).thenReturn(
-                Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_MULTICHANNEL);
+    public void getAvailabilityStatus_available_shouldReturnAvailable() {
+        when(mSpatializer.isAvailableForDevice(mController.mSpeaker)).thenReturn(true);
+
         assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
     }
 
     @Test
-    public void setChecked_withTrue_shouldEnableSpatializer() {
+    public void setChecked_withTrue_enablesDeviceSpatializer() {
         mController.setChecked(true);
 
-        verify(mSpatializer).setEnabled(true);
+        verify(mSpatializer).addCompatibleAudioDevice(mController.mSpeaker);
     }
 
     @Test
-    public void setChecked_withFalse_shouldDisableSpatializer() {
+    public void setChecked_withFalse_disablesDeviceSpatializer() {
         mController.setChecked(false);
 
-        verify(mSpatializer).setEnabled(false);
+        verify(mSpatializer).removeCompatibleAudioDevice(mController.mSpeaker);
     }
 }
diff --git a/tests/robotests/src/com/android/settings/notification/SpatialAudioWiredHeadphonesPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/SpatialAudioWiredHeadphonesPreferenceControllerTest.java
new file mode 100644
index 0000000..14d70ca
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/notification/SpatialAudioWiredHeadphonesPreferenceControllerTest.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.notification;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.media.AudioManager;
+import android.media.Spatializer;
+
+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;
+
+@RunWith(RobolectricTestRunner.class)
+public class SpatialAudioWiredHeadphonesPreferenceControllerTest {
+
+    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+    private Context mContext;
+    @Mock
+    private AudioManager mAudioManager;
+    @Mock
+    private Spatializer mSpatializer;
+
+    private SpatialAudioWiredHeadphonesController mController;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(RuntimeEnvironment.application);
+        when(mContext.getSystemService(AudioManager.class)).thenReturn(mAudioManager);
+        when(mAudioManager.getSpatializer()).thenReturn(mSpatializer);
+        mController = new SpatialAudioWiredHeadphonesController(mContext, "unused");
+    }
+
+    @Test
+    public void getAvailabilityStatus_unavailable_shouldReturnUnavailable() {
+        when(mSpatializer.isAvailableForDevice(mController.mWiredHeadphones)).thenReturn(false);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_available_shouldReturnAvailable() {
+        when(mSpatializer.isAvailableForDevice(mController.mWiredHeadphones)).thenReturn(true);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+    }
+
+    @Test
+    public void setChecked_withTrue_enablesDeviceSpatializer() {
+        mController.setChecked(true);
+
+        verify(mSpatializer).addCompatibleAudioDevice(mController.mWiredHeadphones);
+    }
+
+    @Test
+    public void setChecked_withFalse_disablesDeviceSpatializer() {
+        mController.setChecked(false);
+
+        verify(mSpatializer).removeCompatibleAudioDevice(mController.mWiredHeadphones);
+    }
+}
diff --git a/tests/unit/src/com/android/settings/safetycenter/BiometricsSafetySourceTest.java b/tests/unit/src/com/android/settings/safetycenter/BiometricsSafetySourceTest.java
index 3030f0c..765032b 100644
--- a/tests/unit/src/com/android/settings/safetycenter/BiometricsSafetySourceTest.java
+++ b/tests/unit/src/com/android/settings/safetycenter/BiometricsSafetySourceTest.java
@@ -40,6 +40,7 @@
 import android.os.UserHandle;
 import android.safetycenter.SafetyEvent;
 import android.safetycenter.SafetySourceData;
+import android.safetycenter.SafetySourceSeverity;
 import android.safetycenter.SafetySourceStatus;
 
 import androidx.test.core.app.ApplicationProvider;
@@ -427,7 +428,7 @@
     }
 
     @Test
-    public void setSafetySourceData_faceAndFingerprint_whenFaceEnrolled_setsOkStatus() {
+    public void setSafetySourceData_faceAndFingerprint_whenFaceEnrolled_setsInfoSeverity() {
         when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
         when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
         when(mFaceManager.isHardwareDetected()).thenReturn(true);
@@ -440,12 +441,12 @@
         verify(mSafetyCenterManagerWrapper).setSafetySourceData(
                 any(), eq(BiometricsSafetySource.SAFETY_SOURCE_ID), captor.capture(), any());
         SafetySourceStatus safetySourceStatus = captor.getValue().getStatus();
-        assertThat(safetySourceStatus.getStatusLevel())
-                .isEqualTo(SafetySourceStatus.STATUS_LEVEL_OK);
+        assertThat(safetySourceStatus.getSeverityLevel())
+                .isEqualTo(SafetySourceSeverity.LEVEL_INFORMATION);
     }
 
     @Test
-    public void setSafetySourceData_faceAndFingerprint_whenFingerprintEnrolled_setsOkStatus() {
+    public void setSafetySourceData_faceAndFingerprint_whenFingerprintEnrolled_setsInfoSeverity() {
         when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
         when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
         when(mFaceManager.isHardwareDetected()).thenReturn(true);
@@ -458,12 +459,12 @@
         verify(mSafetyCenterManagerWrapper).setSafetySourceData(
                 any(), eq(BiometricsSafetySource.SAFETY_SOURCE_ID), captor.capture(), any());
         SafetySourceStatus safetySourceStatus = captor.getValue().getStatus();
-        assertThat(safetySourceStatus.getStatusLevel())
-                .isEqualTo(SafetySourceStatus.STATUS_LEVEL_OK);
+        assertThat(safetySourceStatus.getSeverityLevel())
+                .isEqualTo(SafetySourceSeverity.LEVEL_INFORMATION);
     }
 
     @Test
-    public void setSafetySourceData_faceAndFingerprint_whenNotEnrolled_setsNoneStatus() {
+    public void setSafetySourceData_faceAndFingerprint_whenNotEnrolled_setsUnspSeverity() {
         when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
         when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
         when(mFaceManager.isHardwareDetected()).thenReturn(true);
@@ -476,12 +477,12 @@
         verify(mSafetyCenterManagerWrapper).setSafetySourceData(
                 any(), eq(BiometricsSafetySource.SAFETY_SOURCE_ID), captor.capture(), any());
         SafetySourceStatus safetySourceStatus = captor.getValue().getStatus();
-        assertThat(safetySourceStatus.getStatusLevel())
-                .isEqualTo(SafetySourceStatus.STATUS_LEVEL_NONE);
+        assertThat(safetySourceStatus.getSeverityLevel())
+                .isEqualTo(SafetySourceSeverity.LEVEL_UNSPECIFIED);
     }
 
     @Test
-    public void setSafetySourceData_fingerprint_whenEnrolled_setsOKStatus() {
+    public void setSafetySourceData_fingerprint_whenEnrolled_setsInfoSeverity() {
         when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
         when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
         when(mFaceManager.isHardwareDetected()).thenReturn(false);
@@ -493,12 +494,12 @@
         verify(mSafetyCenterManagerWrapper).setSafetySourceData(
                 any(), eq(BiometricsSafetySource.SAFETY_SOURCE_ID), captor.capture(), any());
         SafetySourceStatus safetySourceStatus = captor.getValue().getStatus();
-        assertThat(safetySourceStatus.getStatusLevel())
-                .isEqualTo(SafetySourceStatus.STATUS_LEVEL_OK);
+        assertThat(safetySourceStatus.getSeverityLevel())
+                .isEqualTo(SafetySourceSeverity.LEVEL_INFORMATION);
     }
 
     @Test
-    public void setSafetySourceData_fingerprint_whenNotEnrolled_setsNoneStatus() {
+    public void setSafetySourceData_fingerprint_whenNotEnrolled_setsUnspSeverity() {
         when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
         when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
         when(mFaceManager.isHardwareDetected()).thenReturn(false);
@@ -510,12 +511,12 @@
         verify(mSafetyCenterManagerWrapper).setSafetySourceData(
                 any(), eq(BiometricsSafetySource.SAFETY_SOURCE_ID), captor.capture(), any());
         SafetySourceStatus safetySourceStatus = captor.getValue().getStatus();
-        assertThat(safetySourceStatus.getStatusLevel())
-                .isEqualTo(SafetySourceStatus.STATUS_LEVEL_NONE);
+        assertThat(safetySourceStatus.getSeverityLevel())
+                .isEqualTo(SafetySourceSeverity.LEVEL_UNSPECIFIED);
     }
 
     @Test
-    public void setSafetySourceData_face_whenEnrolled_setsOKStatus() {
+    public void setSafetySourceData_face_whenEnrolled_setsInfoSeverity() {
         when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
         when(mFingerprintManager.isHardwareDetected()).thenReturn(false);
         when(mFaceManager.isHardwareDetected()).thenReturn(true);
@@ -527,12 +528,12 @@
         verify(mSafetyCenterManagerWrapper).setSafetySourceData(
                 any(), eq(BiometricsSafetySource.SAFETY_SOURCE_ID), captor.capture(), any());
         SafetySourceStatus safetySourceStatus = captor.getValue().getStatus();
-        assertThat(safetySourceStatus.getStatusLevel())
-                .isEqualTo(SafetySourceStatus.STATUS_LEVEL_OK);
+        assertThat(safetySourceStatus.getSeverityLevel())
+                .isEqualTo(SafetySourceSeverity.LEVEL_INFORMATION);
     }
 
     @Test
-    public void setSafetySourceData_face_whenNotEnrolled_setsNoneStatus() {
+    public void setSafetySourceData_face_whenNotEnrolled_setsUnspSeverity() {
         when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
         when(mFingerprintManager.isHardwareDetected()).thenReturn(false);
         when(mFaceManager.isHardwareDetected()).thenReturn(true);
@@ -544,8 +545,8 @@
         verify(mSafetyCenterManagerWrapper).setSafetySourceData(
                 any(), eq(BiometricsSafetySource.SAFETY_SOURCE_ID), captor.capture(), any());
         SafetySourceStatus safetySourceStatus = captor.getValue().getStatus();
-        assertThat(safetySourceStatus.getStatusLevel())
-                .isEqualTo(SafetySourceStatus.STATUS_LEVEL_NONE);
+        assertThat(safetySourceStatus.getSeverityLevel())
+                .isEqualTo(SafetySourceSeverity.LEVEL_UNSPECIFIED);
     }
 
     private void assertSafetySourceDisabledDataSetWithSingularSummary(String expectedTitleResName,
@@ -604,8 +605,8 @@
         assertThat(safetySourceStatus.getTitle().toString()).isEqualTo(expectedTitle);
         assertThat(safetySourceStatus.getSummary().toString()).isEqualTo(expectedSummary);
         assertThat(safetySourceStatus.isEnabled()).isFalse();
-        assertThat(safetySourceStatus.getStatusLevel())
-                .isEqualTo(SafetySourceStatus.STATUS_LEVEL_NONE);
+        assertThat(safetySourceStatus.getSeverityLevel())
+                .isEqualTo(SafetySourceSeverity.LEVEL_UNSPECIFIED);
 
         final Intent clickIntent = safetySourceStatus.getPendingIntent().getIntent();
         assertThat(clickIntent).isNotNull();
diff --git a/tests/unit/src/com/android/settings/safetycenter/LockScreenSafetySourceTest.java b/tests/unit/src/com/android/settings/safetycenter/LockScreenSafetySourceTest.java
index ea36b6b..7ecbafc 100644
--- a/tests/unit/src/com/android/settings/safetycenter/LockScreenSafetySourceTest.java
+++ b/tests/unit/src/com/android/settings/safetycenter/LockScreenSafetySourceTest.java
@@ -32,6 +32,7 @@
 import android.safetycenter.SafetyEvent;
 import android.safetycenter.SafetySourceData;
 import android.safetycenter.SafetySourceIssue;
+import android.safetycenter.SafetySourceSeverity;
 import android.safetycenter.SafetySourceStatus;
 import android.safetycenter.SafetySourceStatus.IconAction;
 
@@ -161,10 +162,12 @@
     }
 
     @Test
-    public void setSafetySourceData_whenLockPatternIsSecure_setStatusLevelOk() {
+    public void setSafetySourceData_whenPwdQualIsNotMan_whenLockPattIsSec_setStatusLevelInfo() {
         whenScreenLockIsEnabled();
         when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
         when(mScreenLockPreferenceDetailsUtils.isLockPatternSecure()).thenReturn(true);
+        when(mScreenLockPreferenceDetailsUtils.isPasswordQualityManaged(anyInt(), any()))
+                .thenReturn(false);
 
         LockScreenSafetySource.setSafetySourceData(mApplicationContext,
                 mScreenLockPreferenceDetailsUtils, EVENT_SOURCE_STATE_CHANGED);
@@ -175,15 +178,17 @@
         SafetySourceData safetySourceData = captor.getValue();
         SafetySourceStatus safetySourceStatus = safetySourceData.getStatus();
 
-        assertThat(safetySourceStatus.getStatusLevel())
-                .isEqualTo(SafetySourceStatus.STATUS_LEVEL_OK);
+        assertThat(safetySourceStatus.getSeverityLevel())
+                .isEqualTo(SafetySourceSeverity.LEVEL_INFORMATION);
     }
 
     @Test
-    public void setSafetySourceData_whenLockPatternIsNotSecure_setStatusLevelRecommendation() {
+    public void setSafetySourceData_whenPwdQualIsNotMan_whenLockPattIsNotSec_setStatusLevelRec() {
         whenScreenLockIsEnabled();
         when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
         when(mScreenLockPreferenceDetailsUtils.isLockPatternSecure()).thenReturn(false);
+        when(mScreenLockPreferenceDetailsUtils.isPasswordQualityManaged(anyInt(), any()))
+                .thenReturn(false);
 
         LockScreenSafetySource.setSafetySourceData(mApplicationContext,
                 mScreenLockPreferenceDetailsUtils, EVENT_SOURCE_STATE_CHANGED);
@@ -194,15 +199,59 @@
         SafetySourceData safetySourceData = captor.getValue();
         SafetySourceStatus safetySourceStatus = safetySourceData.getStatus();
 
-        assertThat(safetySourceStatus.getStatusLevel())
-                .isEqualTo(SafetySourceStatus.STATUS_LEVEL_RECOMMENDATION);
+        assertThat(safetySourceStatus.getSeverityLevel())
+                .isEqualTo(SafetySourceSeverity.LEVEL_RECOMMENDATION);
     }
 
     @Test
-    public void setSafetySourceData_whenLockPatternIsSecure_doesNotSetIssues() {
+    public void setSafetySourceData_whenPwdQualIsMan_whenLockPattIsSec_setStatusLevelUnsp() {
         whenScreenLockIsEnabled();
         when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
         when(mScreenLockPreferenceDetailsUtils.isLockPatternSecure()).thenReturn(true);
+        when(mScreenLockPreferenceDetailsUtils.isPasswordQualityManaged(anyInt(), any()))
+                .thenReturn(true);
+
+        LockScreenSafetySource.setSafetySourceData(mApplicationContext,
+                mScreenLockPreferenceDetailsUtils, EVENT_SOURCE_STATE_CHANGED);
+
+        ArgumentCaptor<SafetySourceData> captor = ArgumentCaptor.forClass(SafetySourceData.class);
+        verify(mSafetyCenterManagerWrapper).setSafetySourceData(
+                any(), eq(LockScreenSafetySource.SAFETY_SOURCE_ID), captor.capture(), any());
+        SafetySourceData safetySourceData = captor.getValue();
+        SafetySourceStatus safetySourceStatus = safetySourceData.getStatus();
+
+        assertThat(safetySourceStatus.getSeverityLevel())
+                .isEqualTo(SafetySourceSeverity.LEVEL_UNSPECIFIED);
+    }
+
+    @Test
+    public void setSafetySourceData_whenPwdQualIsMan_whenLockPattIsNotSec_setStatusLevelUnsp() {
+        whenScreenLockIsEnabled();
+        when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
+        when(mScreenLockPreferenceDetailsUtils.isLockPatternSecure()).thenReturn(false);
+        when(mScreenLockPreferenceDetailsUtils.isPasswordQualityManaged(anyInt(), any()))
+                .thenReturn(true);
+
+        LockScreenSafetySource.setSafetySourceData(mApplicationContext,
+                mScreenLockPreferenceDetailsUtils, EVENT_SOURCE_STATE_CHANGED);
+
+        ArgumentCaptor<SafetySourceData> captor = ArgumentCaptor.forClass(SafetySourceData.class);
+        verify(mSafetyCenterManagerWrapper).setSafetySourceData(
+                any(), eq(LockScreenSafetySource.SAFETY_SOURCE_ID), captor.capture(), any());
+        SafetySourceData safetySourceData = captor.getValue();
+        SafetySourceStatus safetySourceStatus = safetySourceData.getStatus();
+
+        assertThat(safetySourceStatus.getSeverityLevel())
+                .isEqualTo(SafetySourceSeverity.LEVEL_UNSPECIFIED);
+    }
+
+    @Test
+    public void setSafetySourceData_whenPwdQualIsNotMan_whenLockPattIsSec_doesNotSetIssues() {
+        whenScreenLockIsEnabled();
+        when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
+        when(mScreenLockPreferenceDetailsUtils.isLockPatternSecure()).thenReturn(true);
+        when(mScreenLockPreferenceDetailsUtils.isPasswordQualityManaged(anyInt(), any()))
+                .thenReturn(false);
 
         LockScreenSafetySource.setSafetySourceData(mApplicationContext,
                 mScreenLockPreferenceDetailsUtils, EVENT_SOURCE_STATE_CHANGED);
@@ -216,10 +265,12 @@
     }
 
     @Test
-    public void setSafetySourceData_whenLockPatternIsNotSecure_setsIssue() {
+    public void setSafetySourceData_whenPwdQualIsNotMan_whenLockPattIsNotSec_setsIssue() {
         whenScreenLockIsEnabled();
         when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
         when(mScreenLockPreferenceDetailsUtils.isLockPatternSecure()).thenReturn(false);
+        when(mScreenLockPreferenceDetailsUtils.isPasswordQualityManaged(anyInt(), any()))
+                .thenReturn(false);
 
         LockScreenSafetySource.setSafetySourceData(mApplicationContext,
                 mScreenLockPreferenceDetailsUtils, EVENT_SOURCE_STATE_CHANGED);
@@ -238,8 +289,7 @@
         assertThat(issue.getSummary().toString()).isEqualTo(
                 ResourcesUtils.getResourcesString(mApplicationContext,
                         "no_screen_lock_issue_summary"));
-        assertThat(issue.getSeverityLevel()).isEqualTo(
-                SafetySourceIssue.SEVERITY_LEVEL_RECOMMENDATION);
+        assertThat(issue.getSeverityLevel()).isEqualTo(SafetySourceSeverity.LEVEL_RECOMMENDATION);
         assertThat(issue.getIssueTypeId()).isEqualTo(
                 LockScreenSafetySource.NO_SCREEN_LOCK_ISSUE_TYPE_ID);
         assertThat(issue.getIssueCategory()).isEqualTo(SafetySourceIssue.ISSUE_CATEGORY_DEVICE);
@@ -254,6 +304,44 @@
     }
 
     @Test
+    public void setSafetySourceData_whenPwdQualIsMan_whenLockPattIsSec_doesNotSetIssues() {
+        whenScreenLockIsEnabled();
+        when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
+        when(mScreenLockPreferenceDetailsUtils.isLockPatternSecure()).thenReturn(true);
+        when(mScreenLockPreferenceDetailsUtils.isPasswordQualityManaged(anyInt(), any()))
+                .thenReturn(true);
+
+        LockScreenSafetySource.setSafetySourceData(mApplicationContext,
+                mScreenLockPreferenceDetailsUtils, EVENT_SOURCE_STATE_CHANGED);
+
+        ArgumentCaptor<SafetySourceData> captor = ArgumentCaptor.forClass(SafetySourceData.class);
+        verify(mSafetyCenterManagerWrapper).setSafetySourceData(
+                any(), any(), captor.capture(), any());
+        SafetySourceData safetySourceData = captor.getValue();
+
+        assertThat(safetySourceData.getIssues()).isEmpty();
+    }
+
+    @Test
+    public void setSafetySourceData_whenPwdQualIsMan_whenLockPattIsNotSec_doesNotSetIssues() {
+        whenScreenLockIsEnabled();
+        when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
+        when(mScreenLockPreferenceDetailsUtils.isLockPatternSecure()).thenReturn(false);
+        when(mScreenLockPreferenceDetailsUtils.isPasswordQualityManaged(anyInt(), any()))
+                .thenReturn(true);
+
+        LockScreenSafetySource.setSafetySourceData(mApplicationContext,
+                mScreenLockPreferenceDetailsUtils, EVENT_SOURCE_STATE_CHANGED);
+
+        ArgumentCaptor<SafetySourceData> captor = ArgumentCaptor.forClass(SafetySourceData.class);
+        verify(mSafetyCenterManagerWrapper).setSafetySourceData(
+                any(), eq(LockScreenSafetySource.SAFETY_SOURCE_ID), captor.capture(), any());
+        SafetySourceData safetySourceData = captor.getValue();
+
+        assertThat(safetySourceData.getIssues()).isEmpty();
+    }
+
+    @Test
     public void setSafetySourceData_whenPasswordQualityIsManaged_setDisabled() {
         whenScreenLockIsEnabled();
         when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);