1
0
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:
boun 2018-07-12 18:25:18 +02:00 committed by Carsten Pfeiffer
parent 355f2e6bb5
commit 11c545362a

View File

@ -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()!");