getAppInfoCompat

@RequiresPermission(value = "android.permission.QUERY_ALL_PACKAGES")
fun PackageManager.getAppInfoCompat(packageName: String, flags: Int): ApplicationInfo

This function will query the ApplicationInfo of the packageName provided.

Will work only if Manifest.permission.QUERY_ALL_PACKAGES permission is present

Parameters

flags

are PackageManager.ApplicationInfoFlags and are listed as members of the PackageManager class.