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

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

Change-Id: I5564bb02f360342c0f8338f31069fa70e503c342
This commit is contained in:
Oliver Woodman
2021-11-22 20:53:16 +00:00
committed by Automerger Merge Worker

View File

@@ -75,6 +75,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback {
private final ActivityStarter mActivityStarter; private final ActivityStarter mActivityStarter;
private final List<MediaDevice> mGroupMediaDevices = new CopyOnWriteArrayList<>(); private final List<MediaDevice> mGroupMediaDevices = new CopyOnWriteArrayList<>();
private final boolean mAboveStatusbar; private final boolean mAboveStatusbar;
private final boolean mVolumeAdjustmentForRemoteGroupSessions;
private final NotificationEntryManager mNotificationEntryManager; private final NotificationEntryManager mNotificationEntryManager;
@VisibleForTesting @VisibleForTesting
final List<MediaDevice> mMediaDevices = new CopyOnWriteArrayList<>(); final List<MediaDevice> mMediaDevices = new CopyOnWriteArrayList<>();
@@ -104,6 +105,8 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback {
mLocalMediaManager = new LocalMediaManager(mContext, lbm, imm, packageName); mLocalMediaManager = new LocalMediaManager(mContext, lbm, imm, packageName);
mMetricLogger = new MediaOutputMetricLogger(mContext, mPackageName); mMetricLogger = new MediaOutputMetricLogger(mContext, mPackageName);
mUiEventLogger = uiEventLogger; mUiEventLogger = uiEventLogger;
mVolumeAdjustmentForRemoteGroupSessions = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_volumeAdjustmentForRemoteGroupSessions);
} }
void start(@NonNull Callback cb) { void start(@NonNull Callback cb) {
@@ -466,7 +469,9 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback {
} }
boolean isVolumeControlEnabled(@NonNull MediaDevice device) { 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() { private final MediaController.Callback mCb = new MediaController.Callback() {