Add the API to get the AudioLocation

1.Add the API(getAudioLocation) to get the AudioLocation of LE audio
device at LeAudioProfile.
2.Add LeAudio summary state

Bug: 218626547
Test: build pass
Change-Id: I3655d1771f0ee9d60f65406e83b42e40307bd4f3
Merged-In: I3655d1771f0ee9d60f65406e83b42e40307bd4f3
This commit is contained in:
SongFerngWang
2022-03-08 14:40:19 +08:00
parent 634b3fec76
commit b35ca2b570
2 changed files with 9 additions and 1 deletions

View File

@@ -1115,7 +1115,8 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
final boolean isOnCall = Utils.isAudioModeOngoingCall(mContext);
if ((mIsActiveDeviceHearingAid)
|| (mIsActiveDeviceHeadset && isOnCall)
|| (mIsActiveDeviceA2dp && !isOnCall)) {
|| (mIsActiveDeviceA2dp && !isOnCall)
|| mIsActiveDeviceLeAudio) {
if (isTwsBatteryAvailable(leftBattery, rightBattery) && !shortSummary) {
stringRes = R.string.bluetooth_active_battery_level_untethered;
} else if (batteryLevelPercentageString != null && !shortSummary) {

View File

@@ -246,6 +246,13 @@ public class LeAudioProfile implements LocalBluetoothProfile {
return R.drawable.ic_bt_le_audio;
}
public int getAudioLocation(BluetoothDevice device) {
if (mService == null || device == null) {
return BluetoothLeAudio.AUDIO_LOCATION_INVALID;
}
return mService.getAudioLocation(device);
}
@RequiresApi(Build.VERSION_CODES.S)
protected void finalize() {
if (DEBUG) {