summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJinsuk Kim <jinsukkim@google.com>2014-11-25 17:49:34 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-25 17:49:34 +0000
commit4043fd8fec7e7f507851715138d705a8fdfe9e90 (patch)
treea491bd88fb47502dd93a572d12737e3c78b3ef1e /services
parent0f1fb55b8632542264ebb745618719f4f8bd8d44 (diff)
parentc27f5baaeb39137b7cedc7c36feaaa1a67b1d3a3 (diff)
downloadframeworks_base-4043fd8fec7e7f507851715138d705a8fdfe9e90.zip
frameworks_base-4043fd8fec7e7f507851715138d705a8fdfe9e90.tar.gz
frameworks_base-4043fd8fec7e7f507851715138d705a8fdfe9e90.tar.bz2
am c27f5baa: am 51cb7aa7: Merge "CEC: Do not issue non-effective <Routing Change>" into lmp-mr1-dev
* commit 'c27f5baaeb39137b7cedc7c36feaaa1a67b1d3a3': CEC: Do not issue non-effective <Routing Change>
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/hdmi/ActiveSourceHandler.java7
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java30
2 files changed, 17 insertions, 20 deletions
diff --git a/services/core/java/com/android/server/hdmi/ActiveSourceHandler.java b/services/core/java/com/android/server/hdmi/ActiveSourceHandler.java
index 9593a9c..59d5605 100644
--- a/services/core/java/com/android/server/hdmi/ActiveSourceHandler.java
+++ b/services/core/java/com/android/server/hdmi/ActiveSourceHandler.java
@@ -89,11 +89,8 @@ final class ActiveSourceHandler {
tv.updateActiveSource(current);
invokeCallback(HdmiControlManager.RESULT_SUCCESS);
} else {
- HdmiCecMessage routingChange = HdmiCecMessageBuilder.buildRoutingChange(
- getSourceAddress(), newActive.physicalAddress, current.physicalAddress);
- mService.sendCecCommand(routingChange);
- tv.addAndStartAction(
- new RoutingControlAction(tv, current.physicalAddress, true, mCallback));
+ tv.startRoutingControl(newActive.physicalAddress, current.physicalAddress, true,
+ mCallback);
}
}
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
index ec38124..3f78949 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
@@ -362,11 +362,22 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
return;
}
int newPath = mService.portIdToPath(portId);
+ startRoutingControl(oldPath, newPath, true, callback);
+ }
+
+ @ServiceThreadOnly
+ void startRoutingControl(int oldPath, int newPath, boolean queryDevicePowerStatus,
+ IHdmiControlCallback callback) {
+ assertRunOnServiceThread();
+ if (oldPath == newPath) {
+ return;
+ }
HdmiCecMessage routingChange =
HdmiCecMessageBuilder.buildRoutingChange(mAddress, oldPath, newPath);
mService.sendCecCommand(routingChange);
removeAction(RoutingControlAction.class);
- addAndStartAction(new RoutingControlAction(this, newPath, true, callback));
+ addAndStartAction(
+ new RoutingControlAction(this, newPath, queryDevicePowerStatus, callback));
}
@ServiceThreadOnly
@@ -587,12 +598,9 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
private boolean handleNewDeviceAtTheTailOfActivePath(int path) {
// Seq #22
if (isTailOfActivePath(path, getActivePath())) {
- removeAction(RoutingControlAction.class);
int newPath = mService.portIdToPath(getActivePortId());
setActivePath(newPath);
- mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingChange(
- mAddress, getActivePath(), newPath));
- addAndStartAction(new RoutingControlAction(this, newPath, false, null));
+ startRoutingControl(getActivePath(), newPath, false, null);
return true;
}
return false;
@@ -1346,12 +1354,8 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
assertRunOnServiceThread();
// Seq #23
if (isTailOfActivePath(path, getActivePath())) {
- removeAction(RoutingControlAction.class);
int newPath = mService.portIdToPath(getActivePortId());
- mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingChange(
- mAddress, getActivePath(), newPath));
- mActiveSource.invalidate();
- addAndStartAction(new RoutingControlAction(this, getActivePath(), true, null));
+ startRoutingControl(getActivePath(), newPath, true, null);
}
}
@@ -1367,13 +1371,9 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
// Seq #24
if (getActivePortId() != Constants.INVALID_PORT_ID) {
if (!routingForBootup && !isProhibitMode()) {
- removeAction(RoutingControlAction.class);
int newPath = mService.portIdToPath(getActivePortId());
setActivePath(newPath);
- mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingChange(mAddress,
- getActivePath(), newPath));
- addAndStartAction(new RoutingControlAction(this, getActivePortId(),
- routingForBootup, null));
+ startRoutingControl(getActivePath(), newPath, routingForBootup, null);
}
} else {
int activePath = mService.getPhysicalAddress();