From 8b290950808d4ebbf21564cdcf85f9b9b3891b38 Mon Sep 17 00:00:00 2001 From: SongFerngWang Date: Fri, 23 Dec 2022 03:20:29 +0800 Subject: [PATCH] [Unicast] Update the icons in LEA device settings This is the step#2 at comment#4, showing the headphone icon or the speaker icon by the Bluetooth Class. Bug: 258009444 Test: build pass Change-Id: Ic22bef443053b0975b20c6a6df8a80bb817ccf4e --- .../android/settingslib/bluetooth/LeAudioProfile.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LeAudioProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LeAudioProfile.java index 0f57d8785de96..562d4800cc451 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LeAudioProfile.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LeAudioProfile.java @@ -275,7 +275,15 @@ public class LeAudioProfile implements LocalBluetoothProfile { } public int getDrawableResource(BluetoothClass btClass) { - return R.drawable.ic_bt_le_audio; + switch (btClass.getDeviceClass()) { + case BluetoothClass.Device.AUDIO_VIDEO_UNCATEGORIZED: + case BluetoothClass.Device.AUDIO_VIDEO_WEARABLE_HEADSET: + case BluetoothClass.Device.AUDIO_VIDEO_MICROPHONE: + case BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES: + return R.drawable.ic_bt_le_audio; + default: + return R.drawable.ic_bt_le_audio_speakers; + } } public int getAudioLocation(BluetoothDevice device) {