Merge "Add the API to get the AudioLocation" am: 919194578b am: 78d86dc33b

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2027930

Change-Id: I4293eb1b67ae754b0b5515309267651b9355a708
This commit is contained in:
SongFerng Wang
2022-03-17 04:59:47 +00:00
committed by Automerger Merge Worker
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) {