mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-07-22 23:02:33 +02:00
Do not crash inside the emulator (#1150)
As there is no bluetooth support in the emulator
This commit is contained in:
parent
355f2e6bb5
commit
11c545362a
|
@ -433,15 +433,20 @@ public class DiscoveryActivity extends AbstractGBActivity implements AdapterView
|
|||
}
|
||||
|
||||
private void stopBTLEDiscovery() {
|
||||
if (adapter != null)
|
||||
adapter.stopLeScan(leScanCallback);
|
||||
}
|
||||
|
||||
private void stopBTDiscovery() {
|
||||
if (adapter != null)
|
||||
adapter.cancelDiscovery();
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private void stopNewBTLEDiscovery() {
|
||||
if (adapter == null)
|
||||
return;
|
||||
|
||||
BluetoothLeScanner bluetoothLeScanner = adapter.getBluetoothLeScanner();
|
||||
if (bluetoothLeScanner == null) {
|
||||
LOG.warn("could not get BluetoothLeScanner()!");
|
||||
|
|
Loading…
Reference in New Issue
Block a user