public static boolean isPackageInstaller ( @ NotNull final Context context , final String packageName ) { final PackageManager packageManager = context . getPackageManager ( ) ; final String installerPackageName = packageManager . getInstallerPackageName ( context . getPackageName ( ) ) ; boolean isPackageInstaller = TextUtils . equals ( installerPackageName , packageName ) ; Logger . d ( "isPackageInstaller() is " , isPackageInstaller , " for " , packageName ) ; return isPackageInstaller ; }
Checks if an application with the passed name is the installer of the calling app .