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

Commit def4fd90 authored by Weilun Du's avatar Weilun Du
Browse files

Fixed Settings crash caused by null bluetooth adpater.



Emulator doesn't support bluetooth.

BUG: 123026204
Change-Id: I5fddfaff03dfd882688a73542278d8ef1e509ca2
Signed-off-by: default avatarWeilun Du <wdu@google.com>
parent c2d10506
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ public class AccessibilityHearingAidPreferenceController extends BasePreferenceC
        if (!mHearingAidProfileSupported) {
            return null;
        }
        if (!mBluetoothAdapter.isEnabled()) {
        if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) {
            return null;
        }
        final List<BluetoothDevice> deviceList = mLocalBluetoothManager.getProfileManager()
@@ -166,6 +166,9 @@ public class AccessibilityHearingAidPreferenceController extends BasePreferenceC
    }

    private boolean isHearingAidProfileSupported() {
        if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) {
            return false;
        }
        final List<Integer> supportedList = mBluetoothAdapter.getSupportedProfiles();
        if (supportedList.contains(BluetoothProfile.HEARING_AID)) {
            return true;