summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-11-28 19:56:15 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-11-28 19:56:15 +0000
commit10739fad4e7d8f5552a8034ae0b08c51645b1770 (patch)
treebf5e07ac6ffd39f5fda6d7e00d364024b66b843a
parent053585ce146df0898081cf9825ba738a0041580c (diff)
parentfc3b6a1c37bab89c94861b93867ba430117c5db6 (diff)
downloadnative-10739fad4e7d8f5552a8034ae0b08c51645b1770.tar.gz
Merge "Merge "No need for lazy_static as Mutex::new is now const." am: a236a2c136" into main-16k
-rw-r--r--libs/binder/rust/Android.bp2
-rw-r--r--libs/binder/rust/src/native.rs7
2 files changed, 2 insertions, 7 deletions
diff --git a/libs/binder/rust/Android.bp b/libs/binder/rust/Android.bp
index 738d16ac66..afd414a7cb 100644
--- a/libs/binder/rust/Android.bp
+++ b/libs/binder/rust/Android.bp
@@ -17,7 +17,6 @@ rust_library {
rustlibs: [
"libbinder_ndk_sys",
"libdowncast_rs",
- "liblazy_static",
"liblibc",
],
host_supported: true,
@@ -160,7 +159,6 @@ rust_test {
rustlibs: [
"libbinder_ndk_sys",
"libdowncast_rs",
- "liblazy_static",
"liblibc",
],
}
diff --git a/libs/binder/rust/src/native.rs b/libs/binder/rust/src/native.rs
index dee05d07cf..6f686fbd93 100644
--- a/libs/binder/rust/src/native.rs
+++ b/libs/binder/rust/src/native.rs
@@ -22,7 +22,6 @@ use crate::parcel::{BorrowedParcel, Serialize};
use crate::proxy::SpIBinder;
use crate::sys;
-use lazy_static::lazy_static;
use std::convert::TryFrom;
use std::ffi::{c_void, CStr, CString};
use std::fs::File;
@@ -508,10 +507,8 @@ pub struct LazyServiceGuard {
_private: (),
}
-lazy_static! {
- // Count of how many LazyServiceGuard objects are in existence.
- static ref GUARD_COUNT: Mutex<u64> = Mutex::new(0);
-}
+// Count of how many LazyServiceGuard objects are in existence.
+static GUARD_COUNT: Mutex<u64> = Mutex::new(0);
impl LazyServiceGuard {
/// Create a new LazyServiceGuard to prevent the service manager prematurely killing this