Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05faaa85 authored by Matt Gilbride's avatar Matt Gilbride Committed by Automerger Merge Worker
Browse files

Merge "Add hidden Binder.getCallingUidOrWtf" am: e5a82fc9 am: fca24e39

parents ee4a8619 fca24e39
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -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