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

Commit 11c8b02a authored by Oliver Woodman's avatar Oliver Woodman Committed by Automerger Merge Worker
Browse files

Merge "Plumb config to output switcher indication chip" into sc-v2-dev am: ca5da05e

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

Change-Id: I0b38836eaa50dc988bc0911245a3388ac654aeae
parents 09263940 ca5da05e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback {
    private final DialogLaunchAnimator mDialogLaunchAnimator;
    private final List<MediaDevice> mGroupMediaDevices = new CopyOnWriteArrayList<>();
    private final boolean mAboveStatusbar;
    private final boolean mVolumeAdjustmentForRemoteGroupSessions;
    private final NotificationEntryManager mNotificationEntryManager;
    @VisibleForTesting
    final List<MediaDevice> mMediaDevices = new CopyOnWriteArrayList<>();
@@ -111,6 +112,8 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback {
        mMetricLogger = new MediaOutputMetricLogger(mContext, mPackageName);
        mUiEventLogger = uiEventLogger;
        mDialogLaunchAnimator = dialogLaunchAnimator;
        mVolumeAdjustmentForRemoteGroupSessions = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_volumeAdjustmentForRemoteGroupSessions);
    }

    void start(@NonNull Callback cb) {
@@ -477,7 +480,9 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback {
    }

    boolean isVolumeControlEnabled(@NonNull MediaDevice device) {
        return !isActiveRemoteDevice(device);
        // TODO(b/202500642): Also enable volume control for remote non-group sessions.
        return !isActiveRemoteDevice(device)
            || mVolumeAdjustmentForRemoteGroupSessions;
    }

    private final MediaController.Callback mCb = new MediaController.Callback() {