Add permission for local network access and request it at API 37 - #1527
Add permission for local network access and request it at API 37#1527Matapii wants to merge 5 commits into
Conversation
|
Can't we ask for it only if needed if the endpoint is in the local network ? |
… local network address
|
I added some code to test if the URL of wallabag is in the local network and only then request that permission. I have no Android 17 device, so it would be nice if someone could test this change. |
Thanks for the update. I have tested the changes on an Pixel 7. After installing the app and immediately after the initial launch of it, the app is asking for the permission. I suppose this is not the intended behavior, maybe the default value of the URL in the settings is triggering this behavior. However, after granting the permission the app works again on Android 17. |
…d not directly at start with the default URL
|
Yes, thanks for testing. Good point. The URL default is only "https://" which might lead to the permission request trigger (InetAddress.getAllByName("") with empty string resolves to localhost https://docs.oracle.com/javase/8/docs/api/java/net/InetAddress.html#getAllByName-java.lang.String-). I move the check to the end of the configuration, when the config is okay. |
|
I have tested #1527 (comment). Good news is that the app is now starting up without asking for the permission right away. But the app is also not asking for it during the connection setup procedure, so that the original issue occurs. Nevertheless, the permission can be activated manually via android settings. |
|
Strange, it should ask right after the setup procedure, when the configuration is ok, see MainActivity.java line 957. Android 🙈 |
|
I decoupled the check from the connection wizard/config dialog. If it still does not work reliably, maybe you have got an idea? |
|
Added the check into |
Related to issue #1516
Add permission for local network access and request it at API 37. Tested successfully on Pixel 7.
Would be happy if the change makes it to master to make the app working again on Android 17.