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

Skip to content
Commit 6f96eec9 authored by Yan Han's avatar Yan Han
Browse files

Add adjust-only absolute volume behavior.

Adjust-only behavior (DEVICE_VOLUME_BEHAVIOR_ABSOLUTE_ADJUST_ONLY)
is a variant of absolute behavior (DEVICE_VOLUME_BEHAVIOR_ABSOLUTE).
Like ABSOLUTE, ADJUST_ONLY may be adopted by calling a hidden API in
AudioDeviceVolumeManager and providing a listener for volume changes.

The difference with ADJUST_ONLY behavior is that setting volume via
AudioManager#setStreamVolume does not necessarily have an effect.
However, the listener is still notified of setStreamVolume calls
in case there's a slow or less reliable method of setting volume.

ADJUST_ONLY behavior may be returned by getDeviceVolumeBehavior for
SDK level U or higher. For lower SDK levels, FULL volume behavior is
returned in its place, as it is a similar but less powerful behavior.

Bug: 240663182
Test: atest AbsoluteVolumeBehaviorTest

Change-Id: I389bdd650dee717c4b249c989f4a9ee21c4eded7
parent c80109db
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