Skip to content
Commit 33fbd09b authored by mattgilbride's avatar mattgilbride
Browse files

Remove stack trace from Binder#getCallingUidOrWtf

Rather than Log.wtfStack, use Slog.wtf if Binder#getCallingUidOrThrow
would throw. Accept an argument for the caller to provide a message in
the resulting log, if generated.

This has the following advantages over the previous design:
1. Collecting a stack is expensive, so it wouldn't be possible to use
   the previous design in hot codepaths.
2. Using Slog instead of Log.wtf means neither app processes nor
   system_server would crash. We don't necessarily need to crash app
   processes as this method is for information gathering purposes only.
3. Accepting a message as a parameter allows immediate callers to
   identify themselves without needing a stack trace.

We plan to use this method in code generated by the AIDL compiler for
system services. This will inform the decision making process w.r.t. the
migration to getCallingUidOrThrow.

Bug: 252975769
Test: TH

Change-Id: If072c80d380aa9db63e5bf075944980e035bb922
parent 6192fb8f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment