1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-10-18 09:19:34 +02:00

Wild guess at trying to fix spontaneous reboots during discovery #412

This commit is contained in:
cpfeiffer 2016-10-28 23:48:13 +02:00
parent a941a6cd5f
commit 1cadb692fe

View File

@ -63,6 +63,9 @@ public class DiscoveryActivity extends GBActivity implements AdapterView.OnItemC
}
break;
case BluetoothAdapter.ACTION_DISCOVERY_FINISHED:
handler.post(new Runnable() {
@Override
public void run() {
// continue with LE scan, if available
if (isScanning == Scanning.SCANNING_BT) {
checkAndRequestLocationPermission();
@ -74,6 +77,8 @@ public class DiscoveryActivity extends GBActivity implements AdapterView.OnItemC
} else {
discoveryFinished();
}
}
});
break;
case BluetoothAdapter.ACTION_STATE_CHANGED:
int oldState = intent.getIntExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE, BluetoothAdapter.STATE_OFF);