Loading services/core/java/com/android/server/audio/AudioService.java +16 −7 Original line number Diff line number Diff line Loading @@ -1583,8 +1583,11 @@ public class AudioService extends IAudioService.Stub synchronized (mCachedAbsVolDrivingStreamsLock) { mCachedAbsVolDrivingStreams.forEach((dev, stream) -> { mAudioSystem.setDeviceAbsoluteVolumeEnabled(dev, /*address=*/"", /*enabled=*/true, stream); boolean enabled = true; if (dev == AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP) { enabled = mAvrcpAbsVolSupported; } mAudioSystem.setDeviceAbsoluteVolumeEnabled(dev, /*address=*/"", enabled, stream); }); } } Loading Loading @@ -4881,7 +4884,7 @@ public class AudioService extends IAudioService.Stub if (absDev == AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP) { enabled = mAvrcpAbsVolSupported; } if (stream != streamType) { if (stream != streamType || !enabled) { mAudioSystem.setDeviceAbsoluteVolumeEnabled(absDev, /*address=*/"", enabled, streamType); } Loading Loading @@ -10383,10 +10386,10 @@ public class AudioService extends IAudioService.Stub } /*package*/ void setAvrcpAbsoluteVolumeSupported(boolean support) { synchronized (mCachedAbsVolDrivingStreamsLock) { mAvrcpAbsVolSupported = support; if (absVolumeIndexFix()) { int a2dpDev = AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP; synchronized (mCachedAbsVolDrivingStreamsLock) { mCachedAbsVolDrivingStreams.compute(a2dpDev, (dev, stream) -> { if (!mAvrcpAbsVolSupported) { mAudioSystem.setDeviceAbsoluteVolumeEnabled(a2dpDev, /*address=*/ Loading Loading @@ -12499,6 +12502,12 @@ public class AudioService extends IAudioService.Stub pw.println("\nLoudness alignment:"); mLoudnessCodecHelper.dump(pw); pw.println("\nAbsolute voume devices:"); synchronized (mCachedAbsVolDrivingStreamsLock) { mCachedAbsVolDrivingStreams.forEach((dev, stream) -> pw.println( "Device type: 0x" + Integer.toHexString(dev) + ", driving stream " + stream)); } mAudioSystem.dump(pw); } Loading
services/core/java/com/android/server/audio/AudioService.java +16 −7 Original line number Diff line number Diff line Loading @@ -1583,8 +1583,11 @@ public class AudioService extends IAudioService.Stub synchronized (mCachedAbsVolDrivingStreamsLock) { mCachedAbsVolDrivingStreams.forEach((dev, stream) -> { mAudioSystem.setDeviceAbsoluteVolumeEnabled(dev, /*address=*/"", /*enabled=*/true, stream); boolean enabled = true; if (dev == AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP) { enabled = mAvrcpAbsVolSupported; } mAudioSystem.setDeviceAbsoluteVolumeEnabled(dev, /*address=*/"", enabled, stream); }); } } Loading Loading @@ -4881,7 +4884,7 @@ public class AudioService extends IAudioService.Stub if (absDev == AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP) { enabled = mAvrcpAbsVolSupported; } if (stream != streamType) { if (stream != streamType || !enabled) { mAudioSystem.setDeviceAbsoluteVolumeEnabled(absDev, /*address=*/"", enabled, streamType); } Loading Loading @@ -10383,10 +10386,10 @@ public class AudioService extends IAudioService.Stub } /*package*/ void setAvrcpAbsoluteVolumeSupported(boolean support) { synchronized (mCachedAbsVolDrivingStreamsLock) { mAvrcpAbsVolSupported = support; if (absVolumeIndexFix()) { int a2dpDev = AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP; synchronized (mCachedAbsVolDrivingStreamsLock) { mCachedAbsVolDrivingStreams.compute(a2dpDev, (dev, stream) -> { if (!mAvrcpAbsVolSupported) { mAudioSystem.setDeviceAbsoluteVolumeEnabled(a2dpDev, /*address=*/ Loading Loading @@ -12499,6 +12502,12 @@ public class AudioService extends IAudioService.Stub pw.println("\nLoudness alignment:"); mLoudnessCodecHelper.dump(pw); pw.println("\nAbsolute voume devices:"); synchronized (mCachedAbsVolDrivingStreamsLock) { mCachedAbsVolDrivingStreams.forEach((dev, stream) -> pw.println( "Device type: 0x" + Integer.toHexString(dev) + ", driving stream " + stream)); } mAudioSystem.dump(pw); }