Merge "Add hidden Binder.getCallingUidOrWtf" am: e5a82fc9a2 am: fca24e3971
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2324515 Change-Id: I9e5e8fa40d5819086b172302308330d18f3f380f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -354,6 +354,26 @@ public class Binder implements IBinder {
|
||||
return getCallingUid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Linux UID assigned to the process that sent the transaction
|
||||
* currently being processed.
|
||||
*
|
||||
* Logs WTF if the current thread is not currently
|
||||
* executing an incoming transaction and the calling identity has not been
|
||||
* explicitly set with {@link #clearCallingIdentity()}
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static final int getCallingUidOrWtf() {
|
||||
if (!isDirectlyHandlingTransaction() && !hasExplicitIdentity()) {
|
||||
Log.wtf(TAG,
|
||||
"Thread is not in a binder transaction, "
|
||||
+ "and the calling identity has not been "
|
||||
+ "explicitly set with clearCallingIdentity");
|
||||
}
|
||||
return getCallingUid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the UserHandle assigned to the process that sent you the
|
||||
* current transaction that is being processed. This is the user
|
||||
|
||||
Reference in New Issue
Block a user