czlucius / code-scanner

An Android app to scan and generate codes(barcodes/QR codes)
GNU Affero General Public License v3.0
39 stars 24 forks source link

Wi-Fi suggestion: ask for permission #40

Closed czlucius closed 1 year ago

czlucius commented 2 years ago

Is your feature request related to a problem? Please describe.

When adding Wi-Fi networks, for android 10+ permission needs to be granted. Currently its prompted at usage time once, but if user declines, they have to find their way through Settings and toggle it back on. Settings.ACTION_WIFI_ADD_NETWORKS seems like the most likely intent to launch this prompt, but this is not very well documented.

Describe the solution you'd like

If denied, ask user again and redirect to perms screen.

Describe alternatives you've considered

N/A

Additional context

https://developer.android.com/guide/topics/connectivity/wifi-suggest#change-approval https://developer.android.com/reference/android/provider/Settings#ACTION_WIFI_ADD_NETWORKS

KeshavAnandBhagat commented 1 year ago

Hi, Please assign me this issue if it still exists?

czlucius commented 1 year ago

Can you make a PR first with the code changes? This feature should be easy, and won't take much time to do. Thanks

KeshavAnandBhagat commented 1 year ago

ok i will make pr as soon as posible

Devansh-ops commented 1 year ago

Can adding a library to handle permissions fix this? https://github.com/guolindev/PermissionX

czlucius commented 1 year ago

Hi This issue has been fixed, I forgot to close this

The permission in question is also not a regular runtime permission, and requires special access. Hence, the library you mentioned also may not work.