From a9d5ca2f0c01f6b992c06996dcc54ba4b1419760 Mon Sep 17 00:00:00 2001 From: Amy Date: Thu, 6 Jun 2019 18:14:28 -0700 Subject: [PATCH] Not handling portSelect and deviceSelect when device is standby Note that we need to revisit our logic on handling CEC messages and API calls when device is going to sleep. If the message is necessary to be handled during Standby process, there could be risk that the Action it triggered will be queued. We should wait for all the necessary messages or API calls to be handled to set the device into standby Test: manual Bug: 131128224 Change-Id: I475fb3e18c9e987a3f78fb3c83cf5b35c1a49944 (cherry picked from commit 94556af8e788455e13357f09fa2d0e3406356c4f) (cherry picked from commit ff6974f4f838b791feef82942d0d2dcda72210af) --- .../com/android/server/hdmi/HdmiControlService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java index 440676a3ae8f8..df4674c958b02 100644 --- a/services/core/java/com/android/server/hdmi/HdmiControlService.java +++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java @@ -1498,6 +1498,11 @@ public class HdmiControlService extends SystemService { Slog.e(TAG, "Callback cannot be null"); return; } + if (isPowerStandby()) { + Slog.e(TAG, "Device is in standby. Not handling deviceSelect"); + invokeCallback(callback, HdmiControlManager.RESULT_INCORRECT_MODE); + return; + } HdmiCecLocalDeviceTv tv = tv(); if (tv == null) { if (!mAddressAllocated) { @@ -1540,6 +1545,11 @@ public class HdmiControlService extends SystemService { Slog.e(TAG, "Callback cannot be null"); return; } + if (isPowerStandby()) { + Slog.e(TAG, "Device is in standby. Not handling portSelect"); + invokeCallback(callback, HdmiControlManager.RESULT_INCORRECT_MODE); + return; + } HdmiCecLocalDeviceTv tv = tv(); if (tv != null) { tv.doManualPortSwitching(portId, callback);