OSDN Git Service

DnD: Total silence doesn't suppress A11y
authorJean-Michel Trivi <jmtrivi@google.com>
Tue, 20 Jun 2017 21:58:18 +0000 (14:58 -0700)
committerJean-Michel Trivi <jmtrivi@google.com>
Tue, 20 Jun 2017 22:45:14 +0000 (22:45 +0000)
commit7a84eaef3ca804bcec92a6bfbd689d79676325d7
treed52b94b1928fda38373af6f7016a68d77f98bc3f
parent07b93779ba30dd1d0350ad26d0d7e4aa36e96eb8
DnD: Total silence doesn't suppress A11y

When entering Total silence mode, text prompts from a11y were losing
 AppOpsManager.OP_PLAY_AUDIO, causing them to play muted (amplification
 of 0.0f) even though the STREAM_ACCESSIBILITY volume was not.
The fix consists in adding another category of sound suppression
 behavior in AudioAttributes, for usage types that should never be
 suppressed (== muted), and using it for USAGE_ACCESSIBILITY.
 When ZenModeHelper iterates over usages to mute/unmute players,
 consider whether that usage's suppression behavior is SUPPRESSIBLE_NEVER.

Test: turn Talkback on, then enter Total silence and verify Talkback is heard
Bug 62827456

Change-Id: I48cae48797ef9bc6bcaee82484ba078ee445345c
media/java/android/media/AudioAttributes.java
services/core/java/com/android/server/notification/ZenModeHelper.java