Merge branch 'master' into dev-app-intro

This commit is contained in:
Andre Kirchhoff 2022-08-16 19:13:19 -03:00 committed by GitHub
commit 25de235a93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 830 additions and 126 deletions

View file

@ -46,6 +46,16 @@ fun Context.hasCompanionDeviceApi(): Boolean =
fun Context.hasGps(): Boolean =
packageManager.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS)
/**
* return app install source (sideload = null)
*/
fun Context.installSource(): String? {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
packageManager.getInstallSourceInfo(packageName).installingPackageName
else
packageManager.getInstallerPackageName(packageName)
}
/**
* return a list of the permissions we don't have
*/