Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

onProviderDisabled/Enabled is not working properly #123

Closed
Larnoo opened this issue Oct 11, 2016 · 2 comments
Closed

onProviderDisabled/Enabled is not working properly #123

Larnoo opened this issue Oct 11, 2016 · 2 comments
Assignees

Comments

@Larnoo
Copy link

Larnoo commented Oct 11, 2016

  • When gps provider status changed, the onProviderDisabled/Enabled is working properly.
  • But when network provider status changed, the onProviderDisabled/Enabled is not working properly。
  • (I close wifi , mobile data, change to airplane mode. the onProviderDisabled/Enabled is not work.)
@ecgreb ecgreb self-assigned this Oct 12, 2016
@ecgreb
Copy link
Collaborator

ecgreb commented Oct 12, 2016

We are looking into this. Initial testing seems to indicate the callbacks are triggered when a provider is disabled using the location system settings (toggling mode between high accuracy, battery saving, and device only) but not when enabled.

Also please be aware that LocationListener.onProviderDisabled() and LocationListener.onProviderDisabled() will soon be deprecated in favor of LocationAvailability.

@ecgreb ecgreb added ready and removed in progress labels Oct 21, 2016
@ecgreb ecgreb removed their assignment Oct 26, 2016
@sarahsnow1 sarahsnow1 self-assigned this Nov 3, 2016
@ecgreb
Copy link
Collaborator

ecgreb commented Nov 9, 2016

So it turns out these methods are actually working as expected according to the Android docs.

These methods are called if the LocationListener has been registered with the location manager service using the requestLocationUpdates(String, long, float, LocationListener) method.

Lost registers its listeners with the LocationManager selectively based on the priority set when creating a location request.

For example if the priority is PRIORITY_BALANCED_POWER_ACCURACY then no listener will be set on the GPS provider and enabled/disabled callbacks will not be invoked for it. However callbacks will still be invoked for the network provider.

Documentation and demo app have been updated here #137.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants