Pebble: set device to reconnecting state when actively reconnecting
It makes it easier to watch connection attempts and the delay between them in control center.
This commit is contained in:
parent
f2cbee39f1
commit
b71597800a
|
@ -364,6 +364,9 @@ public class PebbleIoThread extends GBDeviceIoThread {
|
||||||
mIsConnected = false;
|
mIsConnected = false;
|
||||||
int reconnectAttempts = prefs.getInt("pebble_reconnect_attempts", 10);
|
int reconnectAttempts = prefs.getInt("pebble_reconnect_attempts", 10);
|
||||||
if (!mQuit && GBApplication.getGBPrefs().getAutoReconnect() && reconnectAttempts > 0) {
|
if (!mQuit && GBApplication.getGBPrefs().getAutoReconnect() && reconnectAttempts > 0) {
|
||||||
|
gbDevice.setState(GBDevice.State.WAITING_FOR_RECONNECT);
|
||||||
|
gbDevice.sendDeviceUpdateIntent(getContext());
|
||||||
|
|
||||||
int delaySeconds = 1;
|
int delaySeconds = 1;
|
||||||
while (reconnectAttempts-- > 0 && !mQuit && !mIsConnected) {
|
while (reconnectAttempts-- > 0 && !mQuit && !mIsConnected) {
|
||||||
LOG.info("Trying to reconnect (attempts left " + reconnectAttempts + ")");
|
LOG.info("Trying to reconnect (attempts left " + reconnectAttempts + ")");
|
||||||
|
|
Loading…
Reference in New Issue