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

Commit ae1755eb authored by Yiyi Shen's avatar Yiyi Shen Committed by Android (Google) Code Review
Browse files

Merge "Remove disabling group seek bar for devices group" into main

parents 7713a108 6342c0cd
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);