Merge "CEC: Update CEC device info properly" into lmp-mr1-dev

This commit is contained in:
Jinsuk Kim
2014-12-08 15:43:33 +00:00
committed by Android (Google) Code Review

View File

@@ -1324,12 +1324,16 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
@ServiceThreadOnly @ServiceThreadOnly
final void addCecDevice(HdmiDeviceInfo info) { final void addCecDevice(HdmiDeviceInfo info) {
assertRunOnServiceThread(); assertRunOnServiceThread();
addDeviceInfo(info); HdmiDeviceInfo old = addDeviceInfo(info);
if (info.getLogicalAddress() == mAddress) { if (info.getLogicalAddress() == mAddress) {
// The addition of TV device itself should not be notified. // The addition of TV device itself should not be notified.
return; return;
} }
invokeDeviceEventListener(info, HdmiControlManager.DEVICE_EVENT_ADD_DEVICE); if (old == null) {
invokeDeviceEventListener(info, HdmiControlManager.DEVICE_EVENT_ADD_DEVICE);
} else if (!old.equals(info)) {
invokeDeviceEventListener(info, HdmiControlManager.DEVICE_EVENT_UPDATE_DEVICE);
}
} }
/** /**