kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
fix location-fill in problem not working (ht @hansi)
rodzic
84f19cc137
commit
0088f40eb0
|
@ -952,17 +952,31 @@ class MeshService : Service(), Logging {
|
||||||
private fun setupLocationRequest() {
|
private fun setupLocationRequest() {
|
||||||
var desiredInterval = 0L
|
var desiredInterval = 0L
|
||||||
|
|
||||||
if (myNodeInfo?.hasGPS == true)
|
|
||||||
desiredInterval =
|
|
||||||
radioConfig?.preferences?.positionBroadcastSecs?.times(1000L) ?: 5 * 60 * 1000L
|
|
||||||
|
|
||||||
stopLocationRequests()
|
stopLocationRequests()
|
||||||
if (desiredInterval != 0L) {
|
val mi = myNodeInfo
|
||||||
debug("desired GPS assistance interval $desiredInterval")
|
val prefs = radioConfig?.preferences
|
||||||
startLocationRequests(desiredInterval)
|
if (mi != null && prefs != null) {
|
||||||
} else {
|
if (!mi.hasGPS) {
|
||||||
debug("No GPS assistance desired, but sending UTC time to mesh")
|
var broadcastSecs = prefs.positionBroadcastSecs
|
||||||
sendPositionScoped()
|
|
||||||
|
desiredInterval = if(broadcastSecs == 0) // unset by device, use default
|
||||||
|
15 * 60 * 1000
|
||||||
|
else
|
||||||
|
broadcastSecs * 1000L
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prefs.locationShare == RadioConfigProtos.LocationSharing.LocDisabled) {
|
||||||
|
info("GPS location sharing is disabled")
|
||||||
|
desiredInterval = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if (desiredInterval != 0L) {
|
||||||
|
info("desired GPS assistance interval $desiredInterval")
|
||||||
|
startLocationRequests(desiredInterval)
|
||||||
|
} else {
|
||||||
|
info("No GPS assistance desired, but sending UTC time to mesh")
|
||||||
|
sendPositionScoped()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue