mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-28 11:35:48 +01:00
Stop BangleJSDeviceSupport repeatedly calling GBLocationManager.stop and spamming the log with "Stop location updates"
This commit is contained in:
parent
94cd7523db
commit
8e010bc6dd
@ -155,7 +155,7 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
|
|||||||
|
|
||||||
private final LimitedQueue/*Long*/ mNotificationReplyAction = new LimitedQueue(16);
|
private final LimitedQueue/*Long*/ mNotificationReplyAction = new LimitedQueue(16);
|
||||||
|
|
||||||
private Boolean gpsUpdateSetup = false;
|
private boolean gpsUpdateSetup = false;
|
||||||
private Timer gpsPositionTimer;
|
private Timer gpsPositionTimer;
|
||||||
private final int gpsUpdateTimerInterval = 1000;
|
private final int gpsUpdateTimerInterval = 1000;
|
||||||
|
|
||||||
@ -200,6 +200,8 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
|
|||||||
|
|
||||||
|
|
||||||
private void stopLocationUpdate() {
|
private void stopLocationUpdate() {
|
||||||
|
if (!gpsUpdateSetup)
|
||||||
|
return;
|
||||||
LOG.info("Stop location updates");
|
LOG.info("Stop location updates");
|
||||||
GBLocationManager.stop(getContext(), this);
|
GBLocationManager.stop(getContext(), this);
|
||||||
gpsUpdateSetup = false;
|
gpsUpdateSetup = false;
|
||||||
@ -968,6 +970,7 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
|
|||||||
} else {
|
} else {
|
||||||
GB.toast("Phone gps data update is deactivated in the settings", Toast.LENGTH_SHORT, GB.INFO);
|
GB.toast("Phone gps data update is deactivated in the settings", Toast.LENGTH_SHORT, GB.INFO);
|
||||||
}
|
}
|
||||||
|
gpsUpdateSetup = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user