diff options
Diffstat (limited to 'libs/binder/IInterface.cpp')
| -rw-r--r-- | libs/binder/IInterface.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libs/binder/IInterface.cpp b/libs/binder/IInterface.cpp index 99a9ffeea2..8c60dc4f7e 100644 --- a/libs/binder/IInterface.cpp +++ b/libs/binder/IInterface.cpp @@ -27,14 +27,18 @@ IInterface::IInterface() IInterface::~IInterface() { } -sp<IBinder> IInterface::asBinder() +// static +sp<IBinder> IInterface::asBinder(const IInterface* iface) { - return onAsBinder(); + if (iface == NULL) return NULL; + return const_cast<IInterface*>(iface)->onAsBinder(); } -sp<const IBinder> IInterface::asBinder() const +// static +sp<IBinder> IInterface::asBinder(const sp<IInterface>& iface) { - return const_cast<IInterface*>(this)->onAsBinder(); + if (iface == NULL) return NULL; + return iface->onAsBinder(); } // --------------------------------------------------------------------------- |