Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +7 −2 Original line number Diff line number Diff line Loading @@ -825,8 +825,13 @@ public class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { } HdmiDeviceInfo avr = getAvrDeviceInfo(); if (avr == null) { if(mService.earcBlocksArcConnection()) { setSystemAudioMode(enabled); invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS); } else { setSystemAudioMode(false); invokeCallback(callback, HdmiControlManager.RESULT_TARGET_NOT_AVAILABLE); } return; } Loading services/core/java/com/android/server/hdmi/HdmiControlService.java +3 −0 Original line number Diff line number Diff line Loading @@ -5207,6 +5207,9 @@ public class HdmiControlService extends SystemService { // of sound when CEC is disabled and eARC is enabled due to SAM being in the off state. if (!isCecControlEnabled()) { setSystemAudioActivated(true); } else if (isTvDeviceEnabled() && tv().getAvrDeviceInfo() == null) { // The AVR might not support CEC. tv().changeSystemAudioMode(enabled, null); } getAudioManager().setWiredDeviceConnectionState(attributes, enabled ? 1 : 0); } Loading services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -1767,6 +1767,19 @@ public class HdmiCecLocalDeviceTvTest { assertThat(mNativeWrapper.getResultMessages()).contains(requestArcTermination); } @Test public void enableEarc_avrDoesNotSupportCec() { // Ensures that the code doesn't rely on any CEC interaction to enable system audio mode // when eARC is enabled. // Emulate Audio device on port 0x2000 (supports ARC and eARC) mNativeWrapper.setPortConnectionStatus(2, true); mHdmiControlService.setEarcEnabled(HdmiControlManager.EARC_FEATURE_ENABLED); mTestLooper.dispatchAll(); assertThat(mHdmiControlService.isEarcEnabled()).isTrue(); assertThat(mHdmiControlService.isSystemAudioActivated()).isTrue(); } @Test public void fromArcToEarc_SamRemainsOn() { initateSamAndValidate(); Loading Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +7 −2 Original line number Diff line number Diff line Loading @@ -825,8 +825,13 @@ public class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { } HdmiDeviceInfo avr = getAvrDeviceInfo(); if (avr == null) { if(mService.earcBlocksArcConnection()) { setSystemAudioMode(enabled); invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS); } else { setSystemAudioMode(false); invokeCallback(callback, HdmiControlManager.RESULT_TARGET_NOT_AVAILABLE); } return; } Loading
services/core/java/com/android/server/hdmi/HdmiControlService.java +3 −0 Original line number Diff line number Diff line Loading @@ -5207,6 +5207,9 @@ public class HdmiControlService extends SystemService { // of sound when CEC is disabled and eARC is enabled due to SAM being in the off state. if (!isCecControlEnabled()) { setSystemAudioActivated(true); } else if (isTvDeviceEnabled() && tv().getAvrDeviceInfo() == null) { // The AVR might not support CEC. tv().changeSystemAudioMode(enabled, null); } getAudioManager().setWiredDeviceConnectionState(attributes, enabled ? 1 : 0); } Loading
services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java +13 −0 Original line number Diff line number Diff line Loading @@ -1767,6 +1767,19 @@ public class HdmiCecLocalDeviceTvTest { assertThat(mNativeWrapper.getResultMessages()).contains(requestArcTermination); } @Test public void enableEarc_avrDoesNotSupportCec() { // Ensures that the code doesn't rely on any CEC interaction to enable system audio mode // when eARC is enabled. // Emulate Audio device on port 0x2000 (supports ARC and eARC) mNativeWrapper.setPortConnectionStatus(2, true); mHdmiControlService.setEarcEnabled(HdmiControlManager.EARC_FEATURE_ENABLED); mTestLooper.dispatchAll(); assertThat(mHdmiControlService.isEarcEnabled()).isTrue(); assertThat(mHdmiControlService.isSystemAudioActivated()).isTrue(); } @Test public void fromArcToEarc_SamRemainsOn() { initateSamAndValidate(); Loading