code: 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;
      }
docs: Checks if an application with the passed name is the installer of the calling app.
  
  @param packageName The package name of the tested application.
  @return true if the application with the passed package is the installer.