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

Commit 8b4c8cbe authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Avoid checking volumeAdjustmentForRemoteGroupSessions for system routing sessions"

parents 3ec91f42 3a6606f2
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;