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

Commit d6d8c5c4 authored by Sherry Huang's avatar Sherry Huang
Browse files

HDMI-CEC: Disable AVB for Playback Devices

Playback devices on U branch release was paused because
AVB is not properly supported for some TVs, resulting in
no sound coming out from the TV. Temproary disable AVB to
unblock the release.

Test: atest com.android.server.hdmi
Bug: b/403964156, b/406050353
Flag: EXEMPT tmp fix
Change-Id: I07d695924015078be2ea090fca5c85febf4fd974
parent e2e048ae
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -451,6 +451,9 @@ public class HdmiControlService extends SystemService {
    @GuardedBy("mLock")
    private boolean mEarcEnabled;

    // Flag for disable absolute volume behavior b/406050353
    private boolean mAvbDisabled = true;

    private int mEarcPortId = -1;

    // Set to true while the service is in normal mode. While set to false, no input change is
@@ -3789,6 +3792,11 @@ public class HdmiControlService extends SystemService {
        return SystemProperties.getBoolean(Constants.PROPERTY_ARC_SUPPORT, true);
    }

    @VisibleForTesting
    protected void setAvbDisabled(boolean disabled) {
        mAvbDisabled = disabled;
    }

    @ServiceThreadOnly
    int getPowerStatus() {
        assertRunOnServiceThread();
@@ -4726,6 +4734,12 @@ public class HdmiControlService extends SystemService {
            case DeviceFeatures.FEATURE_SUPPORTED:
                if (currentVolumeBehavior
                        != AudioDeviceVolumeManager.DEVICE_VOLUME_BEHAVIOR_ABSOLUTE) {
                    // Switch to full volume behavior for playback devices due to b/406050353
                    if (mAvbDisabled && isPlaybackDevice()) {
                        switchToFullVolumeBehavior();
                        return;
                    }
                    // Keep using AVB for other cases
                    // Start an action that will call enableAbsoluteVolumeBehavior
                    // once the System Audio device sends <Report Audio Status>
                    localCecDevice.startNewAvbAudioStatusAction(
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ public abstract class BaseAbsoluteVolumeBehaviorTest {
                HdmiControlManager.VOLUME_CONTROL_DISABLED);
        mHdmiControlService.setHdmiCecConfig(mHdmiCecConfig);
        mHdmiControlService.setDeviceConfig(new FakeDeviceConfigWrapper());
        mHdmiControlService.setAvbDisabled(false);  // enable Avb as required by test

        mNativeWrapper = new FakeNativeWrapper();
        mNativeWrapper.setPhysicalAddress(getPhysicalAddress());