Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15a1b155 authored by Fynn Godau's avatar Fynn Godau Committed by Marvin W.
Browse files

Really fix nearby permission check in settings view

parent 80b31293
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -131,7 +131,8 @@ class ExposureNotificationsPreferencesFragment : PreferenceFragmentCompat() {
            val advertisingSupported = if (bluetoothSupported == true) AdvertiserService.isSupported(appContext) else bluetoothSupported

            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
            }
            exposureNearbyNotGranted.isVisible = enabled && !nearbyPermissionsGranted