Plumb config to output switcher indication chip

Bug: 197586676
Bug: 202500642
Test: manual
Merged-In: I71d7f11b9d88dfb9ef74814e9ac7f9d28b0e652c
Change-Id: I71d7f11b9d88dfb9ef74814e9ac7f9d28b0e652c
This commit is contained in:
Oliver Woodman
2021-11-11 00:02:44 +00:00
parent b7f52f4468
commit 92013ed958

View File

@@ -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() {