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

Commit 4d91e2f2 authored by Abhishek Aggarwal's avatar Abhishek Aggarwal Committed by Łukasz Patron
Browse files

LineageParts: Add bt dev/devclass null checks in trigger fragment

Change-Id: Ifaf5100e998f7a5eb4fea01b58027514f2779ab0
parent 51fb95e3
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
/*
 * Copyright (C) 2014 The CyanogenMod Project
 *               2020-2022 The LineageOS Project
 *               2020-2023 The LineageOS Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -81,7 +81,11 @@ public class BluetoothTriggerFragment extends AbstractTriggerListFragment {
            return true;
        }
        BluetoothDevice dev = mBluetoothAdapter.getRemoteDevice(info.id);
        return dev.getBluetoothClass().doesClassMatch(BluetoothClass.PROFILE_A2DP);
        if (dev == null) {
            return false;
        }
        BluetoothClass btClass = dev.getBluetoothClass();
        return btClass != null && btClass.doesClassMatch(BluetoothClass.PROFILE_A2DP);
    }

    @Override