commit | 919194578b25b947403c0cafc18bbbfef15eab14 | [log] [tgz] |
---|---|---|
author | SongFerng Wang <songferngwang@google.com> | Thu Mar 17 03:11:20 2022 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Thu Mar 17 03:11:20 2022 +0000 |
tree | b0b89d224bc646b970be77804bec70649daecf4e | |
parent | 012ace16daa148f6be01e61dbff7a37f71ed5054 [diff] | |
parent | b35ca2b5707da2155d2b8d7600d55f1422dedacf [diff] |
Merge "Add the API to get the AudioLocation"
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index 981d8e4..019e51b 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -1115,7 +1115,8 @@ 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) {
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LeAudioProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LeAudioProfile.java index db6d41e..c323c4e 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LeAudioProfile.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LeAudioProfile.java
@@ -246,6 +246,13 @@ 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) {