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
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 439b019..18877af 100644
--- a/libs/binder/ndk/include_cpp/android/binder_auto_utils.h
+++ b/libs/binder/ndk/include_cpp/android/binder_auto_utils.h
@@ -44,9 +44,14 @@
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