Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33983b12 authored by Andrei Homescu's avatar Andrei Homescu
Browse files

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
parent 209c251c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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