Merge "Fix NPE during restartBleScan() when scanner is null" into sc-v2-dev am: e5e42892c5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16166922 Change-Id: I10eda75d84c2226376bebb0f1463cce2a58eb12a
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