mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-26 18:45:49 +01:00
make sure to only reconnect when device is in "waiting for reconnect state"
This commit is contained in:
parent
af14fb4f90
commit
4533c80c95
@ -32,7 +32,7 @@ public class BluetoothConnectReceiver extends BroadcastReceiver {
|
|||||||
GBDevice gbDevice = service.getGBDevice();
|
GBDevice gbDevice = service.getGBDevice();
|
||||||
if (gbDevice != null) {
|
if (gbDevice != null) {
|
||||||
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||||
if (device.getAddress().equals(gbDevice.getAddress())) {
|
if (device.getAddress().equals(gbDevice.getAddress()) && gbDevice.getState() == GBDevice.State.WAITING_FOR_RECONNECT) {
|
||||||
LOG.info("will connect to " + gbDevice.getName());
|
LOG.info("will connect to " + gbDevice.getName());
|
||||||
GBApplication.deviceService().connect();
|
GBApplication.deviceService().connect();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user