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

Commit 93f1f6e3 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "cec: resolve HdmiCecTvPowerToggleTest issue [1/1]" am:...

Merge "Merge "cec: resolve HdmiCecTvPowerToggleTest issue [1/1]" am: 96c64c02" into stage-aosp-master am: d532caca am: bd635e64

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



Change-Id: Ib1599cca97b0ed875f944fc355b54758b2c05a53
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 07675bfa bd635e64
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1126,6 +1126,16 @@ abstract class HdmiCecLocalDevice extends HdmiLocalDevice {
        removeActionExcept(clazz, null);
    }

    // Remove all running actions.
    @ServiceThreadOnly
    void removeAllActions() {
        assertRunOnServiceThread();
        for (HdmiCecFeatureAction action : mActions) {
            action.finish(false);
        }
        mActions.clear();
    }

    // Remove all actions matched with the given Class type besides |exception|.
    @ServiceThreadOnly
    <T extends HdmiCecFeatureAction> void removeActionExcept(
+8 −0
Original line number Diff line number Diff line
@@ -231,6 +231,14 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
        super.disableDevice(initiatedByCec, callback);
        assertRunOnServiceThread();
        mService.unregisterTvInputCallback(mTvInputCallback);
        // Removing actions and invoking the callback is similar to
        // HdmiCecLocalDevicePlayback#disableDevice and HdmiCecLocalDeviceTv#disableDevice,
        // with the difference that in those classes only specific actions are removed and
        // here we remove all actions. We don't expect any issues with removing all actions
        // at this time, but we have to pay attention in the future.
        removeAllActions();
        // Call the callback instantly or else it will be called 5 seconds later.
        checkIfPendingActionsCleared();
    }

    @Override