| bymason.platform.PackageManagerPrivileged |
Privileged package management operations. Runs in system_server context \u2014 can grant/revoke runtime permissions synchronously.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Grant a runtime permission to an application which the application does not
already have.
| |||||||||||
Install an APK from the device storage.
| |||||||||||
Uninstall an APK.
| |||||||||||
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.
See also: PackageManager.PermissionFlags
| Parameters | |
|---|---|
packageName |
String: The package to which to grant the permission. |
permissionName |
String: The permission name to grant. |
Install an APK from the device storage.
Note: This method is currently not available. It will be enabled in a future OS release. Calling it will not produce an error, but the installation will not be performed.
| Parameters | |
|---|---|
targetApkUri |
Uri: the Uri to the apk file. Must be readable by other applications.
Use Uri format as file:///LOCATION-OF-THE-APP. For example: file:///Downloads/myapp.apk |
Uninstall an APK.
Note: This method is currently not available. It will be enabled in a future OS release. Calling it will not produce an error, but the uninstallation will not be performed.
| Parameters | |
|---|---|
packageName |
String: package name of the apk to uninstall. Not valid for system applications. |