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

Commit 6e7bf257 authored by Guojing Yuan's avatar Guojing Yuan
Browse files

Fix NPE during restartBleScan() when scanner is null

Fix: 204533528

Test: N/A
Change-Id: If242e01979c381aab5538e93bdf889ea95e16a20
parent e1211c67
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1451,8 +1451,12 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
    }

    void restartBleScan() {
        if (mBluetoothAdapter.getBluetoothLeScanner() != null) {
            mBluetoothAdapter.getBluetoothLeScanner().stopScan(mBleScanCallback);
            startBleScan();
        } else {
            Slog.w(LOG_TAG, "BluetoothLeScanner is null (likely BLE isn't ON yet).");
        }
    }

    private List<ScanFilter> getBleScanFilters() {