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

Commit 92013ed9 authored by Oliver Woodman's avatar Oliver Woodman
Browse files

Plumb config to output switcher indication chip

Bug: 197586676
Bug: 202500642
Test: manual
Merged-In: I71d7f11b9d88dfb9ef74814e9ac7f9d28b0e652c
Change-Id: I71d7f11b9d88dfb9ef74814e9ac7f9d28b0e652c
parent b7f52f44
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() {