Allow silent package install for device owner.

Allow the device owner to silently install and remove packages using the
PackageInstaller APIs. Show notifications to the user after the
installation / deletion was successful.

Bug: 19422461
Change-Id: I0506e18c510efd9d04c4aea9b60a37456e689615
This commit is contained in:
Benjamin Franz
2015-02-18 16:11:18 +00:00
parent 80ac603651
commit 39fb7fd730
9 changed files with 186 additions and 11 deletions

View File

@@ -44,7 +44,8 @@ interface IPackageInstaller {
void registerCallback(IPackageInstallerCallback callback, int userId);
void unregisterCallback(IPackageInstallerCallback callback);
void uninstall(String packageName, int flags, in IntentSender statusReceiver, int userId);
void uninstall(String packageName, String callerPackageName, int flags,
in IntentSender statusReceiver, int userId);
void setPermissionsResult(int sessionId, boolean accepted);
}

View File

@@ -423,7 +423,7 @@ public class PackageInstaller {
*/
public void uninstall(@NonNull String packageName, @NonNull IntentSender statusReceiver) {
try {
mInstaller.uninstall(packageName, 0, statusReceiver, mUserId);
mInstaller.uninstall(packageName, mInstallerPackageName, 0, statusReceiver, mUserId);
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
}