diff options
author | Jinsuk Kim <jinsukkim@google.com> | 2014-08-22 09:07:40 +0900 |
---|---|---|
committer | Jinsuk Kim <jinsukkim@google.com> | 2014-08-22 09:46:37 +0900 |
commit | d530719b169c8a10dccaefc413261e1b127cee63 (patch) | |
tree | 647858602cfdbc8cd14e6bb63e4c2cda4d21a164 /services/core/java/com/android/server/hdmi | |
parent | e9f6ed3b11fb8ebae5e73db1e4736b86cae272d9 (diff) | |
download | frameworks_base-d530719b169c8a10dccaefc413261e1b127cee63.zip frameworks_base-d530719b169c8a10dccaefc413261e1b127cee63.tar.gz frameworks_base-d530719b169c8a10dccaefc413261e1b127cee63.tar.bz2 |
CEC: Skip routing control/internal source selection conditionally
This is necessary for TV woken up by <Text/Image View On> to override
initial TV source selection/routing control, since the input change
will immediately come from external device.
Bug: 17189114
Change-Id: I4aa1ac31bc7f6ab554e29a9e6065e534e15abd58
Diffstat (limited to 'services/core/java/com/android/server/hdmi')
-rw-r--r-- | services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java index 73f5cfd..93adf9d 100644 --- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java @@ -112,6 +112,10 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { private final HdmiCecStandbyModeHandler mStandbyHandler; + // If true, do not do routing control/send active source for internal source. + // Set to true when the device was woken up by <Text/Image View On>. + private boolean mSkipRoutingControl; + // Set of physical addresses of CEC switches on the CEC bus. Managed independently from // other CEC devices since they might not have logical address. private final ArraySet<Integer> mCecSwitches = new ArraySet<Integer>(); @@ -134,6 +138,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { mService.sendCecCommand(HdmiCecMessageBuilder.buildDeviceVendorIdCommand( mAddress, mService.getVendorId())); mCecSwitches.add(mService.getPhysicalAddress()); // TV is a CEC switch too. + mSkipRoutingControl = (reason == HdmiControlService.INITIATED_BY_WAKE_UP_MESSAGE); launchRoutingControl(reason != HdmiControlService.INITIATED_BY_ENABLE_CEC && reason != HdmiControlService.INITIATED_BY_BOOT_UP); launchDeviceDiscovery(); @@ -207,7 +212,10 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { // Seq #18 if (mService.isControlEnabled() && mActiveSource.logicalAddress != mAddress) { updateActiveSource(mAddress, mService.getPhysicalAddress()); - // TODO: Check if this comes from <Text/Image View On> - if true, do nothing. + if (mSkipRoutingControl) { + mSkipRoutingControl = false; + return; + } HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource( mAddress, mService.getPhysicalAddress()); mService.sendCecCommand(activeSource); @@ -304,11 +312,13 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { invokeCallback(callback, HdmiControlManager.RESULT_INCORRECT_MODE); return; } - // TODO: Return immediately if the operation is triggered by <Text/Image View On> - // and this is the first notification about the active input after power-on - // (switch to HDMI didn't happen so far but is expected to happen soon). int oldPath = getActivePortId() != Constants.INVALID_PORT_ID ? mService.portIdToPath(getActivePortId()) : getDeviceInfo().getPhysicalAddress(); + setActivePath(oldPath); + if (mSkipRoutingControl) { + mSkipRoutingControl = false; + return; + } int newPath = mService.portIdToPath(portId); HdmiCecMessage routingChange = HdmiCecMessageBuilder.buildRoutingChange(mAddress, oldPath, newPath); @@ -566,8 +576,6 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { if (mService.isPowerStandbyOrTransient() && mAutoWakeup) { mService.wakeUp(); } - // TODO: Connect to Hardware input manager to invoke TV App with the appropriate channel - // that represents the source device. return true; } |