This file contains hidden or 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
List<ApplicationInfo> packages = getPackageManager().getInstalledApplications(PackageManager.GET_META_DATA); | |
for (ApplicationInfo applicationInfo : packages) { | |
try { | |
PackageInfo packageInfo = getPackageManager().getPackageInfo(applicationInfo.packageName, PackageManager.GET_PERMISSIONS); | |
// Get all requested permissions for the current for loop package | |
String[] requestedPermissions = packageInfo.requestedPermissions; | |
// It's also possible to get if a permission has been granted to the current for loop package. |