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

Commit 76f6b36c 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 am: b98782ba

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



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


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


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