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)
This commit is contained in:
Amy
2019-06-06 18:14:28 -07:00
committed by Jay Patel
parent bcc1a887ba
commit a9d5ca2f0c

View File

@@ -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);