mapbox / mapbox/mapbox-navigation-android
Mock location providers cause GPS fighting
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 651
- Forks
- 321
- PR merge metrics
- No merged PRs in 30d
Description
When setting up simulation environments, and replay environments. The locations will fight with the current GPS.

### Add a configuration to enable mock locations
There is a [Location.isMock](https://developer.android.com/reference/android/location/Location#isFromMockProvider()) available. When the configuration is enabled, do not accept locations that are not mocked.
This configuration can also filter for locations provided by mapbox location providers. Such as [ReplayRoute](https://github.com/mapbox/mapbox-navigation-android/blob/320b68a4f91573b4a381024121462ae740f0c82b/libnavigation-core/src/main/java/com/mapbox/navigation/core/replay/route/ReplayRouteMapper.kt#L140).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading libnavigation-core/src/main/java/com/mapbox/navigation/core/replay/route/ReplayRouteMapper.kt around the linked location-provider code and the Android Location.isFromMockProvider() reference. Trace where incoming locations are accepted, then define the configuration so enabled simulations accept mocked or Mapbox replay locations while rejecting other GPS locations; verify the GPS no longer competes with the simulation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100