summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Marco Nelissen <marcone@google.com> 2014-11-17 15:24:21 -0800
committer Marco Nelissen <marcone@google.com> 2015-03-31 20:32:30 +0000
commit5c6ec52ff8ab4e8471f98fe4fcde64221b23d72a (patch)
tree7173022a64ab1a526758d242a6a4db94116ec3e6
parent97e61fcf88af4ade0c83a569f45fe7a9ce12ccc2 (diff)
Add backwards compatible versions of IInterface::asBinder()
This makes apps linked against the previous non-static versions work with the new libbinder. Bug: 19060033 Bug: 19773812 Change-Id: I3b5c78cbb4f4c0681ca1042e4d8503d98f969502
-rw-r--r--libs/binder/IInterface.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/libs/binder/IInterface.cpp b/libs/binder/IInterface.cpp
index 8c60dc4f7e..2fcd3d92fb 100644
--- a/libs/binder/IInterface.cpp
+++ b/libs/binder/IInterface.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#define LOG_TAG "IInterface"
+#include <utils/Log.h>
#include <binder/IInterface.h>
namespace android {
@@ -41,6 +43,25 @@ sp<IBinder> IInterface::asBinder(const sp<IInterface>& iface)
return iface->onAsBinder();
}
+
// ---------------------------------------------------------------------------
}; // namespace android
+
+extern "C" {
+
+void _ZN7android10IInterface8asBinderEv(void *retval, void* self) {
+ ALOGW("deprecated asBinder call, please update your code");
+ //ALOGI("self: %p, retval: %p", self, retval);
+ android::sp<android::IBinder> *ret = new(retval) android::sp<android::IBinder>;
+ *ret = android::IInterface::asBinder((android::IInterface*)self);
+}
+
+void _ZNK7android10IInterface8asBinderEv(void *retval, void *self) {
+ ALOGW("deprecated asBinder call, please update your code");
+ //ALOGI("self: %p, retval: %p", self, retval);
+ android::sp<android::IBinder> *ret = new(retval) android::sp<android::IBinder>;
+ *ret = android::IInterface::asBinder((android::IInterface*)self);
+}
+
+} // extern "C"