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
Loading
Please register or sign in to comment