Merge "[Catalyst] Add flag for Tether screen 25q3 release" into main
diff --git a/aconfig/catalyst/display.aconfig b/aconfig/catalyst/display.aconfig
index f321708..e3bc82c 100644
--- a/aconfig/catalyst/display.aconfig
+++ b/aconfig/catalyst/display.aconfig
@@ -9,6 +9,13 @@
 }
 
 flag {
+  name: "catalyst_display_settings_screen_25q3"
+  namespace: "android_settings"
+  description: "Flag for Display in 25Q3"
+  bug: "352179685"
+}
+
+flag {
   name: "catalyst_screen_timeout"
   namespace: "android_settings"
   description: "Flag for Screen Timeout settings"
@@ -35,3 +42,31 @@
   description: "Flag for Adaptive brightness"
   bug: "323791114"
 }
+
+flag {
+  name: "catalyst_night_display"
+  namespace: "android_settings"
+  description: "Flag for Night Light in 25Q3"
+  bug: "352179685"
+}
+
+flag {
+  name: "catalyst_color_mode"
+  namespace: "android_settings"
+  description: "Flag for Colors in 25Q3"
+  bug: "352179685"
+}
+
+flag {
+  name: "catalyst_gesture_system_navigation_input_summary"
+  namespace: "android_settings"
+  description: "Flag for Navigation mode in 25Q3"
+  bug: "352179685"
+}
+
+flag {
+  name: "catalyst_screen_resolution"
+  namespace: "android_settings"
+  description: "Flag for Screen resolution in 25Q3"
+  bug: "352179685"
+}
diff --git a/src/com/android/settings/bluetooth/HearingDeviceInputRoutingPreference.java b/src/com/android/settings/bluetooth/HearingDeviceInputRoutingPreference.java
index 2d09f61..e1e1294 100644
--- a/src/com/android/settings/bluetooth/HearingDeviceInputRoutingPreference.java
+++ b/src/com/android/settings/bluetooth/HearingDeviceInputRoutingPreference.java
@@ -80,7 +80,7 @@
         setDialogTitle(R.string.bluetooth_hearing_device_input_routing_dialog_title);
         setDialogLayoutResource(R.layout.hearing_device_input_routing_dialog);
         setNegativeButtonText(R.string.cancel);
-        setPositiveButtonText(R.string.done_button);
+        setPositiveButtonText(R.string.done);
     }
 
     /**
diff --git a/src/com/android/settings/localepicker/LocaleListEditor.java b/src/com/android/settings/localepicker/LocaleListEditor.java
index 2f8d203..87deea1 100644
--- a/src/com/android/settings/localepicker/LocaleListEditor.java
+++ b/src/com/android/settings/localepicker/LocaleListEditor.java
@@ -529,7 +529,11 @@
             @Nullable Locale defaultLocaleBeforeRemoval) {
         Locale currentSystemLocale = LocalePicker.getLocales().get(0);
         if (!localeInfo.getLocale().equals(currentSystemLocale)) {
-            displayDialogFragment(localeInfo, true);
+            if (Locale.getDefault().equals(localeInfo.getLocale())) {
+                mAdapter.doTheUpdate();
+            } else {
+                displayDialogFragment(localeInfo, true);
+            }
         } else {
             if (!localeInfo.isTranslated()) {
                 if (defaultLocaleBeforeRemoval == null) {
diff --git a/src/com/android/settings/regionalpreferences/RegionPickerBaseListPreferenceController.java b/src/com/android/settings/regionalpreferences/RegionPickerBaseListPreferenceController.java
index fc12d1b..5768421 100644
--- a/src/com/android/settings/regionalpreferences/RegionPickerBaseListPreferenceController.java
+++ b/src/com/android/settings/regionalpreferences/RegionPickerBaseListPreferenceController.java
@@ -18,7 +18,6 @@
 
 import android.content.Context;
 import android.os.Bundle;
-import android.os.LocaleList;
 import android.util.Log;
 
 import androidx.annotation.NonNull;
@@ -92,7 +91,7 @@
                     ? getSuggestedLocaleList()
                     : getSupportedLocaleList();
         if (getPreferenceCategoryKey().contains(KEY_SUGGESTED)) {
-            Locale systemLocale = LocaleList.getDefault().get(0);
+            Locale systemLocale = Locale.getDefault();
             LocaleStore.LocaleInfo localeInfo = LocaleStore.getLocaleInfo(systemLocale);
             result.add(localeInfo);
         }
@@ -106,7 +105,7 @@
             mPreferenceCategory.addPreference(pref);
             pref.setTitle(locale.getFullCountryNameNative());
             pref.setKey(locale.toString());
-            if (locale.getLocale().equals(LocaleList.getDefault().get(0))) {
+            if (locale.getLocale().equals(Locale.getDefault())) {
                 pref.setChecked(true);
             } else {
                 pref.setChecked(false);
@@ -154,7 +153,7 @@
 
     private List<LocaleStore.LocaleInfo> getSortedLocaleList(
             List<LocaleStore.LocaleInfo> localeInfos) {
-        final Locale sortingLocale = LocaleList.getDefault().get(0);
+        final Locale sortingLocale = Locale.getDefault();
         final LocaleHelper.LocaleInfoComparator comp =
                 new LocaleHelper.LocaleInfoComparator(sortingLocale, true);
         Collections.sort(localeInfos, comp);
@@ -162,7 +161,7 @@
     }
 
     private void switchRegion(LocaleStore.LocaleInfo localeInfo) {
-        if (localeInfo.getLocale().equals(LocaleList.getDefault().get(0))) {
+        if (localeInfo.getLocale().equals(Locale.getDefault())) {
             return;
         }
 
diff --git a/src/com/android/settings/regionalpreferences/RegionPickerFragment.java b/src/com/android/settings/regionalpreferences/RegionPickerFragment.java
index c064565..cf4d9b9 100644
--- a/src/com/android/settings/regionalpreferences/RegionPickerFragment.java
+++ b/src/com/android/settings/regionalpreferences/RegionPickerFragment.java
@@ -19,7 +19,6 @@
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.os.Bundle;
-import android.os.LocaleList;
 import android.provider.Settings;
 
 import androidx.annotation.NonNull;
@@ -84,7 +83,7 @@
 
     private List<AbstractPreferenceController> buildPreferenceControllers(
             @NonNull Context context) {
-        Locale parentLocale = LocaleStore.getLocaleInfo(LocaleList.getDefault().get(0)).getParent();
+        Locale parentLocale = LocaleStore.getLocaleInfo(Locale.getDefault()).getParent();
         LocaleStore.LocaleInfo parentLocaleInfo = LocaleStore.getLocaleInfo(parentLocale);
         SystemRegionSuggestedListPreferenceController mSuggestedListPreferenceController =
                 new SystemRegionSuggestedListPreferenceController(
diff --git a/src/com/android/settings/regionalpreferences/RegionPreferenceController.java b/src/com/android/settings/regionalpreferences/RegionPreferenceController.java
index 345bd75..a9ce120 100644
--- a/src/com/android/settings/regionalpreferences/RegionPreferenceController.java
+++ b/src/com/android/settings/regionalpreferences/RegionPreferenceController.java
@@ -17,7 +17,6 @@
 package com.android.settings.regionalpreferences;
 
 import android.content.Context;
-import android.os.LocaleList;
 
 import androidx.annotation.NonNull;
 import androidx.preference.Preference;
@@ -27,6 +26,8 @@
 import com.android.settings.core.BasePreferenceController;
 import com.android.settings.flags.Flags;
 
+import java.util.Locale;
+
 /** A controller for the entry of region picker page */
 public class RegionPreferenceController extends BasePreferenceController {
 
@@ -39,7 +40,7 @@
         super.displayPreference(screen);
         Preference preference = screen.findPreference(getPreferenceKey());
         LocaleStore.LocaleInfo localeInfo = LocaleStore.getLocaleInfo(
-                LocaleList.getDefault().get(0));
+                Locale.getDefault());
         preference.setSummary(localeInfo.getFullCountryNameNative());
     }
 
diff --git a/tests/robotests/src/com/android/settings/localepicker/LocaleListEditorTest.java b/tests/robotests/src/com/android/settings/localepicker/LocaleListEditorTest.java
index 22d39e3..5f5b8f6 100644
--- a/tests/robotests/src/com/android/settings/localepicker/LocaleListEditorTest.java
+++ b/tests/robotests/src/com/android/settings/localepicker/LocaleListEditorTest.java
@@ -275,6 +275,7 @@
     public void showConfirmDialog_systemLocaleSelected_shouldShowLocaleChangeDialog()
             throws Exception {
         //pre-condition
+        Locale.setDefault(Locale.forLanguageTag("zh-TW"));
         setUpLocaleConditions(true);
         final Configuration config = new Configuration();
         config.setLocales((LocaleList.forLanguageTags("zh-TW,en-US")));
@@ -379,6 +380,7 @@
     @Test
     public void onTouch_dragDifferentLocaleToTop_showConfirmDialog() throws Exception {
         MotionEvent event = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_UP, 0.0f, 0.0f, 0);
+        Locale.setDefault(Locale.forLanguageTag("zh-TW"));
         setUpLocaleConditions(true);
         final Configuration config = new Configuration();
         config.setLocales((LocaleList.forLanguageTags("zh-TW,en-US")));