improve location enabled check

This commit is contained in:
andrekir 2022-05-31 18:31:14 -03:00
parent 13fcf61cf4
commit 9b45ba84f7
2 changed files with 20 additions and 64 deletions

View file

@ -38,6 +38,12 @@ fun Context.hasCompanionDeviceApi(): Boolean =
packageManager.hasSystemFeature(PackageManager.FEATURE_COMPANION_DEVICE_SETUP)
else false
/**
* @return true if the device has a GPS receiver
*/
fun Context.hasGps(): Boolean =
packageManager.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS)
/**
* return a list of the permissions we don't have
*/