Question: what does the rxLocation.activity().requestUpdates() timeout argument do?
agramian opened this issue · 2 comments
What is the purpose of the timeout parameter to the requestUpdates()
method for the ActivityRecognition
api since this is not a standard parameter to the actual api? Does this control the timeout when trying to connect to the google api client or when to cancel the observable if not updates are received? Something else? Will removeUpdates()
automatically be handled on timeout or would it still need to be called?
From the readme:
An optional global default timeout for all Location API requests made through the library can be set via rxLocation.setDefaultTimeout(...). In addition, timeouts can be set when creating a new Observable by providing timeout parameters, e.g. rxLocation.geofencing().add(geofencingRequest, pendingIntent, 15, TimeUnit.SECONDS). These parameters override the default timeout. When a timeout occurs, a StatusException is provided via onError(). Keep in mind that these timeouts only apply to calls to the Location API, e.g. when registering a location update listener. As an example, the timeout provided to rxLocation.location().updates(locationRequest, 15, TimeUnit.Seconds) does not mean that you will not receive location updates anymore after 15 seconds. Use setExpirationDuration() on your locationRequest for this use case.