Merge "Avoid NPE since getBluetoothClass is nullable"

This commit is contained in:
SongFerng Wang
2023-01-04 09:04:46 +00:00
committed by Android (Google) Code Review

View File

@@ -275,6 +275,10 @@ public class LeAudioProfile implements LocalBluetoothProfile {
}
public int getDrawableResource(BluetoothClass btClass) {
if (btClass == null) {
Log.e(TAG, "No btClass.");
return R.drawable.ic_bt_le_audio_speakers;
}
switch (btClass.getDeviceClass()) {
case BluetoothClass.Device.AUDIO_VIDEO_UNCATEGORIZED:
case BluetoothClass.Device.AUDIO_VIDEO_WEARABLE_HEADSET: