Skip to content
Commit f8f170cb authored by Kyunglyul Hyun's avatar Kyunglyul Hyun
Browse files

Handles volume for device route and bt routes.

AudioManager#getStreamVolume() is used to get volume info.
Which returns device volume or bluetooth volume according to the
current active device.

The selected route of the system media route provider can be different
from the one in AudioManager, which results in having wrong volume in
MediaRoute2Info.

This CL updates the volume of the correct media route depending on
AudioManager#getDevicesForStream.
It assumes that there are 3 volumes (device volume, bluetooth volume,
and hearing aid volume).

The limitation of this CL is that when the user transfers to a route
first time, the volume could be 0. About after 4~600ms volume info is
updated.
This seems inevitable because I couldn't find an API to get the volume
of inactive device.

Bug: 155279794
Test: manually switching between phone <-> bt route. Reboot multiple
times to check "first transfer"

Change-Id: I4edcab9e6e436801b64c9434b683ddddbbc02bef
parent f92fd5a1
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