Loading services/core/java/com/android/server/hdmi/ActiveSourceHandler.java +4 −0 Original line number Diff line number Diff line Loading @@ -68,8 +68,12 @@ final class ActiveSourceHandler { } if (!tv.isProhibitMode()) { ActiveSource old = ActiveSource.of(tv.getActiveSource()); tv.updateActiveSource(newActive); boolean notifyInputChange = (mCallback == null); if (!old.equals(newActive)) { tv.setPrevPortId(tv.getActivePortId()); } tv.updateActiveInput(newActive.physicalAddress, notifyInputChange); invokeCallback(HdmiControlManager.RESULT_SUCCESS); } else { Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java +5 −2 Original line number Diff line number Diff line Loading @@ -71,6 +71,9 @@ abstract class HdmiCecLocalDevice { logicalAddress = logical; physicalAddress = physical; } public static ActiveSource of(ActiveSource source) { return new ActiveSource(source.logicalAddress, source.physicalAddress); } public static ActiveSource of(int logical, int physical) { return new ActiveSource(logical, physical); } Loading Loading @@ -102,10 +105,10 @@ abstract class HdmiCecLocalDevice { StringBuffer s = new StringBuffer(); String logicalAddressString = (logicalAddress == Constants.ADDR_INVALID) ? "invalid" : String.format("0x%02x", logicalAddress); s.append("logical_address: ").append(logicalAddressString); s.append("(").append(logicalAddressString); String physicalAddressString = (physicalAddress == Constants.INVALID_PHYSICAL_ADDRESS) ? "invalid" : String.format("0x%04x", physicalAddress); s.append(", physical_address: ").append(physicalAddressString); s.append(", ").append(physicalAddressString).append(")"); return s.toString(); } } Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +0 −1 Original line number Diff line number Diff line Loading @@ -343,7 +343,6 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { void updateActiveInput(int path, boolean notifyInputChange) { assertRunOnServiceThread(); // Seq #15 setPrevPortId(getActivePortId()); setActivePath(path); // TODO: Handle PAP/PIP case. // Show OSD port change banner Loading services/core/java/com/android/server/hdmi/RoutingControlAction.java +10 −4 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ final class RoutingControlAction extends HdmiCecFeatureAction { private void handleReportPowerStatus(int devicePowerStatus) { if (isPowerOnOrTransient(getTvPowerStatus())) { tv().updateActiveInput(mCurrentRoutingPath, mNotifyInputChange); updateActiveInput(); if (isPowerOnOrTransient(devicePowerStatus)) { sendSetStreamPath(); } Loading @@ -127,6 +127,12 @@ final class RoutingControlAction extends HdmiCecFeatureAction { finishWithCallback(HdmiControlManager.RESULT_SUCCESS); } private void updateActiveInput() { HdmiCecLocalDeviceTv tv = tv(); tv.setPrevPortId(tv.getActivePortId()); tv.updateActiveInput(mCurrentRoutingPath, mNotifyInputChange); } private int getTvPowerStatus() { return tv().getPowerStatus(); } Loading Loading @@ -165,13 +171,13 @@ final class RoutingControlAction extends HdmiCecFeatureAction { } }); } else { tv().updateActiveInput(mCurrentRoutingPath, mNotifyInputChange); updateActiveInput(); finishWithCallback(HdmiControlManager.RESULT_SUCCESS); } return; case STATE_WAIT_FOR_REPORT_POWER_STATUS: if (isPowerOnOrTransient(getTvPowerStatus())) { tv().updateActiveInput(mCurrentRoutingPath, mNotifyInputChange); updateActiveInput(); sendSetStreamPath(); } finishWithCallback(HdmiControlManager.RESULT_SUCCESS); Loading @@ -189,7 +195,7 @@ final class RoutingControlAction extends HdmiCecFeatureAction { mState = STATE_WAIT_FOR_REPORT_POWER_STATUS; addTimer(mState, TIMEOUT_REPORT_POWER_STATUS_MS); } else { tv().updateActiveInput(mCurrentRoutingPath, mNotifyInputChange); updateActiveInput(); sendSetStreamPath(); finishWithCallback(HdmiControlManager.RESULT_SUCCESS); } Loading Loading
services/core/java/com/android/server/hdmi/ActiveSourceHandler.java +4 −0 Original line number Diff line number Diff line Loading @@ -68,8 +68,12 @@ final class ActiveSourceHandler { } if (!tv.isProhibitMode()) { ActiveSource old = ActiveSource.of(tv.getActiveSource()); tv.updateActiveSource(newActive); boolean notifyInputChange = (mCallback == null); if (!old.equals(newActive)) { tv.setPrevPortId(tv.getActivePortId()); } tv.updateActiveInput(newActive.physicalAddress, notifyInputChange); invokeCallback(HdmiControlManager.RESULT_SUCCESS); } else { Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java +5 −2 Original line number Diff line number Diff line Loading @@ -71,6 +71,9 @@ abstract class HdmiCecLocalDevice { logicalAddress = logical; physicalAddress = physical; } public static ActiveSource of(ActiveSource source) { return new ActiveSource(source.logicalAddress, source.physicalAddress); } public static ActiveSource of(int logical, int physical) { return new ActiveSource(logical, physical); } Loading Loading @@ -102,10 +105,10 @@ abstract class HdmiCecLocalDevice { StringBuffer s = new StringBuffer(); String logicalAddressString = (logicalAddress == Constants.ADDR_INVALID) ? "invalid" : String.format("0x%02x", logicalAddress); s.append("logical_address: ").append(logicalAddressString); s.append("(").append(logicalAddressString); String physicalAddressString = (physicalAddress == Constants.INVALID_PHYSICAL_ADDRESS) ? "invalid" : String.format("0x%04x", physicalAddress); s.append(", physical_address: ").append(physicalAddressString); s.append(", ").append(physicalAddressString).append(")"); return s.toString(); } } Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +0 −1 Original line number Diff line number Diff line Loading @@ -343,7 +343,6 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { void updateActiveInput(int path, boolean notifyInputChange) { assertRunOnServiceThread(); // Seq #15 setPrevPortId(getActivePortId()); setActivePath(path); // TODO: Handle PAP/PIP case. // Show OSD port change banner Loading
services/core/java/com/android/server/hdmi/RoutingControlAction.java +10 −4 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ final class RoutingControlAction extends HdmiCecFeatureAction { private void handleReportPowerStatus(int devicePowerStatus) { if (isPowerOnOrTransient(getTvPowerStatus())) { tv().updateActiveInput(mCurrentRoutingPath, mNotifyInputChange); updateActiveInput(); if (isPowerOnOrTransient(devicePowerStatus)) { sendSetStreamPath(); } Loading @@ -127,6 +127,12 @@ final class RoutingControlAction extends HdmiCecFeatureAction { finishWithCallback(HdmiControlManager.RESULT_SUCCESS); } private void updateActiveInput() { HdmiCecLocalDeviceTv tv = tv(); tv.setPrevPortId(tv.getActivePortId()); tv.updateActiveInput(mCurrentRoutingPath, mNotifyInputChange); } private int getTvPowerStatus() { return tv().getPowerStatus(); } Loading Loading @@ -165,13 +171,13 @@ final class RoutingControlAction extends HdmiCecFeatureAction { } }); } else { tv().updateActiveInput(mCurrentRoutingPath, mNotifyInputChange); updateActiveInput(); finishWithCallback(HdmiControlManager.RESULT_SUCCESS); } return; case STATE_WAIT_FOR_REPORT_POWER_STATUS: if (isPowerOnOrTransient(getTvPowerStatus())) { tv().updateActiveInput(mCurrentRoutingPath, mNotifyInputChange); updateActiveInput(); sendSetStreamPath(); } finishWithCallback(HdmiControlManager.RESULT_SUCCESS); Loading @@ -189,7 +195,7 @@ final class RoutingControlAction extends HdmiCecFeatureAction { mState = STATE_WAIT_FOR_REPORT_POWER_STATUS; addTimer(mState, TIMEOUT_REPORT_POWER_STATUS_MS); } else { tv().updateActiveInput(mCurrentRoutingPath, mNotifyInputChange); updateActiveInput(); sendSetStreamPath(); finishWithCallback(HdmiControlManager.RESULT_SUCCESS); } Loading