diff options
| author | Amith Yamasani <yamasani@google.com> | 2012-03-28 18:19:29 -0700 |
|---|---|---|
| committer | Amith Yamasani <yamasani@google.com> | 2012-03-28 18:19:29 -0700 |
| commit | 52f1d752f90579c9b57e3350393a029cf72138d0 (patch) | |
| tree | 8f8b5efabd4fea83c34b754cc0fd99a7580dfbac /core/java/android/app/ActivityManagerNative.java | |
| parent | 59075643acedd38e324746083e2c59f69c0b9e56 (diff) | |
Show the current user in power menu
Shows a little indicator next to the current user in the power menu
when multi-user is enabled.
Fixed a bug where Settings was sometimes being launched in the wrong
process when there are 2 instances running.
Change-Id: Iaf2a00f6d1871fd2a88d8982439e445423bb2896
Diffstat (limited to 'core/java/android/app/ActivityManagerNative.java')
| -rw-r--r-- | core/java/android/app/ActivityManagerNative.java | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index c4023298920d..5917cbf54e0d 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -25,6 +25,7 @@ import android.content.IntentSender; import android.content.pm.ApplicationInfo; import android.content.pm.ConfigurationInfo; import android.content.pm.IPackageDataObserver; +import android.content.pm.UserInfo; import android.content.res.Configuration; import android.graphics.Bitmap; import android.net.Uri; @@ -1494,7 +1495,15 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM reply.writeInt(result ? 1 : 0); return true; } - + + case GET_CURRENT_USER_TRANSACTION: { + data.enforceInterface(IActivityManager.descriptor); + UserInfo userInfo = getCurrentUser(); + reply.writeNoException(); + userInfo.writeToParcel(reply, 0); + return true; + } + case REMOVE_SUB_TASK_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); @@ -3530,7 +3539,19 @@ class ActivityManagerProxy implements IActivityManager data.recycle(); return result; } - + + public UserInfo getCurrentUser() throws RemoteException { + Parcel data = Parcel.obtain(); + Parcel reply = Parcel.obtain(); + data.writeInterfaceToken(IActivityManager.descriptor); + mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); + reply.readException(); + UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); + reply.recycle(); + data.recycle(); + return userInfo; + } + public boolean removeSubTask(int taskId, int subTaskIndex) throws RemoteException { Parcel data = Parcel.obtain(); Parcel reply = Parcel.obtain(); |
