summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJinsuk Kim <jinsukkim@google.com>2014-08-12 05:09:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-11 19:42:53 +0000
commit502d8b3beb5bd7ec03ad4fa6edb1a14a2ce1f7ac (patch)
tree68f19f70bd4dec30d1988732ad4f1f21fcd60be1
parent328e679b210aae094dd1bb86f80550c58aefbe9c (diff)
parentbcfa0677d4b015457b73b1147c96e4ad2946b2be (diff)
downloadframeworks_base-502d8b3beb5bd7ec03ad4fa6edb1a14a2ce1f7ac.zip
frameworks_base-502d8b3beb5bd7ec03ad4fa6edb1a14a2ce1f7ac.tar.gz
frameworks_base-502d8b3beb5bd7ec03ad4fa6edb1a14a2ce1f7ac.tar.bz2
Merge "CEC: Make sure CEC switch info is always updated" into lmp-dev
-rw-r--r--services/core/java/com/android/server/hdmi/DeviceDiscoveryAction.java3
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java28
2 files changed, 19 insertions, 12 deletions
diff --git a/services/core/java/com/android/server/hdmi/DeviceDiscoveryAction.java b/services/core/java/com/android/server/hdmi/DeviceDiscoveryAction.java
index d67b8f1..2ec9778 100644
--- a/services/core/java/com/android/server/hdmi/DeviceDiscoveryAction.java
+++ b/services/core/java/com/android/server/hdmi/DeviceDiscoveryAction.java
@@ -256,6 +256,9 @@ final class DeviceDiscoveryAction extends HdmiCecFeatureAction {
current.mPortId = getPortId(current.mPhysicalAddress);
current.mDeviceType = params[2] & 0xFF;
+ tv().updateCecSwitchInfo(current.mLogicalAddress, current.mDeviceType,
+ current.mPhysicalAddress);
+
increaseProcessedDeviceCount();
checkAndProceedStage();
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
index 4810650..2ff657f 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
@@ -436,18 +436,9 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
assertRunOnServiceThread();
int path = HdmiUtils.twoBytesToInt(message.getParams());
int address = message.getSource();
+ int type = message.getParams()[2];
- // Build cec switch list with pure CEC switch, AVR.
- if (address == Constants.ADDR_UNREGISTERED) {
- int type = message.getParams()[2];
- if (type == HdmiDeviceInfo.DEVICE_PURE_CEC_SWITCH) {
- mCecSwitches.add(path);
- updateSafeDeviceInfoList();
- return true; // Pure switch does not need further processing. Return here.
- } else if (type == HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM) {
- mCecSwitches.add(path);
- }
- }
+ if (updateCecSwitchInfo(address, type, path)) return true;
// Ignore if [Device Discovery Action] is going on.
if (hasAction(DeviceDiscoveryAction.class)) {
@@ -462,6 +453,19 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
return true;
}
+ boolean updateCecSwitchInfo(int address, int type, int path) {
+ if (address == Constants.ADDR_UNREGISTERED
+ && type == HdmiDeviceInfo.DEVICE_PURE_CEC_SWITCH) {
+ mCecSwitches.add(path);
+ updateSafeDeviceInfoList();
+ return true; // Pure switch does not need further processing. Return here.
+ }
+ if (type == HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM) {
+ mCecSwitches.add(path);
+ }
+ return false;
+ }
+
void startNewDeviceAction(ActiveSource activeSource) {
for (NewDeviceAction action : getActions(NewDeviceAction.class)) {
// If there is new device action which has the same logical address and path
@@ -1071,7 +1075,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
}
private void invokeDeviceEventListener(HdmiDeviceInfo info, int status) {
- if (!hideDevicesBehindLegacySwitch(info)) {
+ if (info.isSourceType() && !hideDevicesBehindLegacySwitch(info)) {
mService.invokeDeviceEventListeners(info, status);
}
}