Merge "AudioService: fix volume behavior for dock devices" into tm-qpr-dev

This commit is contained in:
TreeHugger Robot
2022-11-29 15:30:27 +00:00
committed by Android (Google) Code Review

View File

@@ -7055,9 +7055,10 @@ public class AudioService extends IAudioService.Stub
private @AudioManager.DeviceVolumeBehavior
int getDeviceVolumeBehaviorInt(@NonNull AudioDeviceAttributes device) {
// translate Java device type to native device type (for the devices masks for full / fixed)
final int audioSystemDeviceOut = AudioDeviceInfo.convertDeviceTypeToInternalDevice(
device.getType());
// Get the internal type set by the AudioDeviceAttributes constructor which is always more
// exact (avoids double conversions) than a conversion from SDK type via
// AudioDeviceInfo.convertDeviceTypeToInternalDevice()
final int audioSystemDeviceOut = device.getInternalType();
int setDeviceVolumeBehavior = retrieveStoredDeviceVolumeBehavior(audioSystemDeviceOut);
if (setDeviceVolumeBehavior != AudioManager.DEVICE_VOLUME_BEHAVIOR_UNSET) {