am 5d75052b: Merge "Add Binder.getCallingUserHandle()." into jb-mr1-dev
* commit '5d75052b2da7ed7c153faea69a28f13a4000788f': Add Binder.getCallingUserHandle().
This commit is contained in:
@@ -15617,6 +15617,7 @@ package android.os {
|
||||
method public static final void flushPendingCommands();
|
||||
method public static final int getCallingPid();
|
||||
method public static final int getCallingUid();
|
||||
method public static final android.os.UserHandle getCallingUserHandle();
|
||||
method public java.lang.String getInterfaceDescriptor();
|
||||
method public boolean isBinderAlive();
|
||||
method public static final void joinThreadPool();
|
||||
|
||||
@@ -64,7 +64,7 @@ public class Binder implements IBinder {
|
||||
public static final native int getCallingPid();
|
||||
|
||||
/**
|
||||
* Return the ID of the user assigned to the process that sent you the
|
||||
* Return the Linux uid assigned to the process that sent you the
|
||||
* current transaction that is being processed. This uid can be used with
|
||||
* higher-level system services to determine its identity and check
|
||||
* permissions. If the current thread is not currently executing an
|
||||
@@ -72,6 +72,18 @@ public class Binder implements IBinder {
|
||||
*/
|
||||
public static final native int getCallingUid();
|
||||
|
||||
/**
|
||||
* Return the UserHandle assigned to the process that sent you the
|
||||
* current transaction that is being processed. This is the user
|
||||
* of the caller. It is distinct from {@link #getCallingUid()} in that a
|
||||
* particular user will have multiple distinct apps running under it each
|
||||
* with their own uid. If the current thread is not currently executing an
|
||||
* incoming transaction, then its own UserHandle is returned.
|
||||
*/
|
||||
public static final UserHandle getCallingUserHandle() {
|
||||
return new UserHandle(UserHandle.getUserId(getCallingUid()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the identity of the incoming IPC on the current thread. This can
|
||||
* be useful if, while handling an incoming call, you will be calling
|
||||
|
||||
@@ -10851,7 +10851,7 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
builder.append("; this requires ");
|
||||
builder.append(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL);
|
||||
if (!requireFull) {
|
||||
builder.append("or");
|
||||
builder.append(" or ");
|
||||
builder.append(android.Manifest.permission.INTERACT_ACROSS_USERS);
|
||||
}
|
||||
String msg = builder.toString();
|
||||
|
||||
Reference in New Issue
Block a user