Update calls to IInterface::asBinder()
to use the new static version.
Change-Id: I88ee037c66aa254f466d3a51ddc358bd37cf44b5
diff --git a/core/jni/android_hardware_camera2_legacy_LegacyCameraDevice.cpp b/core/jni/android_hardware_camera2_legacy_LegacyCameraDevice.cpp
index 8440a0e..35e9a1c 100644
--- a/core/jni/android_hardware_camera2_legacy_LegacyCameraDevice.cpp
+++ b/core/jni/android_hardware_camera2_legacy_LegacyCameraDevice.cpp
@@ -604,7 +604,7 @@
ALOGE("%s: Could not retrieve IGraphicBufferProducer from surface.", __FUNCTION__);
return 0;
}
- sp<IBinder> b = gbp->asBinder();
+ sp<IBinder> b = IInterface::asBinder(gbp);
if (b == NULL) {
ALOGE("%s: Could not retrieve IBinder from surface.", __FUNCTION__);
return 0;
diff --git a/core/jni/android_view_Surface.cpp b/core/jni/android_view_Surface.cpp
index a0b2ca8..428a761 100644
--- a/core/jni/android_view_Surface.cpp
+++ b/core/jni/android_view_Surface.cpp
@@ -324,7 +324,7 @@
// update the Surface only if the underlying IGraphicBufferProducer
// has changed.
if (self != NULL
- && (self->getIGraphicBufferProducer()->asBinder() == binder)) {
+ && (IInterface::asBinder(self->getIGraphicBufferProducer()) == binder)) {
// same IGraphicBufferProducer, return ourselves
return jlong(self.get());
}
@@ -354,7 +354,7 @@
return;
}
sp<Surface> self(reinterpret_cast<Surface *>(nativeObject));
- parcel->writeStrongBinder( self != 0 ? self->getIGraphicBufferProducer()->asBinder() : NULL);
+ parcel->writeStrongBinder( self != 0 ? IInterface::asBinder(self->getIGraphicBufferProducer()) : NULL);
}
namespace uirenderer {
diff --git a/libs/common_time/common_clock_service.cpp b/libs/common_time/common_clock_service.cpp
index 9ca6f35..592ab1d 100644
--- a/libs/common_time/common_clock_service.cpp
+++ b/libs/common_time/common_clock_service.cpp
@@ -99,14 +99,14 @@
Mutex::Autolock lock(mCallbackLock);
// check whether this is a duplicate
for (size_t i = 0; i < mListeners.size(); i++) {
- if (mListeners[i]->asBinder() == listener->asBinder())
+ if (IInterface::asBinder(mListeners[i]) == IInterface::asBinder(listener))
return ALREADY_EXISTS;
}
}
mListeners.add(listener);
mTimeServer.reevaluateAutoDisableState(0 != mListeners.size());
- return listener->asBinder()->linkToDeath(this);
+ return IInterface::asBinder(listener)->linkToDeath(this);
}
status_t CommonClockService::unregisterListener(
@@ -117,8 +117,8 @@
{ // scoping for autolock pattern
Mutex::Autolock lock(mCallbackLock);
for (size_t i = 0; i < mListeners.size(); i++) {
- if (mListeners[i]->asBinder() == listener->asBinder()) {
- mListeners[i]->asBinder()->unlinkToDeath(this);
+ if (IInterface::asBinder(mListeners[i]) == IInterface::asBinder(listener)) {
+ IInterface::asBinder(mListeners[i])->unlinkToDeath(this);
mListeners.removeAt(i);
ret_val = OK;
break;
@@ -136,7 +136,7 @@
{ // scoping for autolock pattern
Mutex::Autolock lock(mCallbackLock);
for (size_t i = 0; i < mListeners.size(); i++) {
- if (mListeners[i]->asBinder() == who) {
+ if (IInterface::asBinder(mListeners[i]) == who) {
mListeners.removeAt(i);
break;
}
diff --git a/libs/storage/IMountService.cpp b/libs/storage/IMountService.cpp
index 7ac7737..c643ed0 100644
--- a/libs/storage/IMountService.cpp
+++ b/libs/storage/IMountService.cpp
@@ -64,7 +64,7 @@
{
Parcel data, reply;
data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
- data.writeStrongBinder(listener->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(listener));
if (remote()->transact(TRANSACTION_registerListener, data, &reply) != NO_ERROR) {
ALOGD("registerListener could not contact remote\n");
return;
@@ -80,7 +80,7 @@
{
Parcel data, reply;
data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
- data.writeStrongBinder(listener->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(listener));
if (remote()->transact(TRANSACTION_unregisterListener, data, &reply) != NO_ERROR) {
ALOGD("unregisterListener could not contact remote\n");
return;
@@ -413,7 +413,7 @@
{
Parcel data, reply;
data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
- data.writeStrongBinder(observer->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(observer));
if (remote()->transact(TRANSACTION_shutdown, data, &reply) != NO_ERROR) {
ALOGD("shutdown could not contact remote\n");
return;
@@ -450,7 +450,7 @@
data.writeString16(rawPath);
data.writeString16(canonicalPath);
data.writeString16(key);
- data.writeStrongBinder(token->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(token));
data.writeInt32(nonce);
if (remote()->transact(TRANSACTION_mountObb, data, &reply) != NO_ERROR) {
ALOGD("mountObb could not contact remote\n");
@@ -470,7 +470,7 @@
data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
data.writeString16(filename);
data.writeInt32(force ? 1 : 0);
- data.writeStrongBinder(token->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(token));
data.writeInt32(nonce);
if (remote()->transact(TRANSACTION_unmountObb, data, &reply) != NO_ERROR) {
ALOGD("unmountObb could not contact remote\n");
diff --git a/media/jni/android_media_MediaHTTPConnection.cpp b/media/jni/android_media_MediaHTTPConnection.cpp
index 0e7d83e..7226ef5 100644
--- a/media/jni/android_media_MediaHTTPConnection.cpp
+++ b/media/jni/android_media_MediaHTTPConnection.cpp
@@ -128,7 +128,7 @@
JNIEnv *env, jobject thiz) {
sp<JMediaHTTPConnection> conn = getObject(env, thiz);
- return javaObjectForIBinder(env, conn->getIMemory()->asBinder());
+ return javaObjectForIBinder(env, IInterface::asBinder(conn->getIMemory()));
}
static jint android_media_MediaHTTPConnection_native_readAt(