summaryrefslogtreecommitdiffstats
path: root/cmds/pm
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2014-08-06 16:34:34 -0700
committerJeff Sharkey <jsharkey@google.com>2014-08-07 00:23:54 +0000
commitfbd0e9fa37fc17ccd25e4c1f16195bbd27de3c4c (patch)
treefb67a6cbd7f3b39bd82f22f1763a83c776fb08d6 /cmds/pm
parent905857f1b8708b1a7cf60a5e6b934b75ac6aea77 (diff)
downloadframeworks_base-fbd0e9fa37fc17ccd25e4c1f16195bbd27de3c4c.zip
frameworks_base-fbd0e9fa37fc17ccd25e4c1f16195bbd27de3c4c.tar.gz
frameworks_base-fbd0e9fa37fc17ccd25e4c1f16195bbd27de3c4c.tar.bz2
Surface user action events when un/installing.
This will be used shortly to connect up with permissions confirmation UI. Bug: 16515814 Change-Id: If28cecc28549900d960ac107a1fba0b10ce5bd7b
Diffstat (limited to 'cmds/pm')
-rw-r--r--cmds/pm/src/com/android/commands/pm/Pm.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index 1f25dd0..c5e91e3 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -19,12 +19,13 @@ package com.android.commands.pm;
import android.app.ActivityManager;
import android.app.ActivityManagerNative;
import android.app.IActivityManager;
+import android.app.PackageDeleteObserver;
import android.app.PackageInstallObserver;
import android.content.ComponentName;
+import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.FeatureInfo;
import android.content.pm.IPackageDataObserver;
-import android.content.pm.IPackageDeleteObserver;
import android.content.pm.IPackageInstaller;
import android.content.pm.IPackageManager;
import android.content.pm.InstallSessionInfo;
@@ -760,7 +761,7 @@ public final class Pm {
String extraPackage;
@Override
- public void packageInstalled(String name, Bundle extras, int status) {
+ public void onPackageInstalled(String name, int status, String msg, Bundle extras) {
synchronized (this) {
finished = true;
result = status;
@@ -790,6 +791,11 @@ public final class Pm {
}
@Override
+ public void onUserActionRequired(Intent intent) {
+ setResult(false, "Unexepected user action required!");
+ }
+
+ @Override
public void onSuccess() {
setResult(true, null);
}
@@ -1268,11 +1274,12 @@ public final class Pm {
}
}
- class PackageDeleteObserver extends IPackageDeleteObserver.Stub {
+ class LocalPackageDeleteObserver extends PackageDeleteObserver {
boolean finished;
boolean result;
- public void packageDeleted(String packageName, int returnCode) {
+ @Override
+ public void onPackageDeleted(String name, int returnCode, String msg) {
synchronized (this) {
finished = true;
result = returnCode == PackageManager.DELETE_SUCCEEDED;
@@ -1346,9 +1353,9 @@ public final class Pm {
}
private boolean deletePackage(String packageName, int flags, int userId) {
- PackageDeleteObserver obs = new PackageDeleteObserver();
+ LocalPackageDeleteObserver obs = new LocalPackageDeleteObserver();
try {
- mInstaller.uninstall(packageName, flags, obs, userId);
+ mInstaller.uninstall(packageName, flags, obs.getBinder(), userId);
synchronized (obs) {
while (!obs.finished) {