diff options
author | 2022-01-19 16:49:33 +0000 | |
---|---|---|
committer | 2022-01-19 16:49:33 +0000 | |
commit | 1f7304de1101a6871e62ca06a2cf773a00938a50 (patch) | |
tree | a3072d41480237a4c4cf61a395c391cda9dc14fd | |
parent | 46ea1d02a4d1af979ef5dd67ac9f5a2537549fa5 (diff) | |
parent | f9ce300c4399df1fd167fff6d333051c013df87f (diff) |
Merge "Change IInterface default_impl to use sp<>" am: f9ce300c43
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1950456
Change-Id: I7c0202ba6f0d218d14a141e97c888592a7d7c320
-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() {} |