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

Location Service enable settings does not work on some of Huawei and Mi devices #251

Open
sabid-habib opened this issue Sep 3, 2018 · 0 comments

Comments

@sabid-habib
Copy link

The locationServicesEnabled() method on LocationState class only checks if the current "location_mode" is 0 or not.
It assumes that each device will return '0' when location service is off.
But on some of huawei devices(lollipop and marshmallow) and Xiaomi devices, "location_mode" returns '2' when location service is OFF.
Again, samsung lollipop devices return "location_mode" as '1' when location service is on.
Whereas other devices set "location_mode" as '3' when location service is on.

Considering all the devices, the locationServicesEnabled() should return the following:

return locationMode %2 != 0;

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

No branches or pull requests

1 participant