diff options
author | Jinsuk Kim <jinsukkim@google.com> | 2015-01-29 22:21:53 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-01-29 22:21:54 +0000 |
commit | 3f923474248e24706e7977a7512b0a35cff835a7 (patch) | |
tree | abcd115457a0ff43adaaee8d377c6668f27391a1 /services/core/java/com/android/server/hdmi | |
parent | af461e12a12dba8fc544fa373831368ba2c18096 (diff) | |
parent | 7cd4a589af7cc6e6880799e86ef6febca5add46d (diff) | |
download | frameworks_base-3f923474248e24706e7977a7512b0a35cff835a7.zip frameworks_base-3f923474248e24706e7977a7512b0a35cff835a7.tar.gz frameworks_base-3f923474248e24706e7977a7512b0a35cff835a7.tar.bz2 |
Merge "CEC: Add CEC device upon receiving <Report Physical Address>" into lmp-mr1-dev
Diffstat (limited to 'services/core/java/com/android/server/hdmi')
-rw-r--r-- | services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java | 8 | ||||
-rw-r--r-- | services/core/java/com/android/server/hdmi/NewDeviceAction.java | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java index 664f541..5c1c5bb 100644 --- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java @@ -581,6 +581,12 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { if (!isInDeviceList(address, path)) { handleNewDeviceAtTheTailOfActivePath(path); } + + // Add the device ahead with default information to handle <Active Source> + // promptly, rather than waiting till the new device action is finished. + HdmiDeviceInfo deviceInfo = new HdmiDeviceInfo(address, path, getPortId(path), type, + Constants.UNKNOWN_VENDOR_ID, HdmiUtils.getDefaultDeviceName(address)); + addCecDevice(deviceInfo); startNewDeviceAction(ActiveSource.of(address, path), type); return true; } @@ -1496,7 +1502,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { * @return true if exist; otherwise false */ @ServiceThreadOnly - private boolean isInDeviceList(int logicalAddress, int physicalAddress) { + boolean isInDeviceList(int logicalAddress, int physicalAddress) { assertRunOnServiceThread(); HdmiDeviceInfo device = getCecDeviceInfo(logicalAddress); if (device == null) { diff --git a/services/core/java/com/android/server/hdmi/NewDeviceAction.java b/services/core/java/com/android/server/hdmi/NewDeviceAction.java index 3d64cc5..6753368 100644 --- a/services/core/java/com/android/server/hdmi/NewDeviceAction.java +++ b/services/core/java/com/android/server/hdmi/NewDeviceAction.java @@ -163,6 +163,12 @@ final class NewDeviceAction extends HdmiCecFeatureAction { } private void addDeviceInfo() { + // The device should be in the device list with default information. + if (!tv().isInDeviceList(mDeviceLogicalAddress, mDevicePhysicalAddress)) { + Slog.w(TAG, String.format("Device not found (%02x, %04x)", + mDeviceLogicalAddress, mDevicePhysicalAddress)); + return; + } if (mDisplayName == null) { mDisplayName = HdmiUtils.getDefaultDeviceName(mDeviceLogicalAddress); } |