AudioService: Add general support for Absolute Volume behavior
- Adds a map to store information about audio devices using absolute
volume behavior. The map is updated when devices change behavior.
- setStreamVolume and adjustStreamVolume now notify absolute volume
listeners after changing the stream state.
- Added option for absolute volume dispatcher to dispatch abstract
volume adjustments (e.g. raise, lower, mute) as a result of calls to
adjustStreamVolume. When registering the listener, the controller
specifies whether it handles adjustments; if it does, future calls to
adjustStreamVolume are forwarded to the controller without affecting
stream state.
- Refactoring to support the changes above:
- rescaleIndex is generalized to allow converting between stream and
absolute volume ranges.
- Volume adjustment mode constants are moved into
AudioDeviceVolumeManager because they are needed when dispatching
volume adjustments to absolute volume controllers.
Bug: 205817863
Test: atest AbsoluteVolumeBehaviorTest
Change-Id: Ie5fb2179adea2096bd2d226fe73b4f09b28b0cf1
6 files changed