mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2025-02-11 10:16:47 +01:00
Really fix nearby permission check in settings view
This commit is contained in:
parent
80b3129356
commit
15a1b15591
@ -131,7 +131,8 @@ class ExposureNotificationsPreferencesFragment : PreferenceFragmentCompat() {
|
|||||||
val advertisingSupported = if (bluetoothSupported == true) AdvertiserService.isSupported(appContext) else bluetoothSupported
|
val advertisingSupported = if (bluetoothSupported == true) AdvertiserService.isSupported(appContext) else bluetoothSupported
|
||||||
|
|
||||||
val nearbyPermissions = arrayOf("android.permission.BLUETOOTH_ADVERTISE", "android.permission.BLUETOOTH_SCAN")
|
val nearbyPermissions = arrayOf("android.permission.BLUETOOTH_ADVERTISE", "android.permission.BLUETOOTH_SCAN")
|
||||||
val nearbyPermissionsGranted = Build.VERSION.SDK_INT >= 31 || nearbyPermissions.all {
|
// Expresses implication (API 31+ → all new permissions granted) ≡ (¬API 31+ | all new permissions granted)
|
||||||
|
val nearbyPermissionsGranted = Build.VERSION.SDK_INT < 31 || nearbyPermissions.all {
|
||||||
ContextCompat.checkSelfPermission(appContext, it) == PackageManager.PERMISSION_GRANTED
|
ContextCompat.checkSelfPermission(appContext, it) == PackageManager.PERMISSION_GRANTED
|
||||||
}
|
}
|
||||||
exposureNearbyNotGranted.isVisible = enabled && !nearbyPermissionsGranted
|
exposureNearbyNotGranted.isVisible = enabled && !nearbyPermissionsGranted
|
||||||
|
Loading…
x
Reference in New Issue
Block a user