π§ β Continue scanning for 5 minutes after the geofence exit #225
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current implementation on android starts ranging for beacons after a geofence exit and gives up after 4 retries. This is known to work when the beacon is available at the start of the trip - e.g. walking to work with a beacon tracks, walking to work without a beacon does not.
But this may not work when the beacon is not at the start location. For example, if the geofence triggers as soon as a user leaves their work building, and then they have to walk several minutes to get to their car, the ranging will timeout and the trip will be missed. This is a bit less likely because our geofence radius is set to ~ half a block, but we still don't want to miss trips.
We should really handle this with monitoring versus ranging, but for now, we will at least bump up the duration for which the ranging happens.
The range callback is roughly once a minute
https://github.com/AltBeacon/android-beacon-library/blob/7af8419c404329ac7dc6001917b5962d2cd53a11/lib/src/main/java/org/altbeacon/beacon/RangeNotifier.java#L39
So let's scan 5 * 60 times (roughly 5 minutes) before giving up
This is the last change for e-mission/e-mission-docs#1062 before we move to staging