mirror of
https://github.com/YTVanced/VancedMicroG
synced 2024-12-30 11:31:06 +00:00
Ignore longstanding gps requests with more than 30s request interval
This commit is contained in:
parent
aea55a5c90
commit
74c0e28e27
1 changed files with 7 additions and 0 deletions
|
@ -30,6 +30,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
@SuppressWarnings("MissingPermission")
|
||||
public class RealLocationProvider {
|
||||
public static final String TAG = "GmsLocProviderReal";
|
||||
private static final int MIN_GPS_TIME = 30000;
|
||||
|
||||
private final LocationManager locationManager;
|
||||
private final String name;
|
||||
|
@ -119,6 +120,12 @@ public class RealLocationProvider {
|
|||
if (sb.length() != 0) sb.append(", ");
|
||||
sb.append(request.packageName).append(":").append(request.locationRequest.getInterval()).append("ms");
|
||||
}
|
||||
if (minTime > MIN_GPS_TIME && name.equals("gps")) {
|
||||
Log.d(TAG, name + ": ignoring request as " + minTime + "ms (" + sb + "), is less than " + MIN_GPS_TIME);
|
||||
locationManager.removeUpdates(listener);
|
||||
connected.set(false);
|
||||
return;
|
||||
}
|
||||
Log.d(TAG, name + ": requesting location updates with interval " + minTime + "ms (" + sb + "), minDistance=" + minDistance);
|
||||
if (connected.get()) {
|
||||
if (connectedMinTime != minTime || connectedMinDistance != minDistance) {
|
||||
|
|
Loading…
Reference in a new issue