summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJinsuk Kim <jinsukkim@google.com>2015-01-23 06:51:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-01-23 06:51:58 +0000
commit76cf035513d843c66d2fafe85b6a37c4c19b9223 (patch)
tree4675ebbda7b1ccc66bb6f145ea2d902e51b89e05 /services
parent78d51c2292b5a3b56be1b1e92bc67b70f4eebce4 (diff)
parentcb8661c08f4a7b00eaa2ede06a30c32dd3cbc53b (diff)
downloadframeworks_base-76cf035513d843c66d2fafe85b6a37c4c19b9223.zip
frameworks_base-76cf035513d843c66d2fafe85b6a37c4c19b9223.tar.gz
frameworks_base-76cf035513d843c66d2fafe85b6a37c4c19b9223.tar.bz2
Merge "CEC: Add logic to return to internal source" into lmp-mr1-dev
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java9
-rw-r--r--services/core/java/com/android/server/hdmi/HdmiControlService.java24
2 files changed, 21 insertions, 12 deletions
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
index 4673b8c..43ef457 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
@@ -476,7 +476,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
HdmiDeviceInfo info = getCecDeviceInfo(logicalAddress);
if (info == null) {
if (!handleNewDeviceAtTheTailOfActivePath(physicalAddress)) {
- HdmiLogger.debug("Device info not found: %X; buffering the command", logicalAddress);
+ HdmiLogger.debug("Device info %X not found; buffering the command", logicalAddress);
mDelayedMessageBuffer.add(message);
}
} else if (!isInputReady(info.getId())) {
@@ -517,6 +517,12 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
doManualPortSwitching(portId, null);
setPrevPortId(Constants.INVALID_PORT_ID);
+ } else {
+ // No HDMI port to switch to was found. Notify the input change listers to
+ // switch to the lastly shown internal input.
+ mActiveSource.invalidate();
+ setActivePath(Constants.INVALID_PHYSICAL_ADDRESS);
+ mService.invokeInputChangeListener(HdmiDeviceInfo.INACTIVE_DEVICE);
}
return true;
}
@@ -1826,6 +1832,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
pw.println("mAutoDeviceOff: " + mAutoDeviceOff);
pw.println("mAutoWakeup: " + mAutoWakeup);
pw.println("mSkipRoutingControl: " + mSkipRoutingControl);
+ pw.println("mPrevPortId: " + mPrevPortId);
pw.println("CEC devices:");
pw.increaseIndent();
for (HdmiDeviceInfo info : mSafeAllDeviceInfos) {
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index fa8ab59..9f78c61 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -2252,16 +2252,17 @@ public final class HdmiControlService extends SystemService {
assertRunOnServiceThread();
if (tv() == null) return;
final int lastInput = contentOn ? tv().getActivePortId() : Constants.INVALID_PORT_ID;
- tv().doManualPortSwitching(portId, new IHdmiControlCallback.Stub() {
- @Override
- public void onComplete(int result) throws RemoteException {
- // Keep the last input to switch back later when RAP[ContentOff] is received.
- // This effectively sets the port to invalid one if the switching is for
- // RAP[ContentOff].
- setLastInputForMhl(lastInput);
- }
- });
-
+ if (portId != Constants.INVALID_PORT_ID) {
+ tv().doManualPortSwitching(portId, new IHdmiControlCallback.Stub() {
+ @Override
+ public void onComplete(int result) throws RemoteException {
+ // Keep the last input to switch back later when RAP[ContentOff] is received.
+ // This effectively sets the port to invalid one if the switching is for
+ // RAP[ContentOff].
+ setLastInputForMhl(lastInput);
+ }
+ });
+ }
// MHL device is always directly connected to the port. Update the active port ID to avoid
// unnecessary post-routing control task.
tv().setActivePortId(portId);
@@ -2271,7 +2272,8 @@ public final class HdmiControlService extends SystemService {
// may not be the MHL-enabled one. In this case the device info to be passed to
// input change listener should be the one describing the corresponding HDMI port.
HdmiMhlLocalDeviceStub device = mMhlController.getLocalDevice(portId);
- HdmiDeviceInfo info = (device != null) ? device.getInfo() : mPortDeviceMap.get(portId);
+ HdmiDeviceInfo info = (device != null) ? device.getInfo()
+ : mPortDeviceMap.get(portId, HdmiDeviceInfo.INACTIVE_DEVICE);
invokeInputChangeListener(info);
}