mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-11-10 16:02:25 +01:00
wireless: ask for Android 17's local network permission, without which the car never hears from the phone
This commit is contained in:
1 parent
1514721498
commit
909c3549d6
2 files changed
+5
-1
No files matched your search
@@ -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()
|
||||
|
||||
|
||||
Reference in new issue
Block a user