Merge "Remove stack trace from Binder#getCallingUidOrWtf" am: 6d04006046

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2380512

Change-Id: I597f172672b8ffecb4fc88c6046c4a4abd74fe4d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Matt Gilbride
2023-01-11 20:06:08 +00:00
committed by Automerger Merge Worker

View File

@@ -358,16 +358,16 @@ public class Binder implements IBinder {
* Return the Linux UID assigned to the process that sent the transaction * Return the Linux UID assigned to the process that sent the transaction
* currently being processed. * currently being processed.
* *
* Logs WTF if the current thread is not currently * Slog.wtf if the current thread is not currently
* executing an incoming transaction and the calling identity has not been * executing an incoming transaction and the calling identity has not been
* explicitly set with {@link #clearCallingIdentity()} * explicitly set with {@link #clearCallingIdentity()}
* *
* @hide * @hide
*/ */
public static final int getCallingUidOrWtf() { public static final int getCallingUidOrWtf(String message) {
if (!isDirectlyHandlingTransaction() && !hasExplicitIdentity()) { if (!isDirectlyHandlingTransaction() && !hasExplicitIdentity()) {
Log.wtfStack(TAG, Slog.wtf(TAG,
"Thread is not in a binder transaction, " message + ": Thread is not in a binder transaction, "
+ "and the calling identity has not been " + "and the calling identity has not been "
+ "explicitly set with clearCallingIdentity"); + "explicitly set with clearCallingIdentity");
} }