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

Commit 718e41ee authored by Amy's avatar Amy Committed by Amy Zhang
Browse files

cec: refine CEC enable/disable logic.

CEC is enabled in CEC HAL by default. That should still be disabled
after reboot.

And if CEC is disabled, when enable it, we should enable CEC too
as well enable system control.

BUG: 110175546

Test: local test.
Change-Id: I4b110c88c719e07bf2cc884e0682e5ab73359fd4
(cherry picked from commit 45d424c08935384e9cc9b78a69a27a30637d5454)
parent ec0d236e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -402,6 +402,8 @@ public class HdmiControlService extends SystemService {
        if (mCecController != null) {
            if (mHdmiControlEnabled) {
                initializeCec(INITIATED_BY_BOOT_UP);
            } else {
                mCecController.setOption(OptionKey.ENABLE_CEC, false);
            }
        } else {
            Slog.i(TAG, "Device does not support HDMI-CEC.");
@@ -2384,6 +2386,7 @@ public class HdmiControlService extends SystemService {

    @ServiceThreadOnly
    private void enableHdmiControlService() {
        mCecController.setOption(OptionKey.ENABLE_CEC, true);
        mCecController.setOption(OptionKey.SYSTEM_CEC_CONTROL, true);
        mMhlController.setOption(OPTION_MHL_ENABLE, ENABLED);

@@ -2400,6 +2403,7 @@ public class HdmiControlService extends SystemService {
                    @Override
                    public void run() {
                        mCecController.setOption(OptionKey.ENABLE_CEC, false);
                        mCecController.setOption(OptionKey.SYSTEM_CEC_CONTROL, false);
                        mMhlController.setOption(OPTION_MHL_ENABLE, DISABLED);
                        clearLocalDevices();
                    }