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

Commit 201ccb8e authored by Paul Colta's avatar Paul Colta
Browse files

HDMI: Don't broadcast <AS> from SAM Initiation AVR is not-interactive

The previous change used to check for a received standby message to not broadcast <AS>. However, device may be turned off by power button so they should still not broadcast <AS> in this case.

Bug: 430470168
Flag: EXEMPT bugfix
Test: atest com.android.server.hdmi
Change-Id: I545ad6c809ba50bf1cc23a405bb74fefa1a060e1
parent 86ce0e2d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ public class SystemAudioInitiationActionFromAvr extends HdmiCecFeatureAction {

    private void handleActiveSourceTimeout() {
        HdmiLogger.debug("Cannot get active source.");
        if (audioSystem().mService.isStandbyMessageReceived()) {
        if (!audioSystem().mService.getPowerManager().isInteractive()) {
            Slog.d(TAG, "Device is going to sleep, avoid to wake it up.");
            return;
        }
+1 −8
Original line number Diff line number Diff line
@@ -64,7 +64,6 @@ public class SystemAudioInitiationActionFromAvrTest {
    private boolean mArcEnabled;
    private boolean mIsPlaybackDevice;
    private boolean mBroadcastActiveSource;
    private boolean mStandbyMessageReceived;

    @Before
    public void SetUp() {
@@ -141,11 +140,6 @@ public class SystemAudioInitiationActionFromAvrTest {
                        return -1;
                    }

                    @Override
                    protected boolean isStandbyMessageReceived() {
                        return mStandbyMessageReceived;
                    }

                    @Override
                    protected void sendBroadcastAsUser(@RequiresPermission Intent intent) {
                        // do nothing
@@ -305,7 +299,7 @@ public class SystemAudioInitiationActionFromAvrTest {
    public void onActionStarted_deviceGoesToSleep_noActiveSourceAfterTimeout() {
        resetTestVariables();

        mStandbyMessageReceived = true;
        mPowerManager.setInteractive(false);
        mHdmiCecLocalDeviceAudioSystem.addAndStartAction(
                new SystemAudioInitiationActionFromAvr(
                mHdmiCecLocalDeviceAudioSystem));
@@ -326,6 +320,5 @@ public class SystemAudioInitiationActionFromAvrTest {
        mBroadcastActiveSource = false;
        mHdmiCecLocalDeviceAudioSystem.getActiveSource().physicalAddress =
                Constants.INVALID_PHYSICAL_ADDRESS;
        mStandbyMessageReceived = false;
    }
}