Fix stuck HDMI-CEC actions after boot
Ensures that all queued actions on local devices are started after
boot. Previously, an unstarted SendKeyAction could stick around after
boot, blocking any future SendKeyAction from being created.
Unit tests omitted because of AOSP incompatibilities.
Bug: 193188675
Test: atest HdmiControlServiceTest#normalBoot_queuedActionsStartedAfterBoot
manual test: spam volume up on boot with IR volume control enabled
Change-Id: I0050ca927bdba939b0b0030a6aa2f6235b11ff5c
Merged-In: I0050ca927bdba939b0b0030a6aa2f6235b11ff5c
(cherry picked from commit 22dc89a89f869335df3879c09e7337c5b3967e85)
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index cca8be8..2e1f766 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -556,6 +556,12 @@
// on boot, if device is interactive, set HDMI CEC state as powered on as well
if (mPowerManager.isInteractive() && isPowerStandbyOrTransient()) {
mPowerStatus = HdmiControlManager.POWER_STATUS_ON;
+ // Start all actions that were queued because the device was in standby
+ if (mAddressAllocated) {
+ for (HdmiCecLocalDevice localDevice : getAllLocalDevices()) {
+ localDevice.startQueuedActions();
+ }
+ }
}
}