diff --git a/remoteauth/service/jni/Android.bp b/remoteauth/service/jni/Android.bp index fc91e0ccbc..57e3ec9e99 100644 --- a/remoteauth/service/jni/Android.bp +++ b/remoteauth/service/jni/Android.bp @@ -13,7 +13,6 @@ rust_defaults { rustlibs: [ "libbinder_rs", "libjni_legacy", - "liblazy_static", "liblog_rust", "liblogger", "libnum_traits", diff --git a/remoteauth/service/jni/src/remoteauth_jni_android_platform.rs b/remoteauth/service/jni/src/remoteauth_jni_android_platform.rs index 421fe7ec3f..9add6dfa21 100644 --- a/remoteauth/service/jni/src/remoteauth_jni_android_platform.rs +++ b/remoteauth/service/jni/src/remoteauth_jni_android_platform.rs @@ -21,12 +21,11 @@ use jni::objects::{GlobalRef, JMethodID, JObject, JValue}; use jni::signature::TypeSignature; use jni::sys::{jbyteArray, jint, jlong, jvalue}; use jni::{JNIEnv, JavaVM}; -use lazy_static::lazy_static; use log::{debug, error, info}; use std::collections::HashMap; use std::sync::{ atomic::{AtomicI64, Ordering}, - Arc, Mutex, + Arc, LazyLock, Mutex, }; /// Macro capturing the name of the function calling this macro. @@ -51,11 +50,9 @@ macro_rules! function_name { }}; } -lazy_static! { - static ref HANDLE_MAPPING: Mutex>>> = - Mutex::new(HashMap::new()); - static ref HANDLE_RN: AtomicI64 = AtomicI64::new(0); -} +static HANDLE_MAPPING: LazyLock>>>> = + LazyLock::new(|| Mutex::new(HashMap::new())); +static HANDLE_RN: AtomicI64 = AtomicI64::new(0); fn generate_platform_handle() -> i64 { HANDLE_RN.fetch_add(1, Ordering::SeqCst)