Merge "Avoid NPE since getBluetoothClass is nullable"
This commit is contained in:
committed by
Android (Google) Code Review
commit
2fef0134a5
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user