diff options
author | Jinsuk Kim <jinsukkim@google.com> | 2015-01-29 09:50:25 +0900 |
---|---|---|
committer | Jinsuk Kim <jinsukkim@google.com> | 2015-01-29 11:20:53 +0900 |
commit | 7cd4a589af7cc6e6880799e86ef6febca5add46d (patch) | |
tree | 004c2c0719a365194aced25edae2c43982d83556 /services/core/java/com/android/server/hdmi | |
parent | fc921d19b6d6d26f3b0147ba9c1ee96298e6a17c (diff) | |
download | frameworks_base-7cd4a589af7cc6e6880799e86ef6febca5add46d.zip frameworks_base-7cd4a589af7cc6e6880799e86ef6febca5add46d.tar.gz frameworks_base-7cd4a589af7cc6e6880799e86ef6febca5add46d.tar.bz2 |
CEC: Add CEC device upon receiving <Report Physical Address>
Help devices be processed sooner when new device detection operation
takes longer than usual.
Bug: 19181472
Change-Id: I96c29081a9c7c9f73ebcd027ed9d18056dc89bf9
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 43ef457..b4c6b02 100644 --- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java @@ -580,6 +580,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; } @@ -1465,7 +1471,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); } |