Merge "AudioService: Use proper stream context for Le Audio stream volume" am: 1861c325ae am: bff977a13b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2253034 Change-Id: I08df5c9531535663444cfda544f36109d1a605b6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -4018,7 +4018,7 @@ public class AudioService extends IAudioService.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setLeAudioVolumeOnModeUpdate(int mode, int streamType, int device) {
|
private void setLeAudioVolumeOnModeUpdate(int mode, int device) {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case AudioSystem.MODE_IN_COMMUNICATION:
|
case AudioSystem.MODE_IN_COMMUNICATION:
|
||||||
case AudioSystem.MODE_IN_CALL:
|
case AudioSystem.MODE_IN_CALL:
|
||||||
@@ -4032,10 +4032,16 @@ public class AudioService extends IAudioService.Stub
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Currently, DEVICE_OUT_BLE_HEADSET is the only output type for LE_AUDIO profile.
|
// Forcefully set LE audio volume as a workaround, since in some cases
|
||||||
// (See AudioDeviceBroker#createBtDeviceInfo())
|
// (like the outgoing call) the value of 'device' is not DEVICE_OUT_BLE_*
|
||||||
int index = mStreamStates[streamType].getIndex(AudioSystem.DEVICE_OUT_BLE_HEADSET);
|
// even when BLE is connected.
|
||||||
int maxIndex = mStreamStates[streamType].getMaxIndex();
|
if (!AudioSystem.isLeAudioDeviceType(device)) {
|
||||||
|
device = AudioSystem.DEVICE_OUT_BLE_HEADSET;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int streamType = getBluetoothContextualVolumeStream(mode);
|
||||||
|
final int index = mStreamStates[streamType].getIndex(device);
|
||||||
|
final int maxIndex = mStreamStates[streamType].getMaxIndex();
|
||||||
|
|
||||||
if (DEBUG_VOL) {
|
if (DEBUG_VOL) {
|
||||||
Log.d(TAG, "setLeAudioVolumeOnModeUpdate postSetLeAudioVolumeIndex index="
|
Log.d(TAG, "setLeAudioVolumeOnModeUpdate postSetLeAudioVolumeIndex index="
|
||||||
@@ -5421,9 +5427,7 @@ public class AudioService extends IAudioService.Stub
|
|||||||
// change of mode may require volume to be re-applied on some devices
|
// change of mode may require volume to be re-applied on some devices
|
||||||
updateAbsVolumeMultiModeDevices(previousMode, mode);
|
updateAbsVolumeMultiModeDevices(previousMode, mode);
|
||||||
|
|
||||||
// Forcefully set LE audio volume as a workaround, since the value of 'device'
|
setLeAudioVolumeOnModeUpdate(mode, device);
|
||||||
// is not DEVICE_OUT_BLE_* even when BLE is connected.
|
|
||||||
setLeAudioVolumeOnModeUpdate(mode, streamType, device);
|
|
||||||
|
|
||||||
// when entering RINGTONE, IN_CALL or IN_COMMUNICATION mode, clear all SCO
|
// when entering RINGTONE, IN_CALL or IN_COMMUNICATION mode, clear all SCO
|
||||||
// connections not started by the application changing the mode when pid changes
|
// connections not started by the application changing the mode when pid changes
|
||||||
|
|||||||
Reference in New Issue
Block a user