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

Commit 6342c0cd authored by Yiyi Shen's avatar Yiyi Shen
Browse files

Remove disabling group seek bar for devices group

With ag/33996857, devices without group volume control support won't be
collapsed, so there is no need to disable the group seek bar.

Test: atest
Bug: 385672684
Flag: com.android.media.flags.enable_output_switcher_personal_audio_sharing

Change-Id: I43c5d816aea2b4bd9b78343708d1fa40e9ed82a0
parent 07f0a406
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -364,7 +364,17 @@ class MediaOutputAdapter(controller: MediaSwitchingController) :
            initSeekbar(
                volumeChangeCallback = { volume: Int -> mController.adjustSessionVolume(volume) },
                deviceDrawable = groupDrawable,
                isVolumeControlAllowed = mController.isVolumeControlEnabledForSession,
                // When Flags.enableOutputSwitcherPersonalAudioSharing() is on, no need to show
                // disabled seek bar for volume control disabled session because devices won't be
                // collapsed.
                // This is a side effect of broadcast design: broadcast devices should be controlled
                // separately so they should not be collapsed, so isVolumeControlEnabledForSession
                // is added to {@link MediaOutputAdapter#updateItems()}. The logic will spread to
                // casting devices without group volume control, so disabling seek bar will be
                // unnecessary when Flags.enableOutputSwitcherPersonalAudioSharing() is on.
                isVolumeControlAllowed =
                    !Flags.enableOutputSwitcherPersonalAudioSharing() &&
                        mController.isVolumeControlEnabledForSession,
                currentVolume = mController.sessionVolume,
                maxVolume = mController.sessionVolumeMax,
                colorTheme = colorTheme,
+9 −1
Original line number Diff line number Diff line
@@ -447,7 +447,15 @@ public class MediaOutputAdapterLegacy extends MediaOutputAdapterBase {
                public void onUnmute() {}
            };

            if (!mController.isVolumeControlEnabledForSession()) {
            // When Flags.enableOutputSwitcherPersonalAudioSharing() is on, no need to show disabled
            // seek bar for volume control disabled session because devices won't be collapsed.
            // This is a side effect of broadcast design: broadcast devices should be controlled
            // separately so they should not be collapsed, so isVolumeControlEnabledForSession is
            // added to {@link MediaOutputAdapter#updateItems()}. The logic will spread to casting
            // devices without group volume control, so disabling seek bar will be unnecessary when
            // Flags.enableOutputSwitcherPersonalAudioSharing() is on.
            if (!Flags.enableOutputSwitcherPersonalAudioSharing()
                    && !mController.isVolumeControlEnabledForSession()) {
                disableSeekBar();
            } else {
                enableSeekBar(volumeControl);