summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jinsuk Kim <jinsukkim@google.com> 2015-01-29 22:36:55 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2015-01-29 22:36:55 +0000
commite7ff01ecc5c0ceda498dd476cb29ee663f1968dc (patch)
tree2f8e8bc015f5f007cb84ed3ba17a99f5b20496ea
parent35b5780ec52f3492ae41c36ae30e289bcf78cb11 (diff)
parent1ebbe9165842707fd575ea61b8158463f93c35be (diff)
am 1ebbe916: am 3f923474: Merge "CEC: Add CEC device upon receiving <Report Physical Address>" into lmp-mr1-dev
* commit '1ebbe9165842707fd575ea61b8158463f93c35be': CEC: Add CEC device upon receiving <Report Physical Address>
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java8
-rw-r--r--services/core/java/com/android/server/hdmi/NewDeviceAction.java6
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 664f541c73d3..5c1c5bbf14e2 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 3d64cc52f519..6753368911b9 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);
}