From 33983b12a8d9103eedf27d8f2b28486bcdcdfa75 Mon Sep 17 00:00:00 2001 From: Andrei Homescu Date: Mon, 5 Oct 2020 16:00:49 -0700 Subject: libbinder_ndk: Add default constructor for SpAIBinder This allows for default construction of SpAIBinder and AIDL structured parcelables. Bug: None Test: atest CtsNdkBinderTestCases binderVendorDoubleLoadTest libbinder_ndk_unit_test Change-Id: Ia2c6371e828f92cc0a42b3c57fcec3d11f3fedc6 --- libs/binder/ndk/include_cpp/android/binder_auto_utils.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/binder/ndk/include_cpp/android/binder_auto_utils.h b/libs/binder/ndk/include_cpp/android/binder_auto_utils.h index 439b019665..18877af32a 100644 --- a/libs/binder/ndk/include_cpp/android/binder_auto_utils.h +++ b/libs/binder/ndk/include_cpp/android/binder_auto_utils.h @@ -43,10 +43,15 @@ namespace ndk { */ class SpAIBinder { public: + /** + * Default constructor. + */ + SpAIBinder() : mBinder(nullptr) {} + /** * Takes ownership of one strong refcount of binder. */ - explicit SpAIBinder(AIBinder* binder = nullptr) : mBinder(binder) {} + explicit SpAIBinder(AIBinder* binder) : mBinder(binder) {} /** * Convenience operator for implicitly constructing an SpAIBinder from nullptr. This is not -- cgit v1.2.3-59-g8ed1b