CEC: Let the caller check CEC device type

Device event listener mechanism invoke the callback on all kinds
of devices in order to deal with a caller who wants to get notified
for all types. TIF was changed to check the device type to make
sure it handles source type only.

Bug: 18832462
Change-Id: I5123fe79c09f623849b93b64d0c28e6a930dd437
This commit is contained in:
Jinsuk Kim
2014-12-23 07:01:51 +09:00
parent ffe80ab7f6
commit 98d760e1c3
2 changed files with 2 additions and 1 deletions

View File

@@ -1248,7 +1248,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
}
private void invokeDeviceEventListener(HdmiDeviceInfo info, int status) {
if (info.isSourceType() && !hideDevicesBehindLegacySwitch(info)) {
if (!hideDevicesBehindLegacySwitch(info)) {
mService.invokeDeviceEventListeners(info, status);
}
}

View File

@@ -1108,6 +1108,7 @@ class TvInputHardwareManager implements TvInputHal.Callback {
private final class HdmiDeviceEventListener extends IHdmiDeviceEventListener.Stub {
@Override
public void onStatusChanged(HdmiDeviceInfo deviceInfo, int status) {
if (!deviceInfo.isSourceType()) return;
synchronized (mLock) {
int messageType = 0;
Object obj = null;