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

Commit 6c0fc5c9 authored by Yan Han's avatar Yan Han Committed by Automerger Merge Worker
Browse files

Merge "Improve reliability of soundbar volume UI on TVs." into udc-dev am:...

Merge "Improve reliability of soundbar volume UI on TVs." into udc-dev am: fe143de3 am: f102f501

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



Change-Id: Ieb32f6ce8bfc11f08ab99fc911e0ef5ff2e3641f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 13740921 f102f501
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1013,12 +1013,11 @@ abstract class HdmiCecLocalDevice extends HdmiLocalDevice {
    }

    @ServiceThreadOnly
    void addAvbAudioStatusAction(int targetAddress) {
    void startNewAvbAudioStatusAction(int targetAddress) {
        assertRunOnServiceThread();
        if (!hasAction(AbsoluteVolumeAudioStatusAction.class)) {
        removeAction(AbsoluteVolumeAudioStatusAction.class);
        addAndStartAction(new AbsoluteVolumeAudioStatusAction(this, targetAddress));
    }
    }

    @ServiceThreadOnly
    void removeAvbAudioStatusAction() {
+9 −7
Original line number Diff line number Diff line
@@ -4341,12 +4341,9 @@ public class HdmiControlService extends SystemService {
        switch (systemAudioDeviceInfo.getDeviceFeatures().getSetAudioVolumeLevelSupport()) {
            case DeviceFeatures.FEATURE_SUPPORTED:
                if (currentVolumeBehavior != AudioManager.DEVICE_VOLUME_BEHAVIOR_ABSOLUTE) {
                    // If we're currently using adjust-only absolute volume behavior, switch to
                    // full volume behavior until we successfully adopt absolute volume behavior
                    switchToFullVolumeBehavior();
                    // Start an action that will call enableAbsoluteVolumeBehavior
                    // once the System Audio device sends <Report Audio Status>
                    localCecDevice.addAvbAudioStatusAction(
                    localCecDevice.startNewAvbAudioStatusAction(
                            systemAudioDeviceInfo.getLogicalAddress());
                }
                return;
@@ -4358,10 +4355,13 @@ public class HdmiControlService extends SystemService {
                            != AudioManager.DEVICE_VOLUME_BEHAVIOR_ABSOLUTE_ADJUST_ONLY) {
                        // If we're currently using absolute volume behavior, switch to full volume
                        // behavior until we successfully adopt adjust-only absolute volume behavior
                        switchToFullVolumeBehavior();
                        if (currentVolumeBehavior == AudioManager.DEVICE_VOLUME_BEHAVIOR_ABSOLUTE) {
                            getAudioManager().setDeviceVolumeBehavior(getAvbAudioOutputDevice(),
                                    AudioManager.DEVICE_VOLUME_BEHAVIOR_FULL);
                        }
                        // Start an action that will call enableAbsoluteVolumeBehavior
                        // once the System Audio device sends <Report Audio Status>
                        localCecDevice.addAvbAudioStatusAction(
                        localCecDevice.startNewAvbAudioStatusAction(
                                systemAudioDeviceInfo.getLogicalAddress());
                    }
                } else {
@@ -4369,7 +4369,9 @@ public class HdmiControlService extends SystemService {
                }
                return;
            case DeviceFeatures.FEATURE_SUPPORT_UNKNOWN:
                if (currentVolumeBehavior == AudioManager.DEVICE_VOLUME_BEHAVIOR_ABSOLUTE) {
                    switchToFullVolumeBehavior();
                }
                localCecDevice.querySetAudioVolumeLevelSupport(
                        systemAudioDeviceInfo.getLogicalAddress());
        }