require update_distance AND update_interval to be fulfilled

The Android API allows to specify a distance and a time interval, after
which the app will be notified. Now, the check in APRSdroid is matched
to this behaviour and the documentation.
remotes/nogy/update_90
Georg Lukas 2010-03-01 12:27:38 +01:00
rodzic 05a4162136
commit 753034a26b
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -113,8 +113,8 @@ class AprsService extends Service with LocationListener {
val upd_int = prefs.getString("interval", "10").toInt * 60000
val upd_dist = prefs.getString("distance", "10").toInt * 1000
if (lastLoc != null &&
location.getTime - lastLoc.getTime < upd_int &&
location.distanceTo(lastLoc) < upd_dist) {
(location.getTime - lastLoc.getTime < upd_int ||
location.distanceTo(lastLoc) < upd_dist)) {
Log.d(TAG, "onLocationChanged: ignoring premature location")
return
}