From 51c6a63eeee317af7f2ebbaf1ff837fd40bd2942 Mon Sep 17 00:00:00 2001 From: Amy Date: Tue, 23 Oct 2018 20:13:19 -0700 Subject: [PATCH] Make sure the device route to HOME when OneTouchPlay is triggered. ag/5342226 Note that we still need to discuss if this is the expected bahavior. For example when the device was on HDMI2 before TV button is pressed to turn TV off. When user press TV button again to turn TV on, should the device trigger OneTouch to grab Active Source or stay in the same input. Right now it trigger One Touch so it should route back to Home. Test: local tested. Bug: 118352291 Change-Id: I9f9a5f461063d872509764339503933e0f22aa8f --- .../core/java/com/android/server/hdmi/OneTouchPlayAction.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/core/java/com/android/server/hdmi/OneTouchPlayAction.java b/services/core/java/com/android/server/hdmi/OneTouchPlayAction.java index 41bf01f842cd4..d665efe5a4e94 100644 --- a/services/core/java/com/android/server/hdmi/OneTouchPlayAction.java +++ b/services/core/java/com/android/server/hdmi/OneTouchPlayAction.java @@ -92,6 +92,9 @@ final class OneTouchPlayAction extends HdmiCecFeatureAction { if (source.mService.audioSystem() != null) { source = source.mService.audioSystem(); } + if (source.getLocalActivePort() != Constants.CEC_SWITCH_HOME) { + source.switchInputOnReceivingNewActivePath(getSourceAddress()); + } source.setRoutingPort(Constants.CEC_SWITCH_HOME); source.setLocalActivePort(Constants.CEC_SWITCH_HOME); }