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

Commit b98782ba 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: Id45cbeb52a5578b675daae076e21bb483b3d79d9
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6e3b5e58 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());
        }