public interface

PackageManagerPrivileged

masonamerica.platform.PackageManagerPrivileged

Summary

Public Methods
abstract void grantRuntimePermission(String packageName, String permissionName)
Grant a runtime permission to an application which the application does not already have.
abstract void installPackage(Uri targetApkUri)
Install an APK
abstract void revokeRuntimePermission(String packageName, String permissionName)
Revoke a runtime permission that was previously granted by ERROR(/#grantRuntimePermission(String, String, android.os.UserHandle)) for the current user.
abstract void uninstallPackage(String packageName)
Uninstall an APK

Public Methods

public abstract void grantRuntimePermission (String packageName, String permissionName)

Grant a runtime permission to an application which the application does not already have. The permission must have been requested by the application. If the application is not allowed to hold the permission, a SecurityException is thrown.

Parameters
packageName String: The package to which to grant the permission.
permissionName String: The permission name to grant.

public abstract void installPackage (Uri targetApkUri)

Install an APK

Parameters
targetApkUri Uri: the Uri to the apk file. Must be readable by other applications.

public abstract void revokeRuntimePermission (String packageName, String permissionName)

Revoke a runtime permission that was previously granted by ERROR(/#grantRuntimePermission(String, String, android.os.UserHandle)) for the current user. The permission must have been requested by and granted to the application. If the application is not allowed to hold the permission, a SecurityException is thrown.

Parameters
packageName String: The package from which to revoke the permission.
permissionName String: The permission name to revoke.n.

public abstract void uninstallPackage (String packageName)

Uninstall an APK

Parameters
packageName String: package name of the apk to uninstall. Not valid for system applications.