From 7be7ef9eccf1974398dda25ccb3ac17aaf9ec4f4 Mon Sep 17 00:00:00 2001 From: jasonwshsu Date: Wed, 15 Mar 2023 19:43:58 +0800 Subject: [PATCH] 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 --- res/values/strings.xml | 10 +++++- res/xml/accessibility_hearing_aids.xml | 3 +- res/xml/bluetooth_audio_routing_fragment.xml | 3 +- res/xml/flash_notifications_settings.xml | 7 ++-- res/xml/hearing_device_pairing_detail.xml | 3 +- ...tificationsFooterPreferenceController.java | 35 ++++++++++++++++++ ...aringDeviceFooterPreferenceController.java | 35 ++++++++++++++++++ ...aringDeviceFooterPreferenceController.java | 35 ++++++++++++++++++ ...udioRoutingFooterPreferenceController.java | 36 +++++++++++++++++++ 9 files changed, 160 insertions(+), 7 deletions(-) create mode 100644 src/com/android/settings/accessibility/FlashNotificationsFooterPreferenceController.java create mode 100644 src/com/android/settings/accessibility/HearingDeviceFooterPreferenceController.java create mode 100644 src/com/android/settings/accessibility/PairHearingDeviceFooterPreferenceController.java create mode 100644 src/com/android/settings/bluetooth/BluetoothDetailsAudioRoutingFooterPreferenceController.java diff --git a/res/values/strings.xml b/res/values/strings.xml index d6c069f62c6..4b0eb63b23e 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -136,6 +136,8 @@ Hearing device shortcut, hearing aid compatibility Audio output + + About audio output Route sounds to your hearing device or phone speaker @@ -4611,6 +4613,8 @@ %1$s +1 more Pair new device + + About Pair new device Hearing devices @@ -4623,6 +4627,8 @@ Hearing aid compatibility Improves compatibility with telecoils and reduces unwanted noise + + About hearing devices Make sure your hearing device is turned on and ready to pair @@ -11822,8 +11828,10 @@ Fingerprint sensor - + Flash notifications + + About flash notifications Off diff --git a/res/xml/accessibility_hearing_aids.xml b/res/xml/accessibility_hearing_aids.xml index 7ff571d7fe9..e813cf2b47d 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"/> \ 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 854ab3f2b41..5edf6cdca41 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"/> diff --git a/res/xml/flash_notifications_settings.xml b/res/xml/flash_notifications_settings.xml index 52f0b103031..749648614ae 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" /> - + android:selectable="false" + settings:searchable="false" + settings:controller="com.android.settings.accessibility.FlashNotificationsFooterPreferenceController"/> diff --git a/res/xml/hearing_device_pairing_detail.xml b/res/xml/hearing_device_pairing_detail.xml index 65cc6c72a13..29a611879a7 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"/> \ 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 00000000000..0847c37aa1a --- /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 00000000000..cd92448392a --- /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 00000000000..09396ffd50d --- /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 00000000000..d6bd0da43ff --- /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); + } +}