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

Commit 59c6401d authored by Oliver Woodman's avatar Oliver Woodman Committed by Automerger Merge Worker
Browse files

Merge changes from topic "cherrypick-grouped-volume-tweak-xnvceg1hww" into...

Merge changes from topic "cherrypick-grouped-volume-tweak-xnvceg1hww" into sc-dev am: e65fa2ba am: 3a9f146f

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

Change-Id: I31b7358e01171cba241d0a3bf0489fdc77cb4ca3
parents dba11591 3a9f146f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback {
    private final ActivityStarter mActivityStarter;
    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<>();
@@ -104,6 +105,8 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback {
        mLocalMediaManager = new LocalMediaManager(mContext, lbm, imm, packageName);
        mMetricLogger = new MediaOutputMetricLogger(mContext, mPackageName);
        mUiEventLogger = uiEventLogger;
        mVolumeAdjustmentForRemoteGroupSessions = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_volumeAdjustmentForRemoteGroupSessions);
    }

    void start(@NonNull Callback cb) {
@@ -466,7 +469,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() {