mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 06:45:19 +00:00
wifi aware wip
This commit is contained in:
@@ -67,6 +67,11 @@ class PermissionManager(private val context: Context) {
|
||||
Manifest.permission.ACCESS_FINE_LOCATION
|
||||
))
|
||||
|
||||
// Wi‑Fi Aware: Android 13+ requires NEARBY_WIFI_DEVICES runtime permission
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
permissions.add(Manifest.permission.NEARBY_WIFI_DEVICES)
|
||||
}
|
||||
|
||||
// Notification permission intentionally excluded to keep it optional
|
||||
|
||||
return permissions
|
||||
@@ -177,6 +182,20 @@ class PermissionManager(private val context: Context) {
|
||||
)
|
||||
)
|
||||
|
||||
// Wi‑Fi Aware category (Android 13+)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
val wifiAwarePermissions = listOf(Manifest.permission.NEARBY_WIFI_DEVICES)
|
||||
categories.add(
|
||||
PermissionCategory(
|
||||
type = PermissionType.WIFI_AWARE,
|
||||
description = "Enable Wi‑Fi Aware to discover and connect to nearby bitchat users over Wi‑Fi.",
|
||||
permissions = wifiAwarePermissions,
|
||||
isGranted = wifiAwarePermissions.all { isPermissionGranted(it) },
|
||||
systemDescription = "Allow bitchat to discover nearby Wi‑Fi devices"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// Notifications category (if applicable)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
categories.add(
|
||||
@@ -262,6 +281,7 @@ enum class PermissionType(val nameValue: String) {
|
||||
PRECISE_LOCATION("Precise Location"),
|
||||
MICROPHONE("Microphone"),
|
||||
NOTIFICATIONS("Notifications"),
|
||||
WIFI_AWARE("Wi‑Fi Aware"),
|
||||
BATTERY_OPTIMIZATION("Battery Optimization"),
|
||||
OTHER("Other")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user