Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit bf8a466f authored by Amy's avatar Amy Committed by Nick Chalko
Browse files

Fix onStandby() in HdmiControlService

According to the CEC 1.4 spec 13.15.2:
"If the System Audio Mode is On, then the Amplifier shall send a <Set System Audio Mode> [“Off”]
message just before it goes into the Standby state in order to restore the volume function
back to the TV."

Current onStandby() logic in HdmiControlSerive won't let any device type do their onStandby()
callback if any of the device type's wake lock is held and can't go standby.

But this logic is not correct when user turns off the device (by local remote control etc.).
Audio System should still be able to turn off the System Audio Control and Playback should
also be able to do the callback even though it's wake lock is held.

Changed the logic to:
1. If any of the device type can't go to standby and user turn the device off, don't disable the
device, only call onStandby() in each device to handle the callback.
2. If everyone can go to standby, no matter the standby is sent by CEC or is controlled by users,
disable the device and call onStandby() in each device type.
3. If device is set to standby by CEC command and any of the device type can't go to standby,
return directly.

Test: atest com.android.server.hdmi
Change-Id: I2b1aa5b57d6682bb62fa56a4b4c718a94906ea91
(cherry picked from commit 9756bddd17c023efd8a27dd9a389f84c5cd02133)
parent edf3e1fa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment