refactor: remove BACKGROUND_LOCATION permission

This commit is contained in:
andrekir 2024-08-26 19:31:41 -03:00 committed by Andre K
parent b4cdbf0617
commit 3a97e6dbcb
6 changed files with 19 additions and 56 deletions

View file

@ -145,21 +145,6 @@ fun Context.getLocationPermissions(): Array<String> {
/** @return true if the user already has location permission */
fun Context.hasLocationPermission() = getLocationPermissions().isEmpty()
/**
* A list of missing background location permissions (or empty if we already have what we need)
*/
fun Context.getBackgroundPermissions(): Array<String> {
val perms = mutableListOf(Manifest.permission.ACCESS_FINE_LOCATION)
if (android.os.Build.VERSION.SDK_INT >= 29) // only added later
perms.add(Manifest.permission.ACCESS_BACKGROUND_LOCATION)
return getMissingPermissions(perms)
}
/** @return true if the user already has background location permission */
fun Context.hasBackgroundPermission() = getBackgroundPermissions().isEmpty()
/**
* Notification permission (or empty if we already have what we need)
*/