Created
August 4, 2022 16:15
-
-
Save SerggioC/9b2bfa0349e711f674e0d4c54ce45c3e to your computer and use it in GitHub Desktop.
Retrieve All Android Manifest Permissions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@JvmStatic | |
fun retrieveAllManifestPermissions(context: Context): Array<String> { | |
return try { | |
context | |
.packageManager | |
.getPackageInfo(context.packageName, PackageManager.GET_PERMISSIONS) | |
.requestedPermissions | |
} catch (e: Exception) { | |
emptyArray() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment