Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java +2 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,8 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { if (WAKE_ON_HOTPLUG && connected) { mService.wakeUp(); } if (mService.getPortInfo(portId).getType() == HdmiPortInfo.PORT_OUTPUT) { HdmiPortInfo portInfo = mService.getPortInfo(portId); if (portInfo != null && portInfo.getType() == HdmiPortInfo.PORT_OUTPUT) { mCecMessageCache.flushAll(); if (!connected) { if (isSystemAudioActivated()) { Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceSource.java +2 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,8 @@ abstract class HdmiCecLocalDeviceSource extends HdmiCecLocalDevice { @ServiceThreadOnly void onHotplug(int portId, boolean connected) { assertRunOnServiceThread(); if (mService.getPortInfo(portId).getType() == HdmiPortInfo.PORT_OUTPUT) { HdmiPortInfo portInfo = mService.getPortInfo(portId); if (portInfo != null && portInfo.getType() == HdmiPortInfo.PORT_OUTPUT) { mCecMessageCache.flushAll(); } // We'll not invalidate the active source on the hotplug event to pass CETC 11.2.2-2 ~ 3. Loading services/core/java/com/android/server/hdmi/HdmiControlService.java +2 −1 Original line number Diff line number Diff line Loading @@ -1783,8 +1783,9 @@ public class HdmiControlService extends SystemService { // initPortInfo at hotplug event. mHdmiCecNetwork.initPortInfo(); HdmiPortInfo portInfo = getPortInfo(portId); if (connected && !isTvDevice() && getPortInfo(portId).getType() == HdmiPortInfo.PORT_OUTPUT) { && portInfo != null && portInfo.getType() == HdmiPortInfo.PORT_OUTPUT) { ArrayList<HdmiCecLocalDevice> localDevices = new ArrayList<>(); for (int type : getCecLocalDeviceTypes()) { HdmiCecLocalDevice localDevice = mHdmiCecNetwork.getLocalDevice(type); Loading services/tests/servicestests/src/com/android/server/hdmi/HdmiControlServiceTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -1706,6 +1706,15 @@ public class HdmiControlServiceTest { verify(mHdmiControlServiceSpy, times(1)).startArcAction(eq(false), any()); } @Test public void onHotplugIn_invalidPortId_noAddressAllocation() { mHdmiControlServiceSpy.onHotplug(-1, true); mTestLooper.dispatchAll(); verify(mHdmiControlServiceSpy, times(0)) .allocateLogicalAddress(any(), eq(INITIATED_BY_HOTPLUG)); } protected static class MockPlaybackDevice extends HdmiCecLocalDevicePlayback { private boolean mCanGoToStandby; Loading Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java +2 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,8 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { if (WAKE_ON_HOTPLUG && connected) { mService.wakeUp(); } if (mService.getPortInfo(portId).getType() == HdmiPortInfo.PORT_OUTPUT) { HdmiPortInfo portInfo = mService.getPortInfo(portId); if (portInfo != null && portInfo.getType() == HdmiPortInfo.PORT_OUTPUT) { mCecMessageCache.flushAll(); if (!connected) { if (isSystemAudioActivated()) { Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceSource.java +2 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,8 @@ abstract class HdmiCecLocalDeviceSource extends HdmiCecLocalDevice { @ServiceThreadOnly void onHotplug(int portId, boolean connected) { assertRunOnServiceThread(); if (mService.getPortInfo(portId).getType() == HdmiPortInfo.PORT_OUTPUT) { HdmiPortInfo portInfo = mService.getPortInfo(portId); if (portInfo != null && portInfo.getType() == HdmiPortInfo.PORT_OUTPUT) { mCecMessageCache.flushAll(); } // We'll not invalidate the active source on the hotplug event to pass CETC 11.2.2-2 ~ 3. Loading
services/core/java/com/android/server/hdmi/HdmiControlService.java +2 −1 Original line number Diff line number Diff line Loading @@ -1783,8 +1783,9 @@ public class HdmiControlService extends SystemService { // initPortInfo at hotplug event. mHdmiCecNetwork.initPortInfo(); HdmiPortInfo portInfo = getPortInfo(portId); if (connected && !isTvDevice() && getPortInfo(portId).getType() == HdmiPortInfo.PORT_OUTPUT) { && portInfo != null && portInfo.getType() == HdmiPortInfo.PORT_OUTPUT) { ArrayList<HdmiCecLocalDevice> localDevices = new ArrayList<>(); for (int type : getCecLocalDeviceTypes()) { HdmiCecLocalDevice localDevice = mHdmiCecNetwork.getLocalDevice(type); Loading
services/tests/servicestests/src/com/android/server/hdmi/HdmiControlServiceTest.java +9 −0 Original line number Diff line number Diff line Loading @@ -1706,6 +1706,15 @@ public class HdmiControlServiceTest { verify(mHdmiControlServiceSpy, times(1)).startArcAction(eq(false), any()); } @Test public void onHotplugIn_invalidPortId_noAddressAllocation() { mHdmiControlServiceSpy.onHotplug(-1, true); mTestLooper.dispatchAll(); verify(mHdmiControlServiceSpy, times(0)) .allocateLogicalAddress(any(), eq(INITIATED_BY_HOTPLUG)); } protected static class MockPlaybackDevice extends HdmiCecLocalDevicePlayback { private boolean mCanGoToStandby; Loading