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

Commit db855b9f authored by Hall Liu's avatar Hall Liu
Browse files

Add null check

Add null check when receiving a on device added broadcast.

Change-Id: I580723e772b88a6cb89976ff8d1d1cc295af7c97
Fixes: 118726537
Test: manual
parent 3a6dd377
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -186,6 +186,10 @@ public class BluetoothDeviceManager {
        synchronized (mLock) {
            LinkedHashMap<String, BluetoothDevice> targetDeviceMap;
            if (isHearingAid) {
                if (mBluetoothHearingAidService == null) {
                    Log.w(this, "Hearing aid service null when receiving device added broadcast");
                    return;
                }
                long hiSyncId = mBluetoothHearingAidService.getHiSyncId(device);
                mHearingAidDeviceSyncIds.put(device, hiSyncId);
                targetDeviceMap = mHearingAidDevicesByAddress;