isuPatches / android-wisefy

Wrapper around WifiManager and ConnectivityManager for Android
Apache License 2.0
312 stars 38 forks source link

MAINTANENCE - Android P Support #116

Closed isuPatches closed 5 years ago

isuPatches commented 6 years ago

As a developer, I want to support Android P once the APIs are stable and finalized so that I am using the latest Android version.

ans-4175 commented 5 years ago

Hey, nice work on wiseFy. Just curious, whats your idea/strategy to implement/tackle android P support? We are also facing same issue, till we found out your libs

isuPatches commented 5 years ago

Honestly I have not had time to evaluate what is necessary to support Android P. I believe it will be much more in-depth than I would like as the documentation indicates scanning should happen in a receiver and be relayed back from the library to the client using it.

https://developer.android.com/guide/topics/connectivity/wifi-scan

I've considered a BehaviorSubject from within a receiver, but want to make sure there aren't any async or other memory issues that could arise.

There will also need to be documentation and a major version bump for this task. I am more than willing to accept help and a PR for this :)

isuPatches commented 5 years ago
Android 9 and later:

A successful call to WifiManager.startScan() requires all of the following conditions to be met:

Your app has the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permission.
Your app has the CHANGE_WIFI_STATE permission.
Location services are enabled on the device (under Settings > Location).
To successfully call WifiManager.getScanResults() ensure all of the following conditions are met:

Your app has the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permission.
Your app has the ACCESS_WIFI_STATE permission.
Location services are enabled on the device (under Settings > Location).
If the calling app doesn't meet all of these requirements, the call fails with a SecurityException.

That's going to be important. Permissions will need to be evaluated for 9.0+ support. I may have done myself a disservice by testing and limiting to the 8.0 specifications of:

Android 8.0 and Android 8.1:

A successful call to WifiManager.getScanResults() requires any one of the following permissions:

ACCESS_FINE_LOCATION
ACCESS_COARSE_LOCATION
CHANGE_WIFI_STATE
If the calling app does not have any of these permissions, the call fails with a SecurityException.
isuPatches commented 5 years ago

126 Is almost complete for adding initial Android P support.

What I've done:

Yet to do: