From bc7b1d53294085a33f17a73c717ee08e5fd27f50 Mon Sep 17 00:00:00 2001 From: Henri Chataing Date: Mon, 17 Mar 2025 08:27:06 -0700 Subject: gd: Fix SEC_TAG_BLUETOOTH_CONNECTION event android_log_event_list is not equivalent to an ostream formatter as each << parameter is generated as a separate parameter. The logging refactor failed to take this into account and inlined a StringPrintf call, thus increasing the parameter count. Bug: 403676434 Flag: EXEMPT, minor bug fix Test: m com.android.bt Change-Id: I10c72792232db3aef0e5b151aa967c95e604c877 --- system/gd/common/audit_log.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'system') diff --git a/system/gd/common/audit_log.cc b/system/gd/common/audit_log.cc index e83c2894f8..2e112a0c34 100644 --- a/system/gd/common/audit_log.cc +++ b/system/gd/common/audit_log.cc @@ -16,6 +16,8 @@ #include "common/audit_log.h" +#include + #ifdef __ANDROID__ #include #endif // __ANDROID__ @@ -43,8 +45,8 @@ void LogConnectionAdminAuditEvent([[maybe_unused]] const char* action, android_log_event_list(SEC_TAG_BLUETOOTH_CONNECTION) << address.ToRedactedStringForLogging() - << /* success */ int32_t(status == hci::ErrorCode::SUCCESS) << action << ": " - << ErrorCodeText(status) << LOG_ID_SECURITY; + << /* success */ int32_t(status == hci::ErrorCode::SUCCESS) + << std::format("{}: {}", action, ErrorCodeText(status)) << LOG_ID_SECURITY; #endif /* defined(__ANDROID__) && !defined (FUZZ_TARGET) */ } -- cgit v1.2.3-59-g8ed1b