From e35fac3c67eddce263438a4a9e3fabef6a2b5c18 Mon Sep 17 00:00:00 2001 From: Moe Hamade <69801237+moehamade@users.noreply.github.com> Date: Sun, 26 Jul 2026 15:43:43 +0300 Subject: [PATCH] docs: correct ACCESS_LOCAL_NETWORK permission-group claim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Device testing on Android 17 (API 37) disproved the earlier claim that ACCESS_LOCAL_NETWORK is effectively free because it shares the NEARBY_DEVICES group with NEARBY_WIFI_DEVICES. Granting NEARBY_WIFI_DEVICES alone leaves ACCESS_LOCAL_NETWORK denied: pm grant ... NEARBY_WIFI_DEVICES -> NEARBY_WIFI_DEVICES: granted=true -> ACCESS_LOCAL_NETWORK: granted=false The two are tracked and granted independently, so ACCESS_LOCAL_NETWORK has to be requested explicitly. That is exactly what the wifiAwarePermissions() list already does, so no behavioural change is needed — only the comments were wrong. Whether the runtime dialog bundles the two into a single prompt remains unverified, since enabling Wi-Fi Aware from Debug Settings after onboarding never triggers a permission request at all (pre-existing, unrelated to this branch). Comment-only change. Co-Authored-By: Claude Opus 5 (1M context) --- app/src/main/AndroidManifest.xml | 4 ++-- .../com/bitchat/android/onboarding/PermissionManager.kt | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 341d39d76..870cd838e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -31,8 +31,8 @@ Android 17 (API 37) makes local network protection mandatory for apps targeting it. The Wi‑Fi Aware transport reaches peers over link-local IPv6 TCP sockets (WifiAwareMeshService.connectAwareClientSocket), so declare this defensively. - It belongs to the NEARBY_DEVICES group, so it does not add a prompt for users - who have already granted NEARBY_WIFI_DEVICES. + It belongs to the NEARBY_DEVICES group, but is granted independently of + NEARBY_WIFI_DEVICES, so it must be requested explicitly (see PermissionManager). --> diff --git a/app/src/main/java/com/bitchat/android/onboarding/PermissionManager.kt b/app/src/main/java/com/bitchat/android/onboarding/PermissionManager.kt index 787026b70..000a26754 100644 --- a/app/src/main/java/com/bitchat/android/onboarding/PermissionManager.kt +++ b/app/src/main/java/com/bitchat/android/onboarding/PermissionManager.kt @@ -45,8 +45,13 @@ class PermissionManager(private val context: Context) { * Android 17 (API 37) makes local network protection mandatory for apps that target it. * WifiAwareMeshService reaches peers over link-local IPv6 TCP sockets * (connectAwareClientSocket), so ACCESS_LOCAL_NETWORK is requested defensively there. - * It shares the NEARBY_DEVICES group with NEARBY_WIFI_DEVICES, so granting it does not - * cost the user an extra prompt. + * + * Note that although ACCESS_LOCAL_NETWORK shares the NEARBY_DEVICES group with + * NEARBY_WIFI_DEVICES, the two are tracked and granted independently: granting + * NEARBY_WIFI_DEVICES alone leaves ACCESS_LOCAL_NETWORK denied (verified on an + * Android 17 device). It must therefore be requested explicitly, which is what this + * list is for. Whether the runtime dialog bundles the two into a single prompt has + * not been verified. */ private fun wifiAwarePermissions(): List { val permissions = mutableListOf(Manifest.permission.NEARBY_WIFI_DEVICES)