Update the exclamation icon can be announced by screen reader

* In hearing deivce and flash notifications U features.

Bug: 268144365
Test: open screen reader to read the footer preference
Change-Id: Ifb0809c1e445aea4aeea9db9b4ec09cd6d0d4095
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d6c069f..4b0eb63 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -136,6 +136,8 @@
     <string name="bluetooth_device_controls_summary">Hearing device shortcut, hearing aid compatibility</string>
     <!-- Connected devices settings. Title of the preference to show the entrance of the audio output page. It can change different types of audio are played on phone or other bluetooth devices. [CHAR LIMIT=35] -->
     <string name="bluetooth_audio_routing_title">Audio output</string>
+    <!-- Title for bluetooth audio routing page footer. [CHAR LIMIT=30] -->
+    <string name="bluetooth_audio_routing_about_title">About audio output</string>
     <!-- Connected devices settings. Summary of the preference to show the entrance of the audio output page. [CHAR LIMIT=NONE] -->
     <string name="bluetooth_audio_routing_summary">Route sounds to your hearing device or phone speaker</string>
     <!-- Title for related tools section. This section will list related tools below. [CHAR LIMIT=15] -->
@@ -4611,6 +4613,8 @@
     <string name="accessibility_hearingaid_more_device_summary"><xliff:g id="device_name" example="GN Hearing Aids">%1$s</xliff:g> +1 more</string>
     <!-- Title for the hearing device pairing preference. [CHAR LIMIT=20] -->
     <string name="accessibility_hearing_device_pairing_title">Pair new device</string>
+    <!-- Title for accessibility pair new hearing device page footer. [CHAR LIMIT=60] -->
+    <string name="accessibility_pair_hearing_device_about_title">About Pair new device</string>
     <!-- Title for the preference category containing the connected hearing device group. [CHAR LIMIT=20]-->
     <string name="accessibility_hearing_device_connected_title">Hearing devices</string>
     <!-- Title for the preference category containing the previously connected hearing device group. [CHAR LIMIT=20]-->
@@ -4623,6 +4627,8 @@
     <string name="accessibility_hac_mode_title">Hearing aid compatibility</string>
     <!--Summary for the Hearing Aid Compatibility preference in the accessibility page. [CHAR LIMIT=NONE] -->
     <string name="accessibility_hac_mode_summary">Improves compatibility with telecoils and reduces unwanted noise</string>
+    <!-- Title for accessibility hearing device page footer. [CHAR LIMIT=40] -->
+    <string name="accessibility_hearing_device_about_title">About hearing devices</string>
     <!-- Description for text in accessibility hearing aids footer. [CHAR LIMIT=NONE] -->
     <string name="accessibility_hearing_device_footer_summary">Make sure your hearing device is turned on and ready to pair</string>
     <!-- Title for the pair hearing device page. [CHAR LIMIT=25] -->
@@ -11822,8 +11828,10 @@
     <string name="accessibility_fingerprint_label">Fingerprint sensor</string>
 
     <!-- Accessibility Flash Notification -->
-    <!-- Title of the Flash Notification entry [CHAR LIMIT=NONE] -->
+    <!-- Title of the Flash Notification entry [CHAR LIMIT=35] -->
     <string name="flash_notifications_title">Flash notifications</string>
+    <!-- Title for flash notifications page footer. [CHAR LIMIT=45] -->
+    <string name="flash_notifications_about_title">About flash notifications</string>
     <!-- Summary of the Flash Notification preference if all flash alerts are off. [CHAR LIMIT=60] -->
     <string name="flash_notifications_summary_off">Off</string>
     <!-- Summary of the Flash Notification preference if only camera flash is on. [CHAR LIMIT=60] -->
diff --git a/res/xml/accessibility_hearing_aids.xml b/res/xml/accessibility_hearing_aids.xml
index 7ff571d..e813cf2 100644
--- a/res/xml/accessibility_hearing_aids.xml
+++ b/res/xml/accessibility_hearing_aids.xml
@@ -57,5 +57,6 @@
         android:key="hearing_device_footer"
         android:title="@string/accessibility_hearing_device_footer_summary"
         android:selectable="false"
-        settings:searchable="false" />
+        settings:searchable="false"
+        settings:controller="com.android.settings.accessibility.HearingDeviceFooterPreferenceController"/>
 </PreferenceScreen>
\ No newline at end of file
diff --git a/res/xml/bluetooth_audio_routing_fragment.xml b/res/xml/bluetooth_audio_routing_fragment.xml
index 854ab3f..5edf6cd 100644
--- a/res/xml/bluetooth_audio_routing_fragment.xml
+++ b/res/xml/bluetooth_audio_routing_fragment.xml
@@ -64,6 +64,7 @@
         android:key="hearing_device_footer"
         android:title="@string/bluetooth_audio_routing_footer_summary"
         android:selectable="false"
-        settings:searchable="false" />
+        settings:searchable="false"
+        settings:controller="com.android.settings.bluetooth.BluetoothDetailsAudioRoutingFooterPreferenceController"/>
 
 </PreferenceScreen>
diff --git a/res/xml/flash_notifications_settings.xml b/res/xml/flash_notifications_settings.xml
index 52f0b10..7496486 100644
--- a/res/xml/flash_notifications_settings.xml
+++ b/res/xml/flash_notifications_settings.xml
@@ -46,10 +46,11 @@
         android:title="@string/flash_notifications_preview"
         settings:controller="com.android.settings.accessibility.FlashNotificationsPreviewPreferenceController" />
 
-    <com.android.settingslib.widget.FooterPreference
+    <com.android.settings.accessibility.AccessibilityFooterPreference
         android:key="flash_notifications_footer"
-        android:selectable="false"
         android:title="@string/flash_notifications_note"
-        settings:searchable="false" />
+        android:selectable="false"
+        settings:searchable="false"
+        settings:controller="com.android.settings.accessibility.FlashNotificationsFooterPreferenceController"/>
 
 </PreferenceScreen>
diff --git a/res/xml/hearing_device_pairing_detail.xml b/res/xml/hearing_device_pairing_detail.xml
index 65cc6c72..29a6118 100644
--- a/res/xml/hearing_device_pairing_detail.xml
+++ b/res/xml/hearing_device_pairing_detail.xml
@@ -37,6 +37,7 @@
         android:key="hearing_device_footer"
         android:title="@string/accessibility_hearing_device_footer_summary"
         android:selectable="false"
-        settings:searchable="false" />
+        settings:searchable="false"
+        settings:controller="com.android.settings.accessibility.PairHearingDeviceFooterPreferenceController"/>
 
 </PreferenceScreen>
\ No newline at end of file
diff --git a/src/com/android/settings/accessibility/FlashNotificationsFooterPreferenceController.java b/src/com/android/settings/accessibility/FlashNotificationsFooterPreferenceController.java
new file mode 100644
index 0000000..0847c37
--- /dev/null
+++ b/src/com/android/settings/accessibility/FlashNotificationsFooterPreferenceController.java
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+package com.android.settings.accessibility;
+
+import android.content.Context;
+
+import com.android.settings.R;
+
+/** Preference controller for footer in flash notifications page. */
+public class FlashNotificationsFooterPreferenceController extends
+        AccessibilityFooterPreferenceController {
+    public FlashNotificationsFooterPreferenceController(Context context,
+            String key) {
+        super(context, key);
+    }
+
+    @Override
+    protected String getIntroductionTitle() {
+        return mContext.getString(R.string.flash_notifications_about_title);
+    }
+}
diff --git a/src/com/android/settings/accessibility/HearingDeviceFooterPreferenceController.java b/src/com/android/settings/accessibility/HearingDeviceFooterPreferenceController.java
new file mode 100644
index 0000000..cd92448
--- /dev/null
+++ b/src/com/android/settings/accessibility/HearingDeviceFooterPreferenceController.java
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+package com.android.settings.accessibility;
+
+import android.content.Context;
+
+import com.android.settings.R;
+
+/** Preference controller for footer in hearing device page. */
+public class HearingDeviceFooterPreferenceController extends
+        AccessibilityFooterPreferenceController {
+    public HearingDeviceFooterPreferenceController(Context context,
+            String key) {
+        super(context, key);
+    }
+
+    @Override
+    protected String getIntroductionTitle() {
+        return mContext.getString(R.string.accessibility_hearing_device_about_title);
+    }
+}
diff --git a/src/com/android/settings/accessibility/PairHearingDeviceFooterPreferenceController.java b/src/com/android/settings/accessibility/PairHearingDeviceFooterPreferenceController.java
new file mode 100644
index 0000000..09396ff
--- /dev/null
+++ b/src/com/android/settings/accessibility/PairHearingDeviceFooterPreferenceController.java
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+package com.android.settings.accessibility;
+
+import android.content.Context;
+
+import com.android.settings.R;
+
+/** Preference controller for footer in pair hearing device page. */
+public class PairHearingDeviceFooterPreferenceController extends
+        AccessibilityFooterPreferenceController {
+    public PairHearingDeviceFooterPreferenceController(Context context,
+            String key) {
+        super(context, key);
+    }
+
+    @Override
+    protected String getIntroductionTitle() {
+        return mContext.getString(R.string.accessibility_pair_hearing_device_about_title);
+    }
+}
diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsAudioRoutingFooterPreferenceController.java b/src/com/android/settings/bluetooth/BluetoothDetailsAudioRoutingFooterPreferenceController.java
new file mode 100644
index 0000000..d6bd0da
--- /dev/null
+++ b/src/com/android/settings/bluetooth/BluetoothDetailsAudioRoutingFooterPreferenceController.java
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+package com.android.settings.bluetooth;
+
+import android.content.Context;
+
+import com.android.settings.R;
+import com.android.settings.accessibility.AccessibilityFooterPreferenceController;
+
+/** Preference controller for footer in bluetooth details audio routing page. */
+public class BluetoothDetailsAudioRoutingFooterPreferenceController extends
+        AccessibilityFooterPreferenceController {
+    public BluetoothDetailsAudioRoutingFooterPreferenceController(Context context,
+            String key) {
+        super(context, key);
+    }
+
+    @Override
+    protected String getIntroductionTitle() {
+        return mContext.getString(R.string.bluetooth_audio_routing_about_title);
+    }
+}