(Please let me know if this is not the correct place for this. Suggestions as to what is the right place are appreciated.)

I maintain a legacy app for my company, and I'm not what you'd call an expert. As part of the Android 17 (API 37) updates, I'm trying to figure out if our app requires the ACCESS_LOCAL_NETWORK permission. Here's some links:

Main documentation:

https://developer.android.com/privacy-and-security/local-network-permission

These restrictions are implemented deep in the networking stack, and thus they apply to all networking APIs. This includes sockets created in the platform or managed code, networking libraries like Cronet and OkHttp, and any APIs implemented on top of those. Trying to resolve services on the local network that have a .local suffix requires local network permission.

Policy announcement:

https://support.google.com/googleplay/android-developer/answer/18100766

This permission is restricted to apps that need it for core functionality when device pickers are insufficient. Apps targeting Android 17 or higher (API 37+) must submit a Play Console declaration to use this permission.

FAQ on policy declaration and allowed use-cases:

https://support.google.com/googleplay/android-developer/answer/16935362#local_network_permission&zippy=%2Cdeclaration-guidance%2Cfrequently-asked-questions

Our app uses OkHttp to connect to a bog-standard REST API, sometimes hosted on the local network (LAN), sometimes on cloud servers (internet). These connections are super-simple, we send messages (with data), get replies (with data).

I don't have access to Android 17 hardware, so I'm testing with an Android Studio emulated device, running API 37.2.

I have questions:

1) I've added the ACCESS_LOCAL_NETWORK permission to the app, and I'm running tests with it allowed and not allowed. Turns out that I can connect to our LAN test servers over quite happily (e.g. "http://localserver.domain.local/api"). No problems at all. But reading the above this should not be possible?

Trying to resolve services on the local network that have a .local suffix requires local network permission.

2) We actually have a published version of the app live on the Play Store which has this in the manifest:

<uses-permission android:name="android.permission.ACCESS_LOCAL_NETWORK" /> 

The above links suggest that we need to complete a policy declaration. I've looked around in the console and can't find anything that asks for this. The Policy Status pages have nothing outstanding. All seems fine.

3) I wonder if our app would qualify for one of the use-cases listed by Google (3rd link). LAN (and Internet) connectivity is very much an integral part of the app, but doesn't seem to fit into their list. I'd ask, but since I can't find a way to complete a policy declaration, then that doesn't appear to be an option.

What's going on here?

submitted by /u/jfffj
[link] [comments]