audio: apply volume upon hearing aid device connection

make sure hearing aid device volume is applied to music stream upon
hearing aid device connection.

Bug: 116145308
Test: repro steps in bug
Change-Id: Iccf6a78a0199c3a0b2aa80a39e7143bf715b261f
This commit is contained in:
Eric Laurent
2018-10-09 17:45:58 -07:00
parent 8c7d2142f6
commit 6ddaa111ef

View File

@@ -5923,6 +5923,9 @@ public class AudioService extends IAudioService.Stub
address));
sendMsg(mAudioHandler, MSG_ACCESSORY_PLUG_MEDIA_UNMUTE, SENDMSG_QUEUE,
AudioSystem.DEVICE_OUT_HEARING_AID, 0, null, 0);
sendMsg(mAudioHandler, MSG_SET_DEVICE_VOLUME, SENDMSG_QUEUE,
AudioSystem.DEVICE_OUT_HEARING_AID, 0,
mStreamStates[AudioSystem.STREAM_MUSIC], 0);
}
// must be called synchronized on mConnectedDevices