mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
add location only logic
This commit is contained in:
parent
bb40672401
commit
e21f3fdf93
3 changed files with 27 additions and 4 deletions
|
|
@ -40,6 +40,18 @@ fun Context.getCameraPermissions(): List<String> {
|
|||
/** @return true if the user already has camera permission */
|
||||
fun Context.hasCameraPermission() = getCameraPermissions().isEmpty()
|
||||
|
||||
/**
|
||||
* Camera permission (or empty if we already have what we need)
|
||||
*/
|
||||
fun Context.getLocationPermissions(): List<String> {
|
||||
val perms = mutableListOf(Manifest.permission.ACCESS_FINE_LOCATION)
|
||||
|
||||
return getMissingPermissions(perms)
|
||||
}
|
||||
|
||||
/** @return true if the user already has camera permission */
|
||||
fun Context.hasLocationPermission() = getLocationPermissions().isEmpty()
|
||||
|
||||
/**
|
||||
* A list of missing background location permissions (or empty if we already have what we need)
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue