Merge "[Regional Preference] Need to remove the metrics by the metrics concil team's comment. part2" into main
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1ef051e..dbf2c4a 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -12105,12 +12105,14 @@
 
     <!-- The title of the bluetooth audio device type selection [CHAR LIMIT=none] -->
     <string name="bluetooth_details_audio_device_types_title">Audio Device Type</string>
-    <!-- The audio device type corresponding to unknown selected [CHAR LIMIT=none] -->
+    <!-- The audio device type corresponding to unknown device type [CHAR LIMIT=none] -->
     <string name="bluetooth_details_audio_device_type_unknown">Unknown</string>
-    <!-- The audio device type corresponding to none selected [CHAR LIMIT=none] -->
-    <string name="bluetooth_details_audio_device_type_speaker">Speaker</string>
     <!-- The audio device type corresponding to speakers [CHAR LIMIT=none] -->
+    <string name="bluetooth_details_audio_device_type_speaker">Speaker</string>
+    <!-- The audio device type corresponding to headphones [CHAR LIMIT=none] -->
     <string name="bluetooth_details_audio_device_type_headphones">Headphones</string>
+    <!-- The audio device type corresponding to hearing aid [CHAR LIMIT=none] -->
+    <string name="bluetooth_details_audio_device_type_hearing_aid">Hearing Aid</string>
     <!-- The audio device type corresponding to car kit [CHAR LIMIT=none] -->
     <string name="bluetooth_details_audio_device_type_carkit">Car Kit</string>
     <!-- The audio device type corresponding to other device type [CHAR LIMIT=none] -->
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/fragment/FingerprintEnrollmentIntroV2Fragment.kt b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/fragment/FingerprintEnrollmentIntroV2Fragment.kt
index 88f8391..c7fcb66 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/fragment/FingerprintEnrollmentIntroV2Fragment.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/enrollment/fragment/FingerprintEnrollmentIntroV2Fragment.kt
@@ -128,7 +128,7 @@
                 R.id.icon_link
               )
               .forEach { icon ->
-                view.findViewById<ImageView>(icon).drawable.colorFilter = colorFilter
+                view.requireViewById<ImageView>(icon).drawable.colorFilter = colorFilter
               }
 
             // Set the text for the footer text views.
@@ -139,12 +139,12 @@
                 R.id.footer_message_5 to textModel.footerMessageFive,
                 R.id.footer_message_6 to textModel.footerMessageSix,
               )
-              .forEach { pair -> view.findViewById<TextView>(pair.first).setText(pair.second) }
+              .forEach { pair -> view.requireViewById<TextView>(pair.first).setText(pair.second) }
 
             setFooterLink(view)
 
-            val iconShield: ImageView = view.findViewById(R.id.icon_shield)
-            val footerMessage6: TextView = view.findViewById(R.id.footer_message_6)
+            val iconShield: ImageView = view.requireViewById(R.id.icon_shield)
+            val footerMessage6: TextView = view.requireViewById(R.id.footer_message_6)
             when (sensorProps?.sensorType) {
               FingerprintSensorProperties.TYPE_UDFPS_ULTRASONIC,
               FingerprintSensorProperties.TYPE_UDFPS_OPTICAL -> {
@@ -157,15 +157,15 @@
               }
             }
 
-            view.findViewById<TextView?>(R.id.footer_title_1).setText(textModel.footerTitleOne)
-            view.findViewById<TextView?>(R.id.footer_title_2).setText(textModel.footerTitleOne)
+            view.requireViewById<TextView?>(R.id.footer_title_1).setText(textModel.footerTitleOne)
+            view.requireViewById<TextView?>(R.id.footer_title_2).setText(textModel.footerTitleOne)
           }
         }
     }
   }
 
   private fun setFooterLink(view: View) {
-    val footerLink: TextView = view.findViewById(R.id.footer_learn_more)
+    val footerLink: TextView = view.requireViewById(R.id.footer_learn_more)
     footerLink.movementMethod = LinkMovementMethod.getInstance()
     footerLink.text =
       Html.fromHtml(
@@ -178,13 +178,13 @@
     view: View,
   ) {
     val scrollView: ScrollView =
-      view.findViewById(com.google.android.setupdesign.R.id.sud_scroll_view)
+      view.requireViewById(com.google.android.setupdesign.R.id.sud_scroll_view)
     scrollView.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_YES
     // Next button responsible for starting the next fragment.
     val onNextButtonClick: View.OnClickListener =
       View.OnClickListener { Log.d(TAG, "OnNextClicked") }
 
-    val layout: GlifLayout = requireActivity().findViewById(R.id.setup_wizard_layout)
+    val layout: GlifLayout = requireActivity().requireViewById(R.id.setup_wizard_layout)
     footerBarMixin = layout.getMixin(FooterBarMixin::class.java)
     footerBarMixin.primaryButton =
       FooterButton.Builder(requireActivity())
diff --git a/src/com/android/settings/biometrics/fingerprint2/ui/settings/fragment/FingerprintSettingsRenameDialog.kt b/src/com/android/settings/biometrics/fingerprint2/ui/settings/fragment/FingerprintSettingsRenameDialog.kt
index 0ebc561..84f33ff 100644
--- a/src/com/android/settings/biometrics/fingerprint2/ui/settings/fragment/FingerprintSettingsRenameDialog.kt
+++ b/src/com/android/settings/biometrics/fingerprint2/ui/settings/fragment/FingerprintSettingsRenameDialog.kt
@@ -106,8 +106,8 @@
         val dialog = FingerprintSettingsRenameDialog()
         val onClick =
           DialogInterface.OnClickListener { _, _ ->
-            val dialogTextField =
-              dialog.requireDialog().findViewById(R.id.fingerprint_rename_field) as ImeAwareEditText
+            val dialogTextField = dialog.requireDialog()
+                .requireViewById(R.id.fingerprint_rename_field) as ImeAwareEditText
             val newName = dialogTextField.text.toString()
             if (!TextUtils.equals(newName, fp.name)) {
               Log.d(TAG, "rename $fp.name to $newName for $dialog")
diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsAudioDeviceTypeController.java b/src/com/android/settings/bluetooth/BluetoothDetailsAudioDeviceTypeController.java
index ba5f465..fe0d141 100644
--- a/src/com/android/settings/bluetooth/BluetoothDetailsAudioDeviceTypeController.java
+++ b/src/com/android/settings/bluetooth/BluetoothDetailsAudioDeviceTypeController.java
@@ -19,6 +19,7 @@
 import static android.bluetooth.BluetoothDevice.DEVICE_TYPE_LE;
 import static android.media.AudioManager.AUDIO_DEVICE_CATEGORY_CARKIT;
 import static android.media.AudioManager.AUDIO_DEVICE_CATEGORY_HEADPHONES;
+import static android.media.AudioManager.AUDIO_DEVICE_CATEGORY_HEARING_AID;
 import static android.media.AudioManager.AUDIO_DEVICE_CATEGORY_OTHER;
 import static android.media.AudioManager.AUDIO_DEVICE_CATEGORY_SPEAKER;
 import static android.media.AudioManager.AUDIO_DEVICE_CATEGORY_UNKNOWN;
@@ -149,6 +150,7 @@
                 mContext.getString(R.string.bluetooth_details_audio_device_type_speaker),
                 mContext.getString(R.string.bluetooth_details_audio_device_type_headphones),
                 mContext.getString(R.string.bluetooth_details_audio_device_type_carkit),
+                mContext.getString(R.string.bluetooth_details_audio_device_type_hearing_aid),
                 mContext.getString(R.string.bluetooth_details_audio_device_type_other),
         });
         mAudioDeviceTypePreference.setEntryValues(new CharSequence[]{
@@ -156,6 +158,7 @@
                 Integer.toString(AUDIO_DEVICE_CATEGORY_SPEAKER),
                 Integer.toString(AUDIO_DEVICE_CATEGORY_HEADPHONES),
                 Integer.toString(AUDIO_DEVICE_CATEGORY_CARKIT),
+                Integer.toString(AUDIO_DEVICE_CATEGORY_HEARING_AID),
                 Integer.toString(AUDIO_DEVICE_CATEGORY_OTHER),
         });
 
diff --git a/src/com/android/settings/core/FeatureFlags.java b/src/com/android/settings/core/FeatureFlags.java
index 1a97ca9..fb552d7 100644
--- a/src/com/android/settings/core/FeatureFlags.java
+++ b/src/com/android/settings/core/FeatureFlags.java
@@ -30,4 +30,6 @@
     public static final String CONTEXTUAL_HOME = "settings_contextual_home";
     public static final String SETTINGS_SEARCH_ALWAYS_EXPAND =
             "settings_search_always_expand";
+    public static final String PRESS_HOLD_NAV_HANDLE_TO_SEARCH =
+            "settings_press_hold_nav_handle_to_search";
 }
diff --git a/src/com/android/settings/gestures/SystemNavigationPreferenceController.java b/src/com/android/settings/gestures/SystemNavigationPreferenceController.java
index ab83a9d..ccdb257 100644
--- a/src/com/android/settings/gestures/SystemNavigationPreferenceController.java
+++ b/src/com/android/settings/gestures/SystemNavigationPreferenceController.java
@@ -52,7 +52,8 @@
         }
     }
 
-    static boolean isGestureAvailable(Context context) {
+    /** Returns {@code true} if gesture is available. */
+    public static boolean isGestureAvailable(Context context) {
         // Skip if the swipe up settings are not available
         if (!context.getResources().getBoolean(
                 com.android.internal.R.bool.config_swipe_up_gesture_setting_available)) {
diff --git a/src/com/android/settings/remoteauth/enrolling/RemoteAuthEnrollEnrolling.kt b/src/com/android/settings/remoteauth/enrolling/RemoteAuthEnrollEnrolling.kt
index 4569760..dcb81c7 100644
--- a/src/com/android/settings/remoteauth/enrolling/RemoteAuthEnrollEnrolling.kt
+++ b/src/com/android/settings/remoteauth/enrolling/RemoteAuthEnrollEnrolling.kt
@@ -42,11 +42,11 @@
     private val viewModel = RemoteAuthEnrollEnrollingViewModel()
     private val adapter = RemoteAuthEnrollEnrollingRecyclerViewAdapter()
     private val progressBar by lazy {
-        view!!.findViewById<ProgressBar>(R.id.enrolling_list_progress_bar)
+        view!!.requireViewById<ProgressBar>(R.id.enrolling_list_progress_bar)
     }
-    private val errorText by lazy { view!!.findViewById<TextView>(R.id.error_text) }
+    private val errorText by lazy { view!!.requireViewById<TextView>(R.id.error_text) }
     private val recyclerView by lazy {
-        view!!.findViewById<RecyclerView>(R.id.discovered_authenticator_list)
+        view!!.requireViewById<RecyclerView>(R.id.discovered_authenticator_list)
     }
 
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@@ -124,4 +124,4 @@
             errorText.text = ""
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/com/android/settings/remoteauth/enrolling/RemoteAuthEnrollEnrollingRecyclerViewAdapter.kt b/src/com/android/settings/remoteauth/enrolling/RemoteAuthEnrollEnrollingRecyclerViewAdapter.kt
index 81b8801..323c41f 100644
--- a/src/com/android/settings/remoteauth/enrolling/RemoteAuthEnrollEnrollingRecyclerViewAdapter.kt
+++ b/src/com/android/settings/remoteauth/enrolling/RemoteAuthEnrollEnrollingRecyclerViewAdapter.kt
@@ -46,8 +46,8 @@
     override fun getItemCount() = uiStates.size
 
     class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
-        private val titleTextView: TextView = view.findViewById(R.id.discovered_authenticator_name)
-        private val selectButton: ImageView = view.findViewById(R.id.authenticator_radio_button)
+        private val titleTextView: TextView = view.requireViewById(R.id.discovered_authenticator_name)
+        private val selectButton: ImageView = view.requireViewById(R.id.authenticator_radio_button)
         private val checkedDrawable =
             view.context.getDrawable(R.drawable.ic_radio_button_checked_black_24dp)
         private val uncheckedDrawable =
@@ -63,4 +63,4 @@
             selectButton.setOnClickListener { discoveredAuthenticatorUiState.onSelect() }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/com/android/settings/remoteauth/settings/RemoteAuthSettings.kt b/src/com/android/settings/remoteauth/settings/RemoteAuthSettings.kt
index ebf13f8..93711bf 100644
--- a/src/com/android/settings/remoteauth/settings/RemoteAuthSettings.kt
+++ b/src/com/android/settings/remoteauth/settings/RemoteAuthSettings.kt
@@ -34,11 +34,11 @@
     val viewModel = RemoteAuthSettingsViewModel()
     private val adapter = RemoteAuthSettingsRecyclerViewAdapter()
     private val recyclerView by lazy {
-        view!!.findViewById<RecyclerView>(R.id.registered_authenticator_list)
+        view!!.requireViewById<RecyclerView>(R.id.registered_authenticator_list)
     }
 
     private val addAuthenticatorLayout by lazy {
-        view!!.findViewById<ConstraintLayout>(R.id.add_authenticator_layout)
+        view!!.requireViewById<ConstraintLayout>(R.id.add_authenticator_layout)
     }
 
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@@ -65,4 +65,4 @@
         adapter.uiStates = uiState.registeredAuthenticatorUiStates
     }
 
-}
\ No newline at end of file
+}
diff --git a/src/com/android/settings/remoteauth/settings/RemoteAuthSettingsRecyclerViewAdapter.kt b/src/com/android/settings/remoteauth/settings/RemoteAuthSettingsRecyclerViewAdapter.kt
index f506a0b..f8038bd 100644
--- a/src/com/android/settings/remoteauth/settings/RemoteAuthSettingsRecyclerViewAdapter.kt
+++ b/src/com/android/settings/remoteauth/settings/RemoteAuthSettingsRecyclerViewAdapter.kt
@@ -46,12 +46,12 @@
     override fun getItemCount() = uiStates.size
 
     class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
-        private val titleTextView: TextView = view.findViewById(R.id.authenticator_name_text)
-        private val unregisterButton: ImageView = view.findViewById(R.id.remove_icon)
+        private val titleTextView: TextView = view.requireViewById(R.id.authenticator_name_text)
+        private val unregisterButton: ImageView = view.requireViewById(R.id.remove_icon)
 
         fun bind(authenticatorUiState: RemoteAuthAuthenticatorItemUiState) {
             titleTextView.text = authenticatorUiState.name
             unregisterButton.setOnClickListener { authenticatorUiState.unregister() }
         }
     }
-}
\ No newline at end of file
+}