From b6a4717659b97aee1a3161f4e7ce3429165ffe76 Mon Sep 17 00:00:00 2001 From: SongFerngWang Date: Fri, 22 Jul 2022 17:50:17 +0800 Subject: [PATCH] [LE unicast] The icon is not LE Audio one The icon bases on the profile list sequence. Moving the LE audio profile before the headset profile, and then the LE audio device will show the LE audio icon. Bug: 238864869 Test: local test. Change-Id: I196e7d8764b504b89eb733b1e544b3d6ee07556e --- .../bluetooth/LocalBluetoothProfileManager.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java index 58944f6538699..4714ff93625b8 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothProfileManager.java @@ -576,6 +576,15 @@ public class LocalBluetoothProfileManager { return; } + // The profiles list's sequence will affect the bluetooth icon at + // BluetoothUtils.getBtClassDrawableWithDescription(Context,CachedBluetoothDevice). + + // Moving the LE audio profile to be the first priority if the device supports LE audio. + if (ArrayUtils.contains(uuids, BluetoothUuid.LE_AUDIO) && mLeAudioProfile != null) { + profiles.add(mLeAudioProfile); + removedProfiles.remove(mLeAudioProfile); + } + if (mHeadsetProfile != null) { if ((ArrayUtils.contains(localUuids, BluetoothUuid.HSP_AG) && ArrayUtils.contains(uuids, BluetoothUuid.HSP)) @@ -660,11 +669,6 @@ public class LocalBluetoothProfileManager { removedProfiles.remove(mHearingAidProfile); } - if (ArrayUtils.contains(uuids, BluetoothUuid.LE_AUDIO) && mLeAudioProfile != null) { - profiles.add(mLeAudioProfile); - removedProfiles.remove(mLeAudioProfile); - } - if (mSapProfile != null && ArrayUtils.contains(uuids, BluetoothUuid.SAP)) { profiles.add(mSapProfile); removedProfiles.remove(mSapProfile);