0

When i execute requestLocationUpdates like this :

FusedLocationProviderClient fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);    

LocationRequest locationRequest = new LocationRequest();
locationRequest.setInterval(150000);
locationRequest.setFastestInterval(30000);
locationRequest.setMaxWaitTime(900000);
locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
locationRequest.setSmallestDisplacement(0);

fusedLocationProviderClient.requestLocationUpdates(locationRequest, getPendingIntent(context));

then the onReceive(Context context, Intent intent) is immediatly fired without taking care of the setMaxWaitTime(900000). Is it a normal/documented behavior ?

zeus
  • 12,173
  • 9
  • 63
  • 184

1 Answers1

1

In LocationUpdatesPendingIntent there is a small disclaimer:

    // Sets the maximum time when batched location updates are delivered. Updates may be
    // delivered sooner than this interval.
    mLocationRequest.setMaxWaitTime(MAX_WAIT_TIME);
MeliX
  • 230
  • 1
  • 6
  • thanks Melix, however what mean sooner ? immediatly (like I notice), 1 min? 10 min? In fact what i would like to know it's what they mean by "sooner", for the very first call to requestLocationUpdates – zeus Oct 02 '18 at 11:18