CEC: Update port info on hotplug events.

Update HdmiControlService#mPortInfo when hotplug events occur.

Bug: 159806029
Test: manual
Test: atest CtsHdmiCecHostTestCases
Change-Id: I590f7579dfb17d1b6ac0151829e5696966e93700
This commit is contained in:
Aravind Angadi
2021-06-25 17:37:51 +05:30
committed by Yan Han
parent b32f11ca5c
commit e73d20617e

View File

@@ -1239,13 +1239,11 @@ public class HdmiControlService extends SystemService {
@ServiceThreadOnly
void onHotplug(int portId, boolean connected) {
assertRunOnServiceThread();
// initPortInfo at hotplug event.
mHdmiCecNetwork.initPortInfo();
if (connected && !isTvDevice()
&& getPortInfo(portId).getType() == HdmiPortInfo.PORT_OUTPUT) {
if (isSwitchDevice()) {
mHdmiCecNetwork.initPortInfo();
HdmiLogger.debug("initPortInfo for switch device when onHotplug from tx.");
}
ArrayList<HdmiCecLocalDevice> localDevices = new ArrayList<>();
for (int type : mLocalDevices) {
HdmiCecLocalDevice localDevice = mHdmiCecNetwork.getLocalDevice(type);