wireless: ask for Android 17's local network permission, without which the car never hears from the phone

This commit is contained in:
Seb3thehacker committed 2026-10-13 14:12:13 -07:00
1 parent 1514721498
commit 909c3549d6
2 files changed
+5 -1

No files matched your search

+2
View File
@@ -29,6 +29,8 @@
<uses-permission
android:name="android.permission.NEARBY_WIFI_DEVICES"
android:usesPermissionFlags="neverForLocation" />
<!-- Android 17 drops an app's traffic to the car's Wi-Fi without this. -->
<uses-permission android:name="android.permission.ACCESS_LOCAL_NETWORK" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@@ -31,10 +31,12 @@ import androidx.compose.ui.unit.dp
import androidx.core.content.ContextCompat
import app.seb3thehacker.gearslip.wireless.WirelessLink
/** What the wireless start-up needs: Bluetooth to reach the car, nearby Wi-Fi to join its network. */
/** What the wireless start-up needs: Bluetooth to reach the car, nearby Wi-Fi to join its network, local network to talk to it. */
private val WIRELESS_PERMISSIONS = buildList {
add(Manifest.permission.BLUETOOTH_CONNECT)
if (Build.VERSION.SDK_INT >= 33) add(Manifest.permission.NEARBY_WIFI_DEVICES)
// Android 17 silently drops traffic to local addresses, the car included, without it.
if (Build.VERSION.SDK_INT >= 37) add("android.permission.ACCESS_LOCAL_NETWORK")
add(Manifest.permission.ACCESS_FINE_LOCATION)
}.toTypedArray()