Skip to content

Commit 5a870fe

Browse files
mcrJean-Baptiste Queru
authored andcommitted
Allow META* macros outside of the framework
The META* macros are useful outside of the framework for other systems implementing Binder interfaces, but they depend upon the android namespace. This includes the appropriate namespace operations, which should be sane even in that android namespace. Change-Id: If600156c65191f51f487d0ee301d9f9f532b263d
1 parent 2aba0ec commit 5a870fe

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

include/binder/IInterface.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,24 @@ class BpInterface : public INTERFACE, public BpRefBase
7272
// ----------------------------------------------------------------------
7373

7474
#define DECLARE_META_INTERFACE(INTERFACE) \
75-
static const String16 descriptor; \
76-
static sp<I##INTERFACE> asInterface(const sp<IBinder>& obj); \
77-
virtual const String16& getInterfaceDescriptor() const; \
75+
static const android::String16 descriptor; \
76+
static android::sp<I##INTERFACE> asInterface( \
77+
const android::sp<android::IBinder>& obj); \
78+
virtual const android::String16& getInterfaceDescriptor() const; \
7879
I##INTERFACE(); \
7980
virtual ~I##INTERFACE(); \
8081

8182

8283
#define IMPLEMENT_META_INTERFACE(INTERFACE, NAME) \
83-
const String16 I##INTERFACE::descriptor(NAME); \
84-
const String16& I##INTERFACE::getInterfaceDescriptor() const { \
84+
const android::String16 I##INTERFACE::descriptor(NAME); \
85+
const android::String16& \
86+
I##INTERFACE::getInterfaceDescriptor() const { \
8587
return I##INTERFACE::descriptor; \
8688
} \
87-
sp<I##INTERFACE> I##INTERFACE::asInterface(const sp<IBinder>& obj) \
89+
android::sp<I##INTERFACE> I##INTERFACE::asInterface( \
90+
const android::sp<android::IBinder>& obj) \
8891
{ \
89-
sp<I##INTERFACE> intr; \
92+
android::sp<I##INTERFACE> intr; \
9093
if (obj != NULL) { \
9194
intr = static_cast<I##INTERFACE*>( \
9295
obj->queryLocalInterface( \

0 commit comments

Comments
 (0)