diff options
| author | 2022-01-19 17:18:43 +0000 | |
|---|---|---|
| committer | 2022-01-19 17:18:43 +0000 | |
| commit | fd0693093e66d7725ee888eb5e0e48d32f24aad7 (patch) | |
| tree | 738710b7c2073c5ee753c232a1d271216d999b2f | |
| parent | ad0af1216a7b537857b99dd0c3a040b3f7a7b042 (diff) | |
| parent | ef3a33f37df7858dd80799c029d925fc429cde68 (diff) | |
Merge "Change IInterface default_impl to use sp<>" am: f9ce300c43 am: 1f7304de11 am: ef3a33f37d
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1950456
Change-Id: I9c7b54a51b8a4d24665948b92aa4b66fd3f43787
| -rw-r--r-- | libs/binder/include/binder/IInterface.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/libs/binder/include/binder/IInterface.h b/libs/binder/include/binder/IInterface.h index 7d14315b01..f295417ab2 100644 --- a/libs/binder/include/binder/IInterface.h +++ b/libs/binder/include/binder/IInterface.h @@ -93,20 +93,20 @@ protected: // ---------------------------------------------------------------------- -#define DECLARE_META_INTERFACE(INTERFACE) \ -public: \ - static const ::android::String16 descriptor; \ - static ::android::sp<I##INTERFACE> asInterface( \ - const ::android::sp<::android::IBinder>& obj); \ - virtual const ::android::String16& getInterfaceDescriptor() const; \ - I##INTERFACE(); \ - virtual ~I##INTERFACE(); \ - static bool setDefaultImpl(std::unique_ptr<I##INTERFACE> impl); \ - static const std::unique_ptr<I##INTERFACE>& getDefaultImpl(); \ -private: \ - static std::unique_ptr<I##INTERFACE> default_impl; \ -public: \ - +#define DECLARE_META_INTERFACE(INTERFACE) \ +public: \ + static const ::android::String16 descriptor; \ + static ::android::sp<I##INTERFACE> asInterface(const ::android::sp<::android::IBinder>& obj); \ + virtual const ::android::String16& getInterfaceDescriptor() const; \ + I##INTERFACE(); \ + virtual ~I##INTERFACE(); \ + static bool setDefaultImpl(::android::sp<I##INTERFACE> impl); \ + static const ::android::sp<I##INTERFACE>& getDefaultImpl(); \ + \ +private: \ + static ::android::sp<I##INTERFACE> default_impl; \ + \ +public: #define __IINTF_CONCAT(x, y) (x ## y) @@ -142,8 +142,8 @@ public: \ } \ return intr; \ } \ - std::unique_ptr<ITYPE> ITYPE::default_impl; \ - bool ITYPE::setDefaultImpl(std::unique_ptr<ITYPE> impl) { \ + ::android::sp<ITYPE> ITYPE::default_impl; \ + bool ITYPE::setDefaultImpl(::android::sp<ITYPE> impl) { \ /* Only one user of this interface can use this function */ \ /* at a time. This is a heuristic to detect if two different */ \ /* users in the same process use this function. */ \ @@ -154,7 +154,7 @@ public: \ } \ return false; \ } \ - const std::unique_ptr<ITYPE>& ITYPE::getDefaultImpl() { return ITYPE::default_impl; } \ + const ::android::sp<ITYPE>& ITYPE::getDefaultImpl() { return ITYPE::default_impl; } \ ITYPE::INAME() {} \ ITYPE::~INAME() {} |