summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author SongFerng Wang <songferngwang@google.com> 2022-03-17 03:51:56 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-03-17 03:51:56 +0000
commit78d86dc33b57383ab8087c204978d33b2e823e67 (patch)
treeb0b89d224bc646b970be77804bec70649daecf4e
parent4a0307dedff377d08cb27d358b6abc1b22471409 (diff)
parent919194578b25b947403c0cafc18bbbfef15eab14 (diff)
Merge "Add the API to get the AudioLocation" am: 919194578b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2027930 Change-Id: I610a180cfaee503e34396dd7990ba38ed8c2c637
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java3
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/LeAudioProfile.java7
2 files changed, 9 insertions, 1 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index 981d8e403cd6..019e51bf0bae 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 @@ 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) {
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LeAudioProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LeAudioProfile.java
index db6d41ef692d..c323c4ef9937 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 @@ 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) {