@@ -115,7 +115,7 @@ class PermissionManager(private val context: Context) {
115115
116116 categories.add(
117117 PermissionCategory (
118- name = " Nearby Devices " ,
118+ type = PermissionType . NEARBY_DEVICES ,
119119 description = " Required to discover bitchat users via Bluetooth" ,
120120 permissions = bluetoothPermissions,
121121 isGranted = bluetoothPermissions.all { isPermissionGranted(it) },
@@ -131,7 +131,7 @@ class PermissionManager(private val context: Context) {
131131
132132 categories.add(
133133 PermissionCategory (
134- name = " Precise Location " ,
134+ type = PermissionType . PRECISE_LOCATION ,
135135 description = " Required by Android to discover nearby bitchat users via Bluetooth" ,
136136 permissions = locationPermissions,
137137 isGranted = locationPermissions.all { isPermissionGranted(it) },
@@ -143,7 +143,7 @@ class PermissionManager(private val context: Context) {
143143 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .TIRAMISU ) {
144144 categories.add(
145145 PermissionCategory (
146- name = " Notifications " ,
146+ type = PermissionType . NOTIFICATIONS ,
147147 description = " Notifications to keep you updated" ,
148148 permissions = listOf (Manifest .permission.POST_NOTIFICATIONS ),
149149 isGranted = isPermissionGranted(Manifest .permission.POST_NOTIFICATIONS ),
@@ -167,7 +167,7 @@ class PermissionManager(private val context: Context) {
167167 appendLine()
168168
169169 getCategorizedPermissions().forEach { category ->
170- appendLine(" ${category.name } : ${if (category.isGranted) " ✅ GRANTED" else " ❌ MISSING" } " )
170+ appendLine(" ${category.type.nameValue } : ${if (category.isGranted) " ✅ GRANTED" else " ❌ MISSING" } " )
171171 category.permissions.forEach { permission ->
172172 val granted = isPermissionGranted(permission)
173173 appendLine(" - ${permission.substringAfterLast(" ." )} : ${if (granted) " ✅" else " ❌" } " )
@@ -197,9 +197,16 @@ class PermissionManager(private val context: Context) {
197197 * Data class representing a category of related permissions
198198 */
199199data class PermissionCategory (
200- val name : String ,
200+ val type : PermissionType ,
201201 val description : String ,
202202 val permissions : List <String >,
203203 val isGranted : Boolean ,
204204 val systemDescription : String
205205)
206+
207+ enum class PermissionType (val nameValue : String ) {
208+ NEARBY_DEVICES (" Nearby Devices" ),
209+ PRECISE_LOCATION (" Precise Location" ),
210+ NOTIFICATIONS (" Notifications" ),
211+ OTHER (" Other" )
212+ }
0 commit comments