DO NOT MERGE Fix CEC read Global Setting timing

[Description]
When UI enables 2 CEC options right after enable CEC
TV will read the wrong value,
and failed to update value before TV is ready.

We should read the setting again after TV is ready.

Bug: 176708541
Test: Toggle HDMI control settings 10 times PASS

Change-Id: I0e8eaefe3839873c4af476d47bdb1295711d5967
This commit is contained in:
daren.liao
2020-12-30 11:21:12 +08:00
committed by Marvin Ramin
parent f24f42ad0f
commit 3bbf6c4bc0

View File

@@ -619,7 +619,14 @@ public class HdmiControlService extends SystemService {
mWakeUpMessageReceived = false;
if (isTvDeviceEnabled()) {
mCecController.setOption(OptionKey.WAKEUP, tv().getAutoWakeup());
boolean autoWakeupEnabled =
readBooleanSetting(Global.HDMI_CONTROL_AUTO_WAKEUP_ENABLED, true);
boolean autoDeviceOffEnabled =
readBooleanSetting(Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED, true);
mCecController.setOption(OptionKey.WAKEUP, autoWakeupEnabled);
tv().setAutoWakeup(autoWakeupEnabled);
tv().setAutoDeviceOff(autoDeviceOffEnabled);
}
int reason = -1;
switch (initiatedBy) {