Fix volume change failure in HDMI-CEC system audio mode.
In order to get volume change event, output device should not be in fixed volume device. This change ignores CEC releated outputs if system audio mode is on. Along with this, fix invalid output from getStreamForDevice as AudioPolicManager does. Bug: 17502272 Change-Id: I7d4406caea7fa6617f17969dc61aabebb87ecf7d
This commit is contained in:
@@ -666,6 +666,9 @@ public class AudioService extends IAudioService.Stub {
|
||||
if (mHdmiManager != null) {
|
||||
synchronized (mHdmiManager) {
|
||||
mHdmiTvClient = mHdmiManager.getTvClient();
|
||||
if (mHdmiTvClient != null) {
|
||||
mFixedVolumeDevices &= ~AudioSystem.DEVICE_ALL_HDMI_SYSTEM_AUDIO_AND_SPEAKER;
|
||||
}
|
||||
mHdmiPlaybackClient = mHdmiManager.getPlaybackClient();
|
||||
mHdmiCecSink = false;
|
||||
}
|
||||
@@ -3089,8 +3092,15 @@ public class AudioService extends IAudioService.Stub {
|
||||
// - one A2DP device + another device: happens with duplicated output. In this case
|
||||
// retain the device on the A2DP output as the other must not correspond to an active
|
||||
// selection if not the speaker.
|
||||
// - HDMI-CEC system audio mode only output: give priority to available item in order.
|
||||
if ((device & AudioSystem.DEVICE_OUT_SPEAKER) != 0) {
|
||||
device = AudioSystem.DEVICE_OUT_SPEAKER;
|
||||
} else if ((device & AudioSystem.DEVICE_OUT_HDMI_ARC) != 0) {
|
||||
device = AudioSystem.DEVICE_OUT_HDMI_ARC;
|
||||
} else if ((device & AudioSystem.DEVICE_OUT_SPDIF) != 0) {
|
||||
device = AudioSystem.DEVICE_OUT_SPDIF;
|
||||
} else if ((device & AudioSystem.DEVICE_OUT_AUX_LINE) != 0) {
|
||||
device = AudioSystem.DEVICE_OUT_AUX_LINE;
|
||||
} else {
|
||||
device &= AudioSystem.DEVICE_OUT_ALL_A2DP;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user