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

Commit f692a351 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Clear pending actions on local device on wakeup." am: c680c7ef am:...

Merge "Clear pending actions on local device on wakeup." am: c680c7ef am: 9ea8453e am: 5f14e32d am: 0da8f446 am: 90bf1687

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1684647

Change-Id: I18e6cddb6c748000186ec3a5ef7de60b277ad963
parents 410d7f7c 90bf1687
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -208,6 +208,12 @@ abstract class HdmiCecLocalDevice {
    void init() {
    void init() {
        assertRunOnServiceThread();
        assertRunOnServiceThread();
        mPreferredAddress = getPreferredAddress();
        mPreferredAddress = getPreferredAddress();
        if (mHandler.hasMessages(MSG_DISABLE_DEVICE_TIMEOUT)) {
            // Remove and trigger the queued message for clearing all actions when going to standby.
            // This is necessary because the device may wake up before the message is triggered.
            mHandler.removeMessages(MSG_DISABLE_DEVICE_TIMEOUT);
            handleDisableDeviceTimeout();
        }
        mPendingActionClearedCallback = null;
        mPendingActionClearedCallback = null;
    }
    }


+10 −3
Original line number Original line Diff line number Diff line
@@ -3166,7 +3166,7 @@ public class HdmiControlService extends SystemService {
                Slog.v(TAG, "On standby-action cleared:" + device.mDeviceType);
                Slog.v(TAG, "On standby-action cleared:" + device.mDeviceType);
                devices.remove(device);
                devices.remove(device);
                if (devices.isEmpty()) {
                if (devices.isEmpty()) {
                    onStandbyCompleted(standbyAction);
                    onPendingActionsCleared(standbyAction);
                    // We will not clear local devices here, since some OEM/SOC will keep passing
                    // We will not clear local devices here, since some OEM/SOC will keep passing
                    // the received packets until the application processor enters to the sleep
                    // the received packets until the application processor enters to the sleep
                    // actually.
                    // actually.
@@ -3227,10 +3227,17 @@ public class HdmiControlService extends SystemService {
        mHdmiCecNetwork.clearLocalDevices();
        mHdmiCecNetwork.clearLocalDevices();
    }
    }


    /**
     * Normally called after all devices have cleared their pending actions, to execute the final
     * phase of the standby flow.
     *
     * This can also be called during wakeup, when pending actions are cleared after failing to be
     * cleared during standby. In this case, it does not execute the standby flow.
     */
    @ServiceThreadOnly
    @ServiceThreadOnly
    private void onStandbyCompleted(int standbyAction) {
    private void onPendingActionsCleared(int standbyAction) {
        assertRunOnServiceThread();
        assertRunOnServiceThread();
        Slog.v(TAG, "onStandbyCompleted");
        Slog.v(TAG, "onPendingActionsCleared");


        if (!mPowerStatusController.isPowerStatusTransientToStandby()) {
        if (!mPowerStatusController.isPowerStatusTransientToStandby()) {
            return;
            return;