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

Skip to content
Commit 392b4812 authored by Yongqin Liu's avatar Yongqin Liu
Browse files

BluetoothDeviceManager.java: add null check before call mBluetoothAdapter.getActiveDevices



As the bluetoothAdapter might be null, we need to check first before
we call mBluetoothAdapter.getActiveDevices like before.
Otherwise we would get following crash errors when there is no bluetooth feature
with the platform.

    10-09 16:12:33.654   953   953 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: main
    10-09 16:12:33.654   953   953 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List android.bluetooth.BluetoothAdapter.getActiveDevices(int)' on a null object reference
    10-09 16:12:33.654   953   953 E AndroidRuntime:    at com.android.server.telecom.bluetooth.BluetoothDeviceManager.getUniqueConnectedDevices(BluetoothDeviceManager.java:160)
    10-09 16:12:33.654   953   953 E AndroidRuntime:    at com.android.server.telecom.bluetooth.BluetoothRouteManager.getConnectedDevices(BluetoothRouteManager.java:611)
    10-09 16:12:33.654   953   953 E AndroidRuntime:    at com.android.server.telecom.CallAudioRouteStateMachine.getInitialAudioState(CallAudioRouteStateMachine.java:1810)
    10-09 16:12:33.654   953   953 E AndroidRuntime:    at com.android.server.telecom.CallAudioRouteStateMachine.initialize(CallAudioRouteStateMachine.java:1524)
    10-09 16:12:33.654   953   953 E AndroidRuntime:    at com.android.server.telecom.CallsManager.<init>(CallsManager.java:524)
    10-09 16:12:33.654   953   953 E AndroidRuntime:    at com.android.server.telecom.TelecomSystem.<init>(TelecomSystem.java:322)

Test: boot tested with x15 build

Signed-off-by: default avatarYongqin Liu <yongqin.liu@linaro.org>
Change-Id: Ib42ba98211dc74dcc59fab8171e6a41795161334
parent 4dffc62f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment