Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7d419826 authored by Yan Han's avatar Yan Han
Browse files

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
parent 19a45937
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment