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

Commit 3a6606f2 authored by Santiago Seifert's avatar Santiago Seifert
Browse files

Avoid checking volumeAdjustmentForRemoteGroupSessions for system routing sessions

Bug: 205124386
Test: atest RoutingSessionInfoTest
Change-Id: Iea9615d30d9ab123ed4297fa28e535d9b7b7a995
parent 568c49c6
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -100,7 +100,11 @@ public final class RoutingSessionInfo implements Parcelable {

        boolean volumeAdjustmentForRemoteGroupSessions = Resources.getSystem().getBoolean(
                com.android.internal.R.bool.config_volumeAdjustmentForRemoteGroupSessions);
        mVolumeHandling = defineVolumeHandling(builder.mVolumeHandling, mSelectedRoutes,
        mVolumeHandling =
                defineVolumeHandling(
                        mIsSystemSession,
                        builder.mVolumeHandling,
                        mSelectedRoutes,
                        volumeAdjustmentForRemoteGroupSessions);

        mControlHints = updateVolumeHandlingInHints(builder.mControlHints, mVolumeHandling);
@@ -150,9 +154,14 @@ public final class RoutingSessionInfo implements Parcelable {
        return controlHints;
    }

    private static int defineVolumeHandling(int volumeHandling, List<String> selectedRoutes,
    private static int defineVolumeHandling(
            boolean isSystemSession,
            int volumeHandling,
            List<String> selectedRoutes,
            boolean volumeAdjustmentForRemoteGroupSessions) {
        if (!volumeAdjustmentForRemoteGroupSessions && selectedRoutes.size() > 1) {
        if (!isSystemSession
                && !volumeAdjustmentForRemoteGroupSessions
                && selectedRoutes.size() > 1) {
            return MediaRoute2Info.PLAYBACK_VOLUME_FIXED;
        }
        return volumeHandling;