42 lines
1.5 KiB
Diff
42 lines
1.5 KiB
Diff
|
|
From b5ee33076e1868c5946345b2cfb15a519b8c2577 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Jeff Vander Stoep <jeffv@google.com>
|
||
|
|
Date: Mon, 5 Dec 2022 12:42:22 +0100
|
||
|
|
Subject: [PATCH 2/2] Use older API to avoid requiring API v30
|
||
|
|
|
||
|
|
Test: Check that keystore still outputs logs to system
|
||
|
|
Bug: 221185310
|
||
|
|
Change-Id: If81d66cb145cbb41b4338fd64ac024d77243482e
|
||
|
|
---
|
||
|
|
src/lib.rs | 14 ++++----------
|
||
|
|
1 file changed, 4 insertions(+), 10 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/src/lib.rs b/src/lib.rs
|
||
|
|
index 4bcce0c..59f942b 100644
|
||
|
|
--- a/src/lib.rs
|
||
|
|
+++ b/src/lib.rs
|
||
|
|
@@ -111,17 +111,11 @@ impl LogId {
|
||
|
|
/// Output log to android system.
|
||
|
|
#[cfg(target_os = "android")]
|
||
|
|
fn android_log(log_id: log_ffi::log_id_t, prio: log_ffi::LogPriority, tag: &CStr, msg: &CStr) {
|
||
|
|
- let mut message = log_ffi::__android_log_message {
|
||
|
|
- struct_size: std::mem::size_of::<log_ffi::__android_log_message>(),
|
||
|
|
- buffer_id: log_id as i32,
|
||
|
|
- priority: prio as i32,
|
||
|
|
- tag: tag.as_ptr() as *const log_ffi::c_char,
|
||
|
|
- file: ptr::null(),
|
||
|
|
- line: 0,
|
||
|
|
- message: msg.as_ptr() as *const log_ffi::c_char,
|
||
|
|
- };
|
||
|
|
unsafe {
|
||
|
|
- log_ffi::__android_log_write_log_message(&mut message as *mut _);
|
||
|
|
+ log_ffi::__android_log_buf_write(log_id as i32,
|
||
|
|
+ prio as i32,
|
||
|
|
+ tag.as_ptr() as *const log_ffi::c_char,
|
||
|
|
+ msg.as_ptr() as *const log_ffi::c_char);
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
--
|
||
|
|
2.39.0.rc0.267.gcb52ba06e7-goog
|
||
|
|
|