Fix NPE during restartBleScan() when scanner is null
Fix: 204533528 Test: N/A Change-Id: If242e01979c381aab5538e93bdf889ea95e16a20
This commit is contained in:
@@ -1451,8 +1451,12 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
|
||||
}
|
||||
|
||||
void restartBleScan() {
|
||||
mBluetoothAdapter.getBluetoothLeScanner().stopScan(mBleScanCallback);
|
||||
startBleScan();
|
||||
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() {
|
||||
|
||||
Reference in New Issue
Block a user