Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.
This repository was archived by the owner on May 15, 2024. It is now read-only.

GetCurrentLocation never returns when location services is disabled #476

@KristofferBerge

Description

@KristofferBerge

Bug report best practices: Submitting Issues

Description

Android phones failes to fetch location sometimes. No errors are thrown and the awaited method call to GetLocationAsync() never returns.

When debugging the source code I find that the call to GetBestProvider in Geolocation.android.cs/PlatformLocationAsync method returns the passive location provider when the GPS provider is not available. This provider relies on other applications to fetch the location and does not actually initiate any request. I'm not a 100% sure that this is the cause, but relying on the passive provider to fetch could probably cause this if we are not running any other applications that are actively requesting locations themselves at the same time.

https://developer.android.com/reference/android/location/LocationManager#PASSIVE_PROVIDER

Steps to Reproduce

  1. Disable location services
  2. Call Geolocation.GetLocationAsync()

Expected Behavior

Should return that no location could be found

Actual Behavior

Never returns

Basic Information

  • Version with issue: 0.10.0 and when building from source
  • Platform Target Frameworks: Android
    • Android: Tested on 5.0 and 8.1

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions