summaryrefslogtreecommitdiffstats
path: root/cmds/pm
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-09-06 14:21:19 -0700
committerDianne Hackborn <hackbod@google.com>2012-09-07 13:55:23 -0700
commit5e03e2ca7d25b899b129baad2dd5eca6bf99d88a (patch)
tree10c601a58b0bbeb6902d43e0862c58f3ec121c78 /cmds/pm
parent970683c5d42a1d8588d656d4e570ce4f0f6e0abc (diff)
downloadframeworks_base-5e03e2ca7d25b899b129baad2dd5eca6bf99d88a.zip
frameworks_base-5e03e2ca7d25b899b129baad2dd5eca6bf99d88a.tar.gz
frameworks_base-5e03e2ca7d25b899b129baad2dd5eca6bf99d88a.tar.bz2
More multi-user stuff:
- New (hidden) isUserRunning() API. - Maintain LRU list of visited users. - New FLAG_IS_DATA_ONLY for ApplicationInfo. - Clean up pending intent records when force-stopping a user (or package). (Also fixes bug #6880627: PendingIntent.getService() returns stale intent of force stopped app) - Fix force-stopping when installing an app to do the force-stop across all users for that app. - When selecting which processes to kill during a force stop, do this based on the actual packages loaded in the process, not just process name matching. - You can now use --user option in am when starting activities, services, and instrumentation. - The am --user option accepts "current" and "all" as arguments. - The pm uninstall command now uninstalls for all users, so it matches the semantics of the install command. - PhoneWindowManager now explicitly says to start home in the current user. - Activity manager call to retrieve the MIME type from a content provider now takes a user argument, so it will direct this to the proper user. - The package manager uninstall paths are now implemented around PackageSetting, not PackageParser.Package. This allows them to work even if the application's apk has been removed (in which case it only exists as a PackageSetting, not the PackageParser.Package parsed from the apk). Change-Id: I3522f6fcf32603090bd6e01cc90ce70b6c5aae40
Diffstat (limited to 'cmds/pm')
-rw-r--r--cmds/pm/src/com/android/commands/pm/Pm.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java
index 36bf38a..8570f27 100644
--- a/cmds/pm/src/com/android/commands/pm/Pm.java
+++ b/cmds/pm/src/com/android/commands/pm/Pm.java
@@ -20,7 +20,6 @@ import com.android.internal.content.PackageHelper;
import android.app.ActivityManagerNative;
import android.content.ComponentName;
-import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.ContainerEncryptionParams;
import android.content.pm.FeatureInfo;
@@ -40,12 +39,9 @@ import android.content.pm.VerificationParams;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.net.Uri;
-import android.os.Binder;
import android.os.IUserManager;
-import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
-import android.os.UserManager;
import java.io.File;
import java.lang.reflect.Field;
@@ -74,7 +70,6 @@ public final class Pm {
private static final String PM_NOT_RUNNING_ERR =
"Error: Could not access the Package Manager. Is the system running?";
- private static final int ROOT_UID = 0;
public static void main(String[] args) {
new Pm().run(args);
@@ -1054,11 +1049,16 @@ public final class Pm {
}
private void runUninstall() {
- int unInstallFlags = 0;
+ int unInstallFlags = PackageManager.DELETE_ALL_USERS;
- String opt = nextOption();
- if (opt != null && opt.equals("-k")) {
- unInstallFlags = PackageManager.DELETE_KEEP_DATA;
+ String opt;
+ while ((opt=nextOption()) != null) {
+ if (opt.equals("-k")) {
+ unInstallFlags |= PackageManager.DELETE_KEEP_DATA;
+ } else {
+ System.err.println("Error: Unknown option: " + opt);
+ return;
+ }
}
String pkg = nextArg();