If Android 9+, we need to check for ACCESS_FINE_LOCATION permissions
arsenal942 opened this issue · comments
Prerequisites
Check all boxes if you have done the following:
- [ x] Checked that your issue isn't already filed: https://github.com/tripflex/wifiwizard2/issues
- [ x] Make sure you fill out the Issue Type below
Issue type
Select all that apply
- Bug
- Enhancement
- Task
- Question
- Other
Description
In Android 9, there are permission restrictions on the getConnectionInfo method which returns a WiFiInfo object that describes the current WiFi connection. To call this, you require the following:
- ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION
- ACCESS_WIFI_STATE
Steps to Reproduce
- Try to call any method that calls getConnectionInfo
Expected behavior:
I expect the success callback to fire
Actual behavior:
The error callback fires
Reproduces how often:
100% of the time
Versions
Affects the current version and only Android devices that are running Android 9+
@tripflex I already have the fix in a fork so I'll submit a PR.
I had to urgently fix this for my application so feel free to clean it up a bit for your own needs.
Merged