diff options
author | Amith Yamasani <yamasani@google.com> | 2012-08-10 17:06:33 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2012-08-11 18:24:07 -0700 |
commit | 258848d2ae04f447ff1c18023fa76b139fcc0862 (patch) | |
tree | 8736421f4007d81206d0f0ea8b32a2013508976a /cmds/pm | |
parent | 75f0fac91bd7fa67fa76cfdd4e163b9f35be0432 (diff) | |
download | frameworks_base-258848d2ae04f447ff1c18023fa76b139fcc0862.zip frameworks_base-258848d2ae04f447ff1c18023fa76b139fcc0862.tar.gz frameworks_base-258848d2ae04f447ff1c18023fa76b139fcc0862.tar.bz2 |
User Manager service to manage users and query user details
Moved a bunch of methods from PackageManager to UserManager.
Fix launching of activities from recents to correct user.
Guest creation APIs
Change-Id: I0733405e6eb2829675665e225c759d6baa2b708f
Diffstat (limited to 'cmds/pm')
-rw-r--r-- | cmds/pm/src/com/android/commands/pm/Pm.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java index 4cb5270..eb1f9a2 100644 --- a/cmds/pm/src/com/android/commands/pm/Pm.java +++ b/cmds/pm/src/com/android/commands/pm/Pm.java @@ -20,6 +20,7 @@ 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; @@ -39,9 +40,11 @@ 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; @@ -59,6 +62,7 @@ import javax.crypto.spec.SecretKeySpec; public final class Pm { IPackageManager mPm; + IUserManager mUm; private WeakHashMap<String, Resources> mResourceCache = new WeakHashMap<String, Resources>(); @@ -82,6 +86,7 @@ public final class Pm { return; } + mUm = IUserManager.Stub.asInterface(ServiceManager.getService("user")); mPm = IPackageManager.Stub.asInterface(ServiceManager.getService("package")); if (mPm == null) { System.err.println(PM_NOT_RUNNING_ERR); @@ -985,7 +990,7 @@ public final class Pm { } name = arg; try { - if (mPm.createUser(name, 0) == null) { + if (mUm.createUser(name, 0) == null) { System.err.println("Error: couldn't create User."); showUsage(); } @@ -1017,7 +1022,7 @@ public final class Pm { return; } try { - if (!mPm.removeUser(userId)) { + if (!mUm.removeUser(userId)) { System.err.println("Error: couldn't remove user."); showUsage(); } @@ -1034,7 +1039,7 @@ public final class Pm { return; } try { - List<UserInfo> users = mPm.getUsers(); + List<UserInfo> users = mUm.getUsers(); if (users == null) { System.err.println("Error: couldn't get users"); } else { |