Improve tracker location
This commit is contained in:
parent
481feec24d
commit
477365f27a
3 changed files with 4 additions and 8 deletions
|
@ -46,8 +46,8 @@ class TelegramLocationProvider(private val app: TelegramApplication) : SensorEve
|
|||
private var fusedLocationProviderClient: FusedLocationProviderClient? = null
|
||||
private val locationRequest = LocationRequest().apply {
|
||||
interval = 1000
|
||||
fastestInterval = 500
|
||||
maxWaitTime = 2000
|
||||
//fastestInterval = 500
|
||||
maxWaitTime = 0
|
||||
priority = LocationRequest.PRIORITY_HIGH_ACCURACY
|
||||
}
|
||||
private val locationCallback = object : LocationCallback() {
|
||||
|
|
|
@ -82,11 +82,11 @@ class TelegramService : Service(), TelegramIncomingMessagesListener,
|
|||
|
||||
// Sets the fastest rate for active location updates. This interval is exact, and your
|
||||
// application will never receive updates more frequently than this value.
|
||||
fastestInterval = 500
|
||||
//fastestInterval = 500
|
||||
|
||||
// Sets the maximum time when batched location updates are delivered. Updates may be
|
||||
// delivered sooner than this interval.
|
||||
maxWaitTime = 2000
|
||||
maxWaitTime = 0
|
||||
|
||||
priority = LocationRequest.PRIORITY_HIGH_ACCURACY
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ import com.google.android.gms.location.LocationResult;
|
|||
import com.google.android.gms.location.LocationServices;
|
||||
import com.google.android.gms.tasks.OnSuccessListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.gms.tasks.Tasks;
|
||||
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.helpers.DayNightHelper;
|
||||
|
@ -22,9 +21,6 @@ import net.osmand.plus.helpers.LocationServiceHelper;
|
|||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
public class LocationServiceHelperImpl extends LocationServiceHelper {
|
||||
|
||||
|
|
Loading…
Reference in a new issue