Merge "CEC: Make deviceSelect work for MHL device" into lmp-mr1-dev

This commit is contained in:
Jinsuk Kim
2015-01-06 04:03:19 +00:00
committed by Android (Google) Code Review
2 changed files with 16 additions and 2 deletions

View File

@@ -326,8 +326,12 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
ActiveSource activeSource = getActiveSource(); ActiveSource activeSource = getActiveSource();
HdmiDeviceInfo info = getCecDeviceInfo(activeSource.logicalAddress); HdmiDeviceInfo info = getCecDeviceInfo(activeSource.logicalAddress);
if (info == null) { if (info == null) {
info = new HdmiDeviceInfo(Constants.ADDR_INVALID, path, getActivePortId(), info = mService.getDeviceInfoByPort(getActivePortId());
HdmiDeviceInfo.DEVICE_RESERVED, 0, null); if (info == null) {
// No CEC/MHL device is present at the port. Attempt to switch to
// the hardware port itself for non-CEC devices that may be connected.
info = new HdmiDeviceInfo(path, getActivePortId());
}
} }
mService.invokeInputChangeListener(info); mService.invokeInputChangeListener(info);
} }

View File

@@ -672,6 +672,16 @@ public final class HdmiControlService extends SystemService {
return tv() == null ? null : tv().getCecDeviceInfo(logicalAddress); return tv() == null ? null : tv().getCecDeviceInfo(logicalAddress);
} }
@ServiceThreadOnly
HdmiDeviceInfo getDeviceInfoByPort(int port) {
assertRunOnServiceThread();
HdmiMhlLocalDeviceStub info = mMhlController.getLocalDevice(port);
if (info != null) {
return info.getInfo();
}
return null;
}
/** /**
* Returns version of CEC. * Returns version of CEC.
*/ */