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

Commit fbc778ea authored by Nathalie Le Clair's avatar Nathalie Le Clair
Browse files

Use up-to-date power status in DeviceSelectAction

The power status can have changed since the start of the action. Read the
most up-to-date value from HdmiCecNetwork.

Test: atest DeviceSelectActionTest
Fixes: 180290156
Change-Id: Ia872d0a1de3055d2e36a662120479be2277b519e
parent 946dfb5e
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -103,10 +103,11 @@ final class DeviceSelectAction extends HdmiCecFeatureAction {
        if (mIsCec20) {
        if (mIsCec20) {
            sendSetStreamPath();
            sendSetStreamPath();
        }
        }
        if (!mIsCec20 || mTarget.getDevicePowerStatus()
        int targetPowerStatus = localDevice().mService.getHdmiCecNetwork()
                              == HdmiControlManager.POWER_STATUS_UNKNOWN) {
                .getCecDeviceInfo(getTargetAddress()).getDevicePowerStatus();
        if (!mIsCec20 || targetPowerStatus == HdmiControlManager.POWER_STATUS_UNKNOWN) {
            queryDevicePowerStatus();
            queryDevicePowerStatus();
        } else if (mTarget.getDevicePowerStatus() == HdmiControlManager.POWER_STATUS_ON) {
        } else if (targetPowerStatus == HdmiControlManager.POWER_STATUS_ON) {
            invokeCallbackAndFinish(HdmiControlManager.RESULT_SUCCESS);
            invokeCallbackAndFinish(HdmiControlManager.RESULT_SUCCESS);
            return true;
            return true;
        }
        }