diff options
author | Luca Stefani <luca.stefani.ge1@gmail.com> | 2024-01-16 14:00:52 +0100 |
---|---|---|
committer | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2024-01-22 09:25:10 +0000 |
commit | 7a24b135c2805686a800735945a02808f66ace13 (patch) | |
tree | dced8b5a77ead22b9b41275363ce22b4c8b8ecb8 | |
parent | a0aec5d84bd6364b647d3a624f9ae74c2a994081 (diff) | |
download | aidl-7a24b135c2805686a800735945a02808f66ace13.tar.gz |
Don't use lazy_static to create Mutex
Since rust 1.63 Mutex::new is const.
The underlying data type is wrapped with Option so
we can drop the need to lazy static init the mutex.
Test: aidl_unittests
Change-Id: Iae0c4f71e1a1d1e75cffef5f075bac78c9bd3e49
33 files changed, 50 insertions, 202 deletions
diff --git a/build/aidl_rust_source_provider.go b/build/aidl_rust_source_provider.go index 1b916002..59eb4779 100644 --- a/build/aidl_rust_source_provider.go +++ b/build/aidl_rust_source_provider.go @@ -95,7 +95,7 @@ func (sp *aidlRustSourceProvider) SourceProviderProps() []interface{} { func (sp *aidlRustSourceProvider) SourceProviderDeps(ctx rust.DepsContext, deps rust.Deps) rust.Deps { deps = sp.BaseSourceProvider.SourceProviderDeps(ctx, deps) - deps.Rustlibs = append(deps.Rustlibs, "libbinder_rs", "liblazy_static") + deps.Rustlibs = append(deps.Rustlibs, "libbinder_rs") deps.Rustlibs = append(deps.Rustlibs, wrap("", getImportsWithVersion(ctx, sp.properties.AidlInterfaceName, sp.properties.Version), "-"+langRust)...) deps.ProcMacros = append(deps.ProcMacros, "libasync_trait") // Add a depencency to the source module (*-rust-source) directly via `ctx` because diff --git a/build/aidl_test.go b/build/aidl_test.go index e4948142..7468e893 100644 --- a/build/aidl_test.go +++ b/build/aidl_test.go @@ -151,11 +151,6 @@ func _testAidl(t *testing.T, bp string, customizers ...android.FixturePreparer) sysroot: true, } rust_library { - name: "liblazy_static", - crate_name: "lazy_static", - srcs: [""], - } - rust_library { name: "libbinder_rs", crate_name: "binder", srcs: [""], diff --git a/generate_rust.cpp b/generate_rust.cpp index b274737c..d49c02c2 100644 --- a/generate_rust.cpp +++ b/generate_rust.cpp @@ -842,11 +842,8 @@ void GenerateRustInterface(CodeWriter* code_writer, const AidlInterface* iface, // Emit the default implementation code outside the trait *code_writer << "pub type " << default_ref_name << " = Option<std::sync::Arc<dyn " << default_trait_name << ">>;\n"; - *code_writer << "use lazy_static::lazy_static;\n"; - *code_writer << "lazy_static! {\n"; - *code_writer << " static ref DEFAULT_IMPL: std::sync::Mutex<" << default_ref_name + *code_writer << "static DEFAULT_IMPL: std::sync::Mutex<" << default_ref_name << "> = std::sync::Mutex::new(None);\n"; - *code_writer << "}\n"; // Emit the interface constants GenerateConstantDeclarations(*code_writer, *iface, typenames); diff --git a/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs b/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs index f2a0c04a..ec07a4c7 100644 --- a/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs +++ b/tests/golden_output/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs @@ -499,10 +499,7 @@ pub mod r#IRepeatFixedSizeArray { pub const r#Repeat2dParcelables: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 7; } pub type IRepeatFixedSizeArrayDefaultRef = Option<std::sync::Arc<dyn IRepeatFixedSizeArrayDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IRepeatFixedSizeArrayDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IRepeatFixedSizeArrayDefaultRef> = std::sync::Mutex::new(None); impl BpRepeatFixedSizeArray { fn build_parcel_RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; @@ -1045,10 +1042,7 @@ pub mod r#IEmptyInterface { pub mod transactions { } pub type IEmptyInterfaceDefaultRef = Option<std::sync::Arc<dyn IEmptyInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpEmptyInterface { } impl IEmptyInterface for BpEmptyInterface { diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs index 8b221b9d..a97b01e3 100644 --- a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs +++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs @@ -89,10 +89,7 @@ pub mod r#IEmptyInterface { pub mod transactions { } pub type IEmptyInterfaceDefaultRef = Option<std::sync::Arc<dyn IEmptyInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpEmptyInterface { } impl IEmptyInterface for BpEmptyInterface { @@ -176,10 +173,7 @@ pub mod r#IMyInterface { pub const r#methodWithInterfaces: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type IMyInterfaceDefaultRef = Option<std::sync::Arc<dyn IMyInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IMyInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IMyInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpMyInterface { fn build_parcel_methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs index 8c05d30f..9cdfa573 100644 --- a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs +++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs @@ -72,10 +72,7 @@ pub mod transactions { pub const r#GetTestService: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type ICircularDefaultRef = Option<std::sync::Arc<dyn ICircularDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<ICircularDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<ICircularDefaultRef> = std::sync::Mutex::new(None); impl BpCircular { fn build_parcel_GetTestService(&self) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs index f41ac0f3..59e70ca4 100644 --- a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs +++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs @@ -65,10 +65,7 @@ pub trait IDeprecatedDefault: Send + Sync { pub mod transactions { } pub type IDeprecatedDefaultRef = Option<std::sync::Arc<dyn IDeprecatedDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IDeprecatedDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<IDeprecatedDefaultRef> = std::sync::Mutex::new(None); impl BpDeprecated { } impl IDeprecated for BpDeprecated { diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs index cb63b656..7b4e3f91 100644 --- a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs +++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs @@ -72,10 +72,7 @@ pub mod transactions { pub const r#GetName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type INamedCallbackDefaultRef = Option<std::sync::Arc<dyn INamedCallbackDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<INamedCallbackDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<INamedCallbackDefaultRef> = std::sync::Mutex::new(None); impl BpNamedCallback { fn build_parcel_GetName(&self) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs index 05f75d3e..f2a8678c 100644 --- a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs +++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs @@ -72,10 +72,7 @@ pub mod transactions { pub const r#RealName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type INewNameDefaultRef = Option<std::sync::Arc<dyn INewNameDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<INewNameDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<INewNameDefaultRef> = std::sync::Mutex::new(None); impl BpNewName { fn build_parcel_RealName(&self) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs index 1af46299..279b6de1 100644 --- a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs +++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs @@ -72,10 +72,7 @@ pub mod transactions { pub const r#RealName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type IOldNameDefaultRef = Option<std::sync::Arc<dyn IOldNameDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IOldNameDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<IOldNameDefaultRef> = std::sync::Mutex::new(None); impl BpOldName { fn build_parcel_RealName(&self) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs index 96aee95b..b5f76951 100644 --- a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs +++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs @@ -765,10 +765,7 @@ pub mod transactions { pub const r#GetCircular: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 69; } pub type ITestServiceDefaultRef = Option<std::sync::Arc<dyn ITestServiceDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<ITestServiceDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<ITestServiceDefaultRef> = std::sync::Mutex::new(None); pub const r#CONSTANT: i32 = 42; pub const r#CONSTANT2: i32 = -42; pub const r#CONSTANT3: i32 = 42; @@ -4595,10 +4592,7 @@ pub mod r#CompilerChecks { pub mod transactions { } pub type IFooDefaultRef = Option<std::sync::Arc<dyn IFooDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IFooDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IFooDefaultRef> = std::sync::Mutex::new(None); impl BpFoo { } impl IFoo for BpFoo { @@ -4776,10 +4770,7 @@ pub mod r#CompilerChecks { pub const r#foo: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type INoPrefixInterfaceDefaultRef = Option<std::sync::Arc<dyn INoPrefixInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<INoPrefixInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<INoPrefixInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpNoPrefixInterface { fn build_parcel_foo(&self) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; @@ -4934,10 +4925,7 @@ pub mod r#CompilerChecks { pub const r#foo: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type INestedNoPrefixInterfaceDefaultRef = Option<std::sync::Arc<dyn INestedNoPrefixInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<INestedNoPrefixInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<INestedNoPrefixInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpNestedNoPrefixInterface { fn build_parcel_foo(&self) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs index 61dad7e7..81e634d9 100644 --- a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs +++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs @@ -89,10 +89,7 @@ pub mod r#IEmptyInterface { pub mod transactions { } pub type IEmptyInterfaceDefaultRef = Option<std::sync::Arc<dyn IEmptyInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpEmptyInterface { } impl IEmptyInterface for BpEmptyInterface { @@ -176,10 +173,7 @@ pub mod r#IMyInterface { pub const r#methodWithInterfaces: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type IMyInterfaceDefaultRef = Option<std::sync::Arc<dyn IMyInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IMyInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IMyInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpMyInterface { fn build_parcel_methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs index 5d3beca6..aaebf1cb 100644 --- a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs +++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs @@ -82,10 +82,7 @@ pub mod transactions { pub const r#flipStatusWithCallback: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1; } pub type INestedServiceDefaultRef = Option<std::sync::Arc<dyn INestedServiceDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<INestedServiceDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<INestedServiceDefaultRef> = std::sync::Mutex::new(None); impl BpNestedService { fn build_parcel_flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; @@ -298,10 +295,7 @@ pub mod r#ICallback { pub const r#done: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type ICallbackDefaultRef = Option<std::sync::Arc<dyn ICallbackDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<ICallbackDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<ICallbackDefaultRef> = std::sync::Mutex::new(None); impl BpCallback { fn build_parcel_done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs index b6b35026..9c5b7d0d 100644 --- a/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs +++ b/tests/golden_output/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs @@ -118,10 +118,7 @@ pub mod transactions { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type IFooInterfaceDefaultRef = Option<std::sync::Arc<dyn IFooInterfaceDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = 1; pub const HASH: &str = "9e7be1859820c59d9d55dd133e71a3687b5d2e5b"; impl BpFooInterface { diff --git a/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs index 7a696f7d..3c883b39 100644 --- a/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs +++ b/tests/golden_output/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs @@ -128,10 +128,7 @@ pub mod transactions { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type IFooInterfaceDefaultRef = Option<std::sync::Arc<dyn IFooInterfaceDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = 2; pub const HASH: &str = "da8c4bc94ca7feff0e0a65563a466787698b5891"; impl BpFooInterface { diff --git a/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs index 68e62cc6..17d1406d 100644 --- a/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs +++ b/tests/golden_output/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs @@ -128,10 +128,7 @@ pub mod transactions { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type IFooInterfaceDefaultRef = Option<std::sync::Arc<dyn IFooInterfaceDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = 3; pub const HASH: &str = "70d76c61eb0c82288e924862c10b910d1b7d8cf8"; impl BpFooInterface { diff --git a/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs b/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs index f2a0c04a..ec07a4c7 100644 --- a/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs +++ b/tests/golden_output/frozen/aidl-test-fixedsizearray-rust-source/gen/android/aidl/fixedsizearray/FixedSizeArrayExample.rs @@ -499,10 +499,7 @@ pub mod r#IRepeatFixedSizeArray { pub const r#Repeat2dParcelables: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 7; } pub type IRepeatFixedSizeArrayDefaultRef = Option<std::sync::Arc<dyn IRepeatFixedSizeArrayDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IRepeatFixedSizeArrayDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IRepeatFixedSizeArrayDefaultRef> = std::sync::Mutex::new(None); impl BpRepeatFixedSizeArray { fn build_parcel_RepeatBytes(&self, _arg_input: &[u8; 3], _arg_repeated: &mut [u8; 3]) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; @@ -1045,10 +1042,7 @@ pub mod r#IEmptyInterface { pub mod transactions { } pub type IEmptyInterfaceDefaultRef = Option<std::sync::Arc<dyn IEmptyInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpEmptyInterface { } impl IEmptyInterface for BpEmptyInterface { diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs index 8b221b9d..a97b01e3 100644 --- a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs +++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ArrayOfInterfaces.rs @@ -89,10 +89,7 @@ pub mod r#IEmptyInterface { pub mod transactions { } pub type IEmptyInterfaceDefaultRef = Option<std::sync::Arc<dyn IEmptyInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpEmptyInterface { } impl IEmptyInterface for BpEmptyInterface { @@ -176,10 +173,7 @@ pub mod r#IMyInterface { pub const r#methodWithInterfaces: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type IMyInterfaceDefaultRef = Option<std::sync::Arc<dyn IMyInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IMyInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IMyInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpMyInterface { fn build_parcel_methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_iface_array_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>], _arg_iface_array_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>, _arg_iface_array_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_array_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_array_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_array_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_17_ArrayOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs index 8c05d30f..9cdfa573 100644 --- a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs +++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ICircular.rs @@ -72,10 +72,7 @@ pub mod transactions { pub const r#GetTestService: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type ICircularDefaultRef = Option<std::sync::Arc<dyn ICircularDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<ICircularDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<ICircularDefaultRef> = std::sync::Mutex::new(None); impl BpCircular { fn build_parcel_GetTestService(&self) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs index f41ac0f3..59e70ca4 100644 --- a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs +++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs @@ -65,10 +65,7 @@ pub trait IDeprecatedDefault: Send + Sync { pub mod transactions { } pub type IDeprecatedDefaultRef = Option<std::sync::Arc<dyn IDeprecatedDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IDeprecatedDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<IDeprecatedDefaultRef> = std::sync::Mutex::new(None); impl BpDeprecated { } impl IDeprecated for BpDeprecated { diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs index cb63b656..7b4e3f91 100644 --- a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs +++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INamedCallback.rs @@ -72,10 +72,7 @@ pub mod transactions { pub const r#GetName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type INamedCallbackDefaultRef = Option<std::sync::Arc<dyn INamedCallbackDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<INamedCallbackDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<INamedCallbackDefaultRef> = std::sync::Mutex::new(None); impl BpNamedCallback { fn build_parcel_GetName(&self) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs index 05f75d3e..f2a8678c 100644 --- a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs +++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/INewName.rs @@ -72,10 +72,7 @@ pub mod transactions { pub const r#RealName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type INewNameDefaultRef = Option<std::sync::Arc<dyn INewNameDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<INewNameDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<INewNameDefaultRef> = std::sync::Mutex::new(None); impl BpNewName { fn build_parcel_RealName(&self) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs index 1af46299..279b6de1 100644 --- a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs +++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/IOldName.rs @@ -72,10 +72,7 @@ pub mod transactions { pub const r#RealName: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type IOldNameDefaultRef = Option<std::sync::Arc<dyn IOldNameDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IOldNameDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<IOldNameDefaultRef> = std::sync::Mutex::new(None); impl BpOldName { fn build_parcel_RealName(&self) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs index 96aee95b..b5f76951 100644 --- a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs +++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs @@ -765,10 +765,7 @@ pub mod transactions { pub const r#GetCircular: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 69; } pub type ITestServiceDefaultRef = Option<std::sync::Arc<dyn ITestServiceDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<ITestServiceDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<ITestServiceDefaultRef> = std::sync::Mutex::new(None); pub const r#CONSTANT: i32 = 42; pub const r#CONSTANT2: i32 = -42; pub const r#CONSTANT3: i32 = 42; @@ -4595,10 +4592,7 @@ pub mod r#CompilerChecks { pub mod transactions { } pub type IFooDefaultRef = Option<std::sync::Arc<dyn IFooDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IFooDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IFooDefaultRef> = std::sync::Mutex::new(None); impl BpFoo { } impl IFoo for BpFoo { @@ -4776,10 +4770,7 @@ pub mod r#CompilerChecks { pub const r#foo: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type INoPrefixInterfaceDefaultRef = Option<std::sync::Arc<dyn INoPrefixInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<INoPrefixInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<INoPrefixInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpNoPrefixInterface { fn build_parcel_foo(&self) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; @@ -4934,10 +4925,7 @@ pub mod r#CompilerChecks { pub const r#foo: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type INestedNoPrefixInterfaceDefaultRef = Option<std::sync::Arc<dyn INestedNoPrefixInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<INestedNoPrefixInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<INestedNoPrefixInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpNestedNoPrefixInterface { fn build_parcel_foo(&self) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs index 61dad7e7..81e634d9 100644 --- a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs +++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/ListOfInterfaces.rs @@ -89,10 +89,7 @@ pub mod r#IEmptyInterface { pub mod transactions { } pub type IEmptyInterfaceDefaultRef = Option<std::sync::Arc<dyn IEmptyInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IEmptyInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpEmptyInterface { } impl IEmptyInterface for BpEmptyInterface { @@ -176,10 +173,7 @@ pub mod r#IMyInterface { pub const r#methodWithInterfaces: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type IMyInterfaceDefaultRef = Option<std::sync::Arc<dyn IMyInterfaceDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IMyInterfaceDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IMyInterfaceDefaultRef> = std::sync::Mutex::new(None); impl BpMyInterface { fn build_parcel_methodWithInterfaces(&self, _arg_iface: &binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>, _arg_nullable_iface: Option<&binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_iface_list_in: &[binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>], _arg_iface_list_out: &mut Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>, _arg_iface_list_inout: &mut Vec<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>, _arg_nullable_iface_list_in: Option<&[Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>]>, _arg_nullable_iface_list_out: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>, _arg_nullable_iface_list_inout: &mut Option<Vec<Option<binder::Strong<dyn crate::mangled::_7_android_4_aidl_5_tests_16_ListOfInterfaces_15_IEmptyInterface>>>>) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs index 5d3beca6..aaebf1cb 100644 --- a/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs +++ b/tests/golden_output/frozen/aidl-test-interface-rust-source/gen/android/aidl/tests/nested/INestedService.rs @@ -82,10 +82,7 @@ pub mod transactions { pub const r#flipStatusWithCallback: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 1; } pub type INestedServiceDefaultRef = Option<std::sync::Arc<dyn INestedServiceDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<INestedServiceDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<INestedServiceDefaultRef> = std::sync::Mutex::new(None); impl BpNestedService { fn build_parcel_flipStatus(&self, _arg_p: &crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; @@ -298,10 +295,7 @@ pub mod r#ICallback { pub const r#done: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 0; } pub type ICallbackDefaultRef = Option<std::sync::Arc<dyn ICallbackDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<ICallbackDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<ICallbackDefaultRef> = std::sync::Mutex::new(None); impl BpCallback { fn build_parcel_done(&self, _arg_status: crate::mangled::_7_android_4_aidl_5_tests_6_nested_20_ParcelableWithNested_6_Status) -> binder::Result<binder::binder_impl::Parcel> { let mut aidl_data = self.binder.prepare_transact()?; diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs index b6b35026..9c5b7d0d 100644 --- a/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs +++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V1-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs @@ -118,10 +118,7 @@ pub mod transactions { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type IFooInterfaceDefaultRef = Option<std::sync::Arc<dyn IFooInterfaceDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = 1; pub const HASH: &str = "9e7be1859820c59d9d55dd133e71a3687b5d2e5b"; impl BpFooInterface { diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs index 7a696f7d..3c883b39 100644 --- a/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs +++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V2-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs @@ -128,10 +128,7 @@ pub mod transactions { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type IFooInterfaceDefaultRef = Option<std::sync::Arc<dyn IFooInterfaceDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = 2; pub const HASH: &str = "da8c4bc94ca7feff0e0a65563a466787698b5891"; impl BpFooInterface { diff --git a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs index 68e62cc6..17d1406d 100644 --- a/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs +++ b/tests/golden_output/frozen/aidl-test-versioned-interface-V3-rust-source/gen/android/aidl/versioned/tests/IFooInterface.rs @@ -128,10 +128,7 @@ pub mod transactions { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type IFooInterfaceDefaultRef = Option<std::sync::Arc<dyn IFooInterfaceDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<IFooInterfaceDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = 3; pub const HASH: &str = "70d76c61eb0c82288e924862c10b910d1b7d8cf8"; impl BpFooInterface { diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs index 5e1111e4..08428694 100644 --- a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs +++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs @@ -118,10 +118,7 @@ pub mod transactions { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type ITrunkStableTestDefaultRef = Option<std::sync::Arc<dyn ITrunkStableTestDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<ITrunkStableTestDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<ITrunkStableTestDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = 1; pub const HASH: &str = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f"; impl BpTrunkStableTest { @@ -642,10 +639,7 @@ pub mod r#IMyCallback { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type IMyCallbackDefaultRef = Option<std::sync::Arc<dyn IMyCallbackDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IMyCallbackDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IMyCallbackDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = 1; pub const HASH: &str = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f"; impl BpMyCallback { diff --git a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs index 14506762..fd3b0392 100644 --- a/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs +++ b/tests/golden_output/frozen/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs @@ -128,10 +128,7 @@ pub mod transactions { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type ITrunkStableTestDefaultRef = Option<std::sync::Arc<dyn ITrunkStableTestDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<ITrunkStableTestDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<ITrunkStableTestDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = if true {1} else {2}; pub const HASH: &str = if true {"88311b9118fb6fe9eff4a2ca19121de0587f6d5f"} else {"notfrozen"}; impl BpTrunkStableTest { @@ -752,10 +749,7 @@ pub mod r#IMyCallback { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type IMyCallbackDefaultRef = Option<std::sync::Arc<dyn IMyCallbackDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IMyCallbackDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IMyCallbackDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = if true {1} else {2}; pub const HASH: &str = if true {"88311b9118fb6fe9eff4a2ca19121de0587f6d5f"} else {"notfrozen"}; impl BpMyCallback { diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs index 5e1111e4..08428694 100644 --- a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs +++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V1-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs @@ -118,10 +118,7 @@ pub mod transactions { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type ITrunkStableTestDefaultRef = Option<std::sync::Arc<dyn ITrunkStableTestDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<ITrunkStableTestDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<ITrunkStableTestDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = 1; pub const HASH: &str = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f"; impl BpTrunkStableTest { @@ -642,10 +639,7 @@ pub mod r#IMyCallback { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type IMyCallbackDefaultRef = Option<std::sync::Arc<dyn IMyCallbackDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IMyCallbackDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IMyCallbackDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = 1; pub const HASH: &str = "88311b9118fb6fe9eff4a2ca19121de0587f6d5f"; impl BpMyCallback { diff --git a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs index e9899a1d..1c0fbf01 100644 --- a/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs +++ b/tests/golden_output/tests/trunk_stable_test/android.aidl.test.trunk-V2-rust-source/gen/android/aidl/test/trunk/ITrunkStableTest.rs @@ -128,10 +128,7 @@ pub mod transactions { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type ITrunkStableTestDefaultRef = Option<std::sync::Arc<dyn ITrunkStableTestDefault>>; -use lazy_static::lazy_static; -lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<ITrunkStableTestDefaultRef> = std::sync::Mutex::new(None); -} +static DEFAULT_IMPL: std::sync::Mutex<ITrunkStableTestDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = 2; pub const HASH: &str = "notfrozen"; impl BpTrunkStableTest { @@ -728,10 +725,7 @@ pub mod r#IMyCallback { pub const r#getInterfaceHash: binder::binder_impl::TransactionCode = binder::binder_impl::FIRST_CALL_TRANSACTION + 16777213; } pub type IMyCallbackDefaultRef = Option<std::sync::Arc<dyn IMyCallbackDefault>>; - use lazy_static::lazy_static; - lazy_static! { - static ref DEFAULT_IMPL: std::sync::Mutex<IMyCallbackDefaultRef> = std::sync::Mutex::new(None); - } + static DEFAULT_IMPL: std::sync::Mutex<IMyCallbackDefaultRef> = std::sync::Mutex::new(None); pub const VERSION: i32 = 2; pub const HASH: &str = "notfrozen"; impl BpMyCallback { |