Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20943eb2 authored by SongFerngWang's avatar SongFerngWang
Browse files

Avoid NPE since getBluetoothClass is nullable

Bug: 264224476
Test: build pass.
Change-Id: I2d55f95f0a37dc31b64f85f51184338f700d1085
parent 03882bc8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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: