commit | b35ca2b5707da2155d2b8d7600d55f1422dedacf | [log] [tgz] |
---|---|---|
author | SongFerngWang <songferngwang@google.com> | Tue Mar 08 14:40:19 2022 +0800 |
committer | SongFerngWang <songferngwang@google.com> | Wed Mar 16 18:09:27 2022 +0800 |
tree | 8307c70069bc29c744b3a1cf9fd7715c4ca972c7 | |
parent | 634b3fec766aafdea88e1a0806988a84c0825754 [diff] |
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
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) {