Merge "Use default accessibility notification sound be accessibility volume key shortcut ringtone."

This commit is contained in:
TreeHugger Robot
2023-01-18 01:02:48 +00:00
committed by Android (Google) Code Review
3 changed files with 15 additions and 3 deletions

View File

@@ -438,9 +438,18 @@ public class AccessibilityShortcutController {
? AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY
: AudioAttributes.USAGE_NOTIFICATION_EVENT;
// Use the default accessibility notification sound instead to avoid users confusing the new
// notification received. Point to the default notification sound if the sound does not
// exist.
final Uri ringtoneUri = Uri.parse("file://"
+ mContext.getString(R.string.config_defaultAccessibilityNotificationSound));
Ringtone tone = mFrameworkObjectProvider.getRingtone(mContext, ringtoneUri);
if (tone == null) {
tone = mFrameworkObjectProvider.getRingtone(mContext,
Settings.System.DEFAULT_NOTIFICATION_URI);
}
// Play a notification tone
final Ringtone tone = mFrameworkObjectProvider.getRingtone(mContext,
Settings.System.DEFAULT_NOTIFICATION_URI);
if (tone != null) {
tone.setAudioAttributes(new AudioAttributes.Builder()
.setUsage(audioAttributesUsage)

View File

@@ -4098,7 +4098,9 @@
exists on the device, the accessibility shortcut will be disabled by default. -->
<string name="config_defaultAccessibilityService" translatable="false"></string>
<!-- Flag indicates that whether escrow token API is enabled for TrustAgent -->
<!-- URI for default Accessibility notification sound when to enable accessibility shortcut. -->
<string name="config_defaultAccessibilityNotificationSound" translatable="false"></string>
<!-- Warning: This API can be dangerous when not implemented properly. In particular,
escrow token must NOT be retrievable from device storage. In other words, either
escrow token is not stored on device or its ciphertext is stored on device while

View File

@@ -3480,6 +3480,7 @@
<java-symbol type="string" name="color_correction_feature_name" />
<java-symbol type="string" name="reduce_bright_colors_feature_name" />
<java-symbol type="string" name="config_defaultAccessibilityService" />
<java-symbol type="string" name="config_defaultAccessibilityNotificationSound" />
<java-symbol type="string" name="accessibility_shortcut_spoken_feedback" />
<java-symbol type="string" name="accessibility_select_shortcut_menu_title" />