Merge "[DO NOT MERGE] Add SHA team into Settings OWNER" into tm-qpr-dev
diff --git a/res/drawable-sw600dp/ic_settings_about_device.xml b/res/drawable-sw600dp/ic_settings_about_device.xml
new file mode 100644
index 0000000..a716482
--- /dev/null
+++ b/res/drawable-sw600dp/ic_settings_about_device.xml
@@ -0,0 +1,25 @@
+<!--
+    Copyright (C) 2023 The Android Open Source Project
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="48"
+        android:viewportHeight="48">
+    <path
+        android:pathData="M9,46q-1.25,0 -2.125,-0.875T6,43L6,5q0,-1.25 0.875,-2.125T9,2h30q1.25,0 2.125,0.875T42,5v38q0,1.25 -0.875,2.125T39,46ZM9,38.5L9,43h30v-4.5ZM19.9,41.75h8.2v-2h-8.2ZM9,35.5h30v-26L9,9.5ZM9,6.5h30L39,5L9,5ZM9,6.5L9,5v1.5ZM9,38.5L9,43Z"
+        android:fillType="evenOdd"
+        android:fillColor="?android:attr/colorPrimary"/>
+</vector>
diff --git a/res/drawable/ic_homepage_about.xml b/res/drawable/ic_homepage_about.xml
index ef2136e..459ec93 100644
--- a/res/drawable/ic_homepage_about.xml
+++ b/res/drawable/ic_homepage_about.xml
@@ -29,5 +29,5 @@
         android:height="@dimen/dashboard_tile_foreground_image_size"
         android:start="@dimen/dashboard_tile_foreground_image_inset"
         android:top="@dimen/dashboard_tile_foreground_image_inset"
-        android:drawable="@drawable/ic_phone_info" />
+        android:drawable="@drawable/ic_settings_about_device" />
 </layer-list>
diff --git a/res/drawable/ic_phone_info.xml b/res/drawable/ic_settings_about_device.xml
similarity index 100%
rename from res/drawable/ic_phone_info.xml
rename to res/drawable/ic_settings_about_device.xml
diff --git a/res/layout/sfps_enroll_find_sensor_layout.xml b/res/layout/sfps_enroll_find_sensor_layout.xml
index f08986e..b8a656e 100644
--- a/res/layout/sfps_enroll_find_sensor_layout.xml
+++ b/res/layout/sfps_enroll_find_sensor_layout.xml
@@ -29,7 +29,8 @@
         android:gravity="center_vertical"
         android:orientation="vertical"
         android:clipToPadding="false"
-        android:clipChildren="false">
+        android:clipChildren="false"
+        android:layout_marginTop="@dimen/sfps_enroll_find_sensor_lottie_margin">
 
         <!-- Animation res MUST be set in code because asset is dependent on device orientation -->
         <com.airbnb.lottie.LottieAnimationView
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index fd8c9b7..5992a61 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -529,4 +529,7 @@
     <dimen name="limited_vision_button_margin_top">0dp</dimen>
     <dimen name="limited_vision_button_margin_bottom">0dp</dimen>
     <dimen name="limited_vision_button_toggle_margin_top">0dp</dimen>
+
+    <!-- Default margin for side fps enroll find sensor lottie -->
+    <dimen name="sfps_enroll_find_sensor_lottie_margin">0dp</dimen>
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d061432..63cbfb2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1213,11 +1213,11 @@
     <!-- Message shown in fingerprint enrollment dialog to locate the sensor -->
     <string name="security_settings_fingerprint_enroll_find_sensor_message">It\u2019s on the back of your phone. Use your index finger.</string>
     <!-- Message shown in SFPS enrollment dialog to locate the sensor (tablet) [CHAR LIMIT=NONE]-->
-    <string name="security_settings_sfps_enroll_find_sensor_message" product="tablet">The fingerprint sensor is on the power button. It’s the flat button next to the raised volume button on the edge of the tablet.\n\nPressing the power button turns off the screen.</string>
+    <string name="security_settings_sfps_enroll_find_sensor_message" product="tablet">The fingerprint sensor is on the power button. It’s the flat button next to the raised volume button on the edge of the tablet.</string>
     <!-- Message shown in SFPS enrollment dialog to locate the sensor (device) [CHAR LIMIT=NONE]-->
-    <string name="security_settings_sfps_enroll_find_sensor_message" product="device">The fingerprint sensor is on the power button. It’s the flat button next to the raised volume button on the edge of the device.\n\nPressing the power button turns off the screen.</string>
+    <string name="security_settings_sfps_enroll_find_sensor_message" product="device">The fingerprint sensor is on the power button. It’s the flat button next to the raised volume button on the edge of the device.</string>
     <!-- Message shown in SFPS enrollment dialog to locate the sensor (default) [CHAR LIMIT=NONE]-->
-    <string name="security_settings_sfps_enroll_find_sensor_message" product="default">The fingerprint sensor is on the power button. It’s the flat button next to the raised volume button on the edge of the phone.\n\nPressing the power button turns off the screen.</string>
+    <string name="security_settings_sfps_enroll_find_sensor_message" product="default">The fingerprint sensor is on the power button. It’s the flat button next to the raised volume button on the edge of the phone.</string>
     <!-- Message shown in UDFPS enrollment dialog to locate the sensor [CHAR LIMIT=NONE]-->
     <string name="security_settings_udfps_enroll_find_sensor_message">The fingerprint sensor is on your screen. You\u2019ll capture your fingerprint on the next screen.</string>
     <!-- Button for starting fingerprint enrollment. [CHAR LIMIT=10]-->
diff --git a/res/xml/network_provider_internet.xml b/res/xml/network_provider_internet.xml
index 981afb3..f114dc6 100644
--- a/res/xml/network_provider_internet.xml
+++ b/res/xml/network_provider_internet.xml
@@ -52,7 +52,8 @@
         settings:userRestriction="no_config_mobile_networks"
         settings:isPreferenceVisible="@bool/config_show_sim_info"
         settings:allowDividerAbove="true"
-        settings:useAdminDisabledSummary="true" />
+        settings:useAdminDisabledSummary="true"
+        settings:searchable="@bool/config_show_sim_info"/>
 
     <com.android.settingslib.RestrictedSwitchPreference
         android:key="airplane_mode"
diff --git a/res/xml/top_level_settings.xml b/res/xml/top_level_settings.xml
index 8c82b67..d050a1f 100644
--- a/res/xml/top_level_settings.xml
+++ b/res/xml/top_level_settings.xml
@@ -196,7 +196,7 @@
 
     <com.android.settings.widget.HomepagePreference
         android:fragment="com.android.settings.deviceinfo.aboutphone.MyDeviceInfoFragment"
-        android:icon="@drawable/ic_phone_info"
+        android:icon="@drawable/ic_settings_about_device"
         android:key="top_level_about_device"
         android:order="20"
         android:title="@string/about_settings"
diff --git a/src/com/android/settings/accessibility/DisplaySizeData.java b/src/com/android/settings/accessibility/DisplaySizeData.java
index 42a8c46..77ae897 100644
--- a/src/com/android/settings/accessibility/DisplaySizeData.java
+++ b/src/com/android/settings/accessibility/DisplaySizeData.java
@@ -18,9 +18,7 @@
 
 import android.content.Context;
 import android.content.res.Resources;
-import android.view.Display;
 
-import com.android.settingslib.display.DisplayDensityConfiguration;
 import com.android.settingslib.display.DisplayDensityUtils;
 
 import java.util.Arrays;
@@ -31,11 +29,13 @@
  * Data class for storing the configurations related to the display size.
  */
 class DisplaySizeData extends PreviewSizeData<Integer> {
+    private final DisplayDensityUtils mDensity;
+
     DisplaySizeData(Context context) {
         super(context);
 
-        final DisplayDensityUtils density = new DisplayDensityUtils(getContext());
-        final int initialIndex = density.getCurrentIndex();
+        mDensity = new DisplayDensityUtils(getContext());
+        final int initialIndex = mDensity.getCurrentIndexForDefaultDisplay();
         if (initialIndex < 0) {
             // Failed to obtain default density, which means we failed to
             // connect to the window manager service. Just use the current
@@ -46,9 +46,10 @@
             setInitialIndex(0);
             setValues(Collections.singletonList(densityDpi));
         } else {
-            setDefaultValue(density.getDefaultDensity());
+            setDefaultValue(mDensity.getDefaultDensityForDefaultDisplay());
             setInitialIndex(initialIndex);
-            setValues(Arrays.stream(density.getValues()).boxed().collect(Collectors.toList()));
+            setValues(Arrays.stream(mDensity.getDefaultDisplayDensityValues()).boxed()
+                    .collect(Collectors.toList()));
         }
     }
 
@@ -56,10 +57,9 @@
     void commit(int currentProgress) {
         final int densityDpi = getValues().get(currentProgress);
         if (densityDpi == getDefaultValue()) {
-            DisplayDensityConfiguration.clearForcedDisplayDensity(Display.DEFAULT_DISPLAY);
+            mDensity.clearForcedDisplayDensity();
         } else {
-            DisplayDensityConfiguration.setForcedDisplayDensity(Display.DEFAULT_DISPLAY,
-                    densityDpi);
+            mDensity.setForcedDisplayDensity(currentProgress);
         }
     }
 }
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
index e044ab0..0b30f87 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
@@ -192,9 +192,10 @@
     @VisibleForTesting
     protected boolean shouldShowLottie() {
         DisplayDensityUtils displayDensity = new DisplayDensityUtils(getApplicationContext());
-        int currentDensityIndex = displayDensity.getCurrentIndex();
-        final int currentDensity = displayDensity.getValues()[currentDensityIndex];
-        final int defaultDensity = displayDensity.getDefaultDensity();
+        int currentDensityIndex = displayDensity.getCurrentIndexForDefaultDisplay();
+        final int currentDensity = displayDensity.getDefaultDisplayDensityValues()
+                [currentDensityIndex];
+        final int defaultDensity = displayDensity.getDefaultDensityForDefaultDisplay();
         return defaultDensity == currentDensity;
     }
 
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java b/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
index 2721c77..a1d84da 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
@@ -641,6 +641,7 @@
             if (mAuthenticateSidecar != null) {
                 mAuthenticateSidecar.setListener(null);
                 mAuthenticateSidecar.stopAuthentication();
+                mHandler.removeCallbacks(mFingerprintLockoutReset);
             }
         }
 
diff --git a/src/com/android/settings/display/ScreenResolutionFragment.java b/src/com/android/settings/display/ScreenResolutionFragment.java
index 7c4b3ae..9a61595 100644
--- a/src/com/android/settings/display/ScreenResolutionFragment.java
+++ b/src/com/android/settings/display/ScreenResolutionFragment.java
@@ -307,10 +307,11 @@
             }
 
             final DisplayDensityUtils density = new DisplayDensityUtils(mContext);
-            final int currentIndex = density.getCurrentIndex();
-            final int defaultDensity = density.getDefaultDensity();
+            final int currentIndex = density.getCurrentIndexForDefaultDisplay();
+            final int defaultDensity = density.getDefaultDensityForDefaultDisplay();
 
-            if (density.getValues()[mCurrentIndex] == density.getDefaultDensity()) {
+            if (density.getDefaultDisplayDensityValues()[mCurrentIndex]
+                    == density.getDefaultDensityForDefaultDisplay()) {
                 return;
             }
 
@@ -351,17 +352,17 @@
 
         private void restoreDensity() {
             final DisplayDensityUtils density = new DisplayDensityUtils(mContext);
-            if (density.getValues()[mCurrentIndex] != density.getDefaultDensity()) {
-                DisplayDensityUtils.setForcedDisplayDensity(
-                        Display.DEFAULT_DISPLAY, density.getValues()[mCurrentIndex]);
+            if (density.getDefaultDisplayDensityValues()[mCurrentIndex]
+                    != density.getDefaultDensityForDefaultDisplay()) {
+                density.setForcedDisplayDensity(mCurrentIndex);
             }
 
-            mDefaultDensity = density.getDefaultDensity();
+            mDefaultDensity = density.getDefaultDensityForDefaultDisplay();
         }
 
         private boolean isDensityChanged() {
             final DisplayDensityUtils density = new DisplayDensityUtils(mContext);
-            if (density.getDefaultDensity() == mDefaultDensity) {
+            if (density.getDefaultDensityForDefaultDisplay() == mDefaultDensity) {
                 return false;
             }
 
diff --git a/src/com/android/settings/display/ScreenZoomPreference.java b/src/com/android/settings/display/ScreenZoomPreference.java
index f47d7da..af77a0e 100644
--- a/src/com/android/settings/display/ScreenZoomPreference.java
+++ b/src/com/android/settings/display/ScreenZoomPreference.java
@@ -36,13 +36,13 @@
                 android.R.attr.preferenceStyle));
 
         final DisplayDensityUtils density = new DisplayDensityUtils(context);
-        final int defaultIndex = density.getCurrentIndex();
+        final int defaultIndex = density.getCurrentIndexForDefaultDisplay();
         if (defaultIndex < 0) {
             setVisible(false);
             setEnabled(false);
         } else if (TextUtils.isEmpty(getSummary())) {
-            final String[] entries = density.getEntries();
-            final int currentIndex = density.getCurrentIndex();
+            final String[] entries = density.getDefaultDisplayDensityEntries();
+            final int currentIndex = density.getCurrentIndexForDefaultDisplay();
             setSummary(entries[currentIndex]);
         }
     }
diff --git a/src/com/android/settings/display/ScreenZoomSettings.java b/src/com/android/settings/display/ScreenZoomSettings.java
index 4c46f01..ac10664 100644
--- a/src/com/android/settings/display/ScreenZoomSettings.java
+++ b/src/com/android/settings/display/ScreenZoomSettings.java
@@ -21,11 +21,9 @@
 import android.content.Context;
 import android.content.res.Configuration;
 import android.os.Bundle;
-import android.view.Display;
 
 import com.android.settings.R;
 import com.android.settings.search.BaseSearchIndexProvider;
-import com.android.settingslib.display.DisplayDensityConfiguration;
 import com.android.settingslib.display.DisplayDensityUtils;
 import com.android.settingslib.search.SearchIndexable;
 
@@ -37,6 +35,7 @@
 
     private int mDefaultDensity;
     private int[] mValues;
+    private DisplayDensityUtils mDensity;
 
     @Override
     protected int getActivityLayoutResId() {
@@ -58,9 +57,9 @@
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        final DisplayDensityUtils density = new DisplayDensityUtils(getContext());
+        mDensity = new DisplayDensityUtils(getContext());
 
-        final int initialIndex = density.getCurrentIndex();
+        final int initialIndex = mDensity.getCurrentIndexForDefaultDisplay();
         if (initialIndex < 0) {
             // Failed to obtain default density, which means we failed to
             // connect to the window manager service. Just use the current
@@ -71,10 +70,10 @@
             mInitialIndex = 0;
             mDefaultDensity = densityDpi;
         } else {
-            mValues = density.getValues();
-            mEntries = density.getEntries();
+            mValues = mDensity.getDefaultDisplayDensityValues();
+            mEntries = mDensity.getDefaultDisplayDensityEntries();
             mInitialIndex = initialIndex;
-            mDefaultDensity = density.getDefaultDensity();
+            mDefaultDensity = mDensity.getDefaultDensityForDefaultDisplay();
         }
 
         getActivity().setTitle(R.string.screen_zoom_title);
@@ -95,9 +94,9 @@
     protected void commit() {
         final int densityDpi = mValues[mCurrentIndex];
         if (densityDpi == mDefaultDensity) {
-            DisplayDensityConfiguration.clearForcedDisplayDensity(Display.DEFAULT_DISPLAY);
+            mDensity.clearForcedDisplayDensity();
         } else {
-            DisplayDensityConfiguration.setForcedDisplayDensity(Display.DEFAULT_DISPLAY, densityDpi);
+            mDensity.setForcedDisplayDensity(densityDpi);
         }
     }
 
diff --git a/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java b/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java
index 5dd4453..4f4c35d 100644
--- a/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java
+++ b/src/com/android/settings/network/telephony/cdma/CdmaSystemSelectPreferenceController.java
@@ -18,10 +18,12 @@
 
 import static com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants.NETWORK_MODE_LTE_GSM_WCDMA;
 import static com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants.NETWORK_MODE_NR_LTE_GSM_WCDMA;
+import static com.android.settings.network.telephony.TelephonyConstants.TelephonyManagerConstants.NETWORK_MODE_UNKNOWN;
 
 import android.content.Context;
 import android.provider.Settings;
 import android.telephony.TelephonyManager;
+import android.util.Log;
 
 import androidx.preference.ListPreference;
 import androidx.preference.Preference;
@@ -33,6 +35,7 @@
  */
 public class CdmaSystemSelectPreferenceController extends CdmaBasePreferenceController
         implements ListPreference.OnPreferenceChangeListener {
+    private static final String TAG = "CdmaSystemSelectPreferenceController";
 
     public CdmaSystemSelectPreferenceController(Context context, String key) {
         super(context, key);
@@ -42,23 +45,36 @@
     public void updateState(Preference preference) {
         super.updateState(preference);
         final ListPreference listPreference = (ListPreference) preference;
-        listPreference.setVisible(getAvailabilityStatus() == AVAILABLE);
-        final int mode = mTelephonyManager.getCdmaRoamingMode();
-        if (mode != TelephonyManager.CDMA_ROAMING_MODE_RADIO_DEFAULT) {
-            if (mode == TelephonyManager.CDMA_ROAMING_MODE_HOME
-                    || mode == TelephonyManager.CDMA_ROAMING_MODE_ANY) {
-                listPreference.setValue(Integer.toString(mode));
-            } else {
-                resetCdmaRoamingModeToDefault();
-            }
+        boolean isVisible = (getAvailabilityStatus() == AVAILABLE);
+        listPreference.setVisible(isVisible);
+        if (!isVisible) {
+            return;
         }
+        boolean hasTelephonyMgr = mTelephonyManager != null;
+        try {
+            final int mode =
+                    hasTelephonyMgr ? mTelephonyManager.getCdmaRoamingMode()
+                            : TelephonyManager.CDMA_ROAMING_MODE_RADIO_DEFAULT;
+            if (mode != TelephonyManager.CDMA_ROAMING_MODE_RADIO_DEFAULT) {
+                if (mode == TelephonyManager.CDMA_ROAMING_MODE_HOME
+                        || mode == TelephonyManager.CDMA_ROAMING_MODE_ANY) {
+                    listPreference.setValue(Integer.toString(mode));
+                } else {
+                    resetCdmaRoamingModeToDefault();
+                }
+            }
 
-        final int settingsNetworkMode = MobileNetworkUtils.getNetworkTypeFromRaf(
-                (int) mTelephonyManager.getAllowedNetworkTypesForReason(
-                        TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER));
-        final boolean enableList = settingsNetworkMode != NETWORK_MODE_LTE_GSM_WCDMA
-                && settingsNetworkMode != NETWORK_MODE_NR_LTE_GSM_WCDMA;
-        listPreference.setEnabled(enableList);
+            final int settingsNetworkMode =
+                    hasTelephonyMgr ? MobileNetworkUtils.getNetworkTypeFromRaf(
+                            (int) mTelephonyManager.getAllowedNetworkTypesForReason(
+                                    TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER))
+                            : NETWORK_MODE_UNKNOWN;
+            final boolean enableList = settingsNetworkMode != NETWORK_MODE_LTE_GSM_WCDMA
+                    && settingsNetworkMode != NETWORK_MODE_NR_LTE_GSM_WCDMA;
+            listPreference.setEnabled(enableList);
+        } catch (Exception exception) {
+            Log.e(TAG, "Fail to access framework API", exception);
+        }
     }
 
     @Override