OSDN Git Service

Fix Zen mode for different notification usage types
authorJean-Michel Trivi <jmtrivi@google.com>
Fri, 9 Sep 2016 18:56:48 +0000 (11:56 -0700)
committerJean-Michel Trivi <jmtrivi@google.com>
Fri, 9 Sep 2016 19:04:11 +0000 (12:04 -0700)
commite743bda5dec3c81ed6292c06b97b0c9f41464907
tree8c8a07aa6593d78882c5492ce3e5813c2e9060a5
parent8c83edc43b3c5c5dc5b756acd0bacb0e8348db9f
Fix Zen mode for different notification usage types

ZenModeHelper was only considering a subset of all notification usage
 types. The code was also iterating over the usage values, expecting
 them to be contiguous, which will break with the addition of new
 usage values.
The update consists in:
 - defining in AudioAttributes an array of expected usage types
 - defining the suppression behavior for each usage type
 - have ZenModeHelper query the behavior for each usage in
    order to apply the corresponding muting behavior.

Bug 29009099

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