Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Improve getCurrentPosition API #15094

Closed
wants to merge 2 commits into from

Commits on Jul 19, 2017

  1. Android: Improve getCurrentPosition API

    We ran into a couple of problems with the implementation of `getCurrentPosition` on Android:
      - It sometimes returns an inaccurate location
      - It times out when `enableHighAccuracy` is `true` (facebook#7495)
    
    This change improves `getCurrentPosition` for both of the above problems. Instead of calling `requestSingleUpdate` it now calls `requestLocationUpdates` so it can receive multiple locations giving it an opportunity to pick a better one. Unlike `requestSingleUpdate`, this approach doesn't seem to timeout when `enableHighAccuracy` is `true`.
    
    **Test plan (required)**
    
    Verified in a test app that `getCurrentPosition` returns a good location and doesn't timeout when `enableHighAccuracy` is `true`. Also, my team has been using this change in our app in production.
    
    Adam Comella
    Microsoft Corp.
    Adam Comella committed Jul 19, 2017
    Configuration menu
    Copy the full SHA
    f207ca2 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2017

  1. Update BUCK file so LocationModule can use FLog

    Adam Comella committed Aug 3, 2017
    Configuration menu
    Copy the full SHA
    c75d4c9 View commit details
    Browse the repository at this point in the history