Loading media/java/android/media/AudioDeviceVolumeManager.java +11 −2 Original line number Diff line number Diff line Loading @@ -416,6 +416,10 @@ public class AudioDeviceVolumeManager { * @hide * Configures a device to use absolute volume model, and registers a listener for receiving * volume updates to apply on that device * * <p>For A2DP devices only, this behavior is reset when they are disconnected / made * unavailable as this capability is communicated asynchronously at connection time. * * @param device the audio device set to absolute volume mode * @param volume the type of volume this device responds to * @param executor the Executor used for receiving volume updates through the listener Loading @@ -439,7 +443,8 @@ public class AudioDeviceVolumeManager { /** * @hide * Configures a device to use absolute volume model, and registers a listener for receiving * volume updates to apply on that device * volume updates to apply on that device. * * @param device the audio device set to absolute volume mode * @param volume the type of volume this device responds to * @param handlesVolumeAdjustment whether the controller handles volume adjustments separately Loading @@ -465,7 +470,11 @@ public class AudioDeviceVolumeManager { /** * @hide * Configures a device to use absolute volume model applied to different volume types, and * registers a listener for receiving volume updates to apply on that device * registers a listener for receiving volume updates to apply on that device. * * <p>For A2DP devices only, this behavior is reset when they are disconnected / made * unavailable as this capability is communicated asynchronously at connection time. * * @param device the audio device set to absolute multi-volume mode * @param volumes the list of volumes the given device responds to * @param executor the Executor used for receiving volume updates through the listener Loading services/core/java/com/android/server/audio/AudioDeviceBroker.java +6 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.audio; import static android.media.audio.Flags.scoManagedByAudio; import static android.media.audio.Flags.unifyAbsoluteVolumeManagement; import static android.media.AudioSystem.DEVICE_IN_ALL_SCO_SET; import static android.media.AudioSystem.DEVICE_IN_BLE_HEADSET; import static android.media.AudioSystem.DEVICE_IN_BLUETOOTH_SCO_HEADSET; Loading Loading @@ -1731,9 +1732,13 @@ public class AudioDeviceBroker { } } /*package*/ void clearAvrcpAbsoluteVolumeSupported() { /*package*/ void clearAvrcpAbsoluteVolumeSupported(AudioDeviceAttributes ada) { setAvrcpAbsoluteVolumeSupported(false); mAudioService.setAvrcpAbsoluteVolumeSupported(false); if (unifyAbsoluteVolumeManagement()) { mAudioService.unregisterAbsoluteVolumeDevice(ada); } } /*package*/ boolean getBluetoothA2dpEnabled() { Loading services/core/java/com/android/server/audio/AudioDeviceInventory.java +1 −1 Original line number Diff line number Diff line Loading @@ -2397,9 +2397,9 @@ public class AudioDeviceInventory { } // device to remove was visible by APM, update APM mDeviceBroker.clearAvrcpAbsoluteVolumeSupported(); AudioDeviceAttributes ada = new AudioDeviceAttributes( AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, address); mDeviceBroker.clearAvrcpAbsoluteVolumeSupported(ada); final int res = mAudioSystem.setDeviceConnectionState(ada, AudioSystem.DEVICE_STATE_UNAVAILABLE, codec, deviceSwitch); Loading services/core/java/com/android/server/audio/AudioService.java +9 −5 Original line number Diff line number Diff line Loading @@ -8454,11 +8454,15 @@ public class AudioService extends IAudioService.Stub } } } else { AbsoluteVolumeDeviceInfo deviceInfo = removeFromAbsoluteVolumeDevices(device); unregisterAbsoluteVolumeDevice(device); } } /*package*/ void unregisterAbsoluteVolumeDevice(AudioDeviceAttributes ada) { AbsoluteVolumeDeviceInfo deviceInfo = removeFromAbsoluteVolumeDevices(ada); if (deviceInfo != null) { deviceInfo.unlinkToDeath(); dispatchDeviceVolumeBehavior(device, DEVICE_VOLUME_BEHAVIOR_VARIABLE); } dispatchDeviceVolumeBehavior(ada, DEVICE_VOLUME_BEHAVIOR_VARIABLE); } } Loading Loading
media/java/android/media/AudioDeviceVolumeManager.java +11 −2 Original line number Diff line number Diff line Loading @@ -416,6 +416,10 @@ public class AudioDeviceVolumeManager { * @hide * Configures a device to use absolute volume model, and registers a listener for receiving * volume updates to apply on that device * * <p>For A2DP devices only, this behavior is reset when they are disconnected / made * unavailable as this capability is communicated asynchronously at connection time. * * @param device the audio device set to absolute volume mode * @param volume the type of volume this device responds to * @param executor the Executor used for receiving volume updates through the listener Loading @@ -439,7 +443,8 @@ public class AudioDeviceVolumeManager { /** * @hide * Configures a device to use absolute volume model, and registers a listener for receiving * volume updates to apply on that device * volume updates to apply on that device. * * @param device the audio device set to absolute volume mode * @param volume the type of volume this device responds to * @param handlesVolumeAdjustment whether the controller handles volume adjustments separately Loading @@ -465,7 +470,11 @@ public class AudioDeviceVolumeManager { /** * @hide * Configures a device to use absolute volume model applied to different volume types, and * registers a listener for receiving volume updates to apply on that device * registers a listener for receiving volume updates to apply on that device. * * <p>For A2DP devices only, this behavior is reset when they are disconnected / made * unavailable as this capability is communicated asynchronously at connection time. * * @param device the audio device set to absolute multi-volume mode * @param volumes the list of volumes the given device responds to * @param executor the Executor used for receiving volume updates through the listener Loading
services/core/java/com/android/server/audio/AudioDeviceBroker.java +6 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.audio; import static android.media.audio.Flags.scoManagedByAudio; import static android.media.audio.Flags.unifyAbsoluteVolumeManagement; import static android.media.AudioSystem.DEVICE_IN_ALL_SCO_SET; import static android.media.AudioSystem.DEVICE_IN_BLE_HEADSET; import static android.media.AudioSystem.DEVICE_IN_BLUETOOTH_SCO_HEADSET; Loading Loading @@ -1731,9 +1732,13 @@ public class AudioDeviceBroker { } } /*package*/ void clearAvrcpAbsoluteVolumeSupported() { /*package*/ void clearAvrcpAbsoluteVolumeSupported(AudioDeviceAttributes ada) { setAvrcpAbsoluteVolumeSupported(false); mAudioService.setAvrcpAbsoluteVolumeSupported(false); if (unifyAbsoluteVolumeManagement()) { mAudioService.unregisterAbsoluteVolumeDevice(ada); } } /*package*/ boolean getBluetoothA2dpEnabled() { Loading
services/core/java/com/android/server/audio/AudioDeviceInventory.java +1 −1 Original line number Diff line number Diff line Loading @@ -2397,9 +2397,9 @@ public class AudioDeviceInventory { } // device to remove was visible by APM, update APM mDeviceBroker.clearAvrcpAbsoluteVolumeSupported(); AudioDeviceAttributes ada = new AudioDeviceAttributes( AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, address); mDeviceBroker.clearAvrcpAbsoluteVolumeSupported(ada); final int res = mAudioSystem.setDeviceConnectionState(ada, AudioSystem.DEVICE_STATE_UNAVAILABLE, codec, deviceSwitch); Loading
services/core/java/com/android/server/audio/AudioService.java +9 −5 Original line number Diff line number Diff line Loading @@ -8454,11 +8454,15 @@ public class AudioService extends IAudioService.Stub } } } else { AbsoluteVolumeDeviceInfo deviceInfo = removeFromAbsoluteVolumeDevices(device); unregisterAbsoluteVolumeDevice(device); } } /*package*/ void unregisterAbsoluteVolumeDevice(AudioDeviceAttributes ada) { AbsoluteVolumeDeviceInfo deviceInfo = removeFromAbsoluteVolumeDevices(ada); if (deviceInfo != null) { deviceInfo.unlinkToDeath(); dispatchDeviceVolumeBehavior(device, DEVICE_VOLUME_BEHAVIOR_VARIABLE); } dispatchDeviceVolumeBehavior(ada, DEVICE_VOLUME_BEHAVIOR_VARIABLE); } } Loading