mapbox / mapbox/mapbox-navigation-android

Mock location providers cause GPS fighting

Open
#4,520 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

jira-sync-complete
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.

![Screen Shot 2021-06-17 at 12 55 49 PM](https://user-images.githubusercontent.com/3021882/122464142-5a65bf80-cf6b-11eb-9cb4-2cb7747767f8.png)

### 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.