Merge "Update calls to IInterface::asBinder()"

This commit is contained in:
Marco Nelissen
2014-11-17 18:14:29 +00:00
committed by Gerrit Code Review
5 changed files with 14 additions and 14 deletions

View File

@@ -604,7 +604,7 @@ static jlong LegacyCameraDevice_nativeGetSurfaceId(JNIEnv* env, jobject thiz, jo
ALOGE("%s: Could not retrieve IGraphicBufferProducer from surface.", __FUNCTION__); ALOGE("%s: Could not retrieve IGraphicBufferProducer from surface.", __FUNCTION__);
return 0; return 0;
} }
sp<IBinder> b = gbp->asBinder(); sp<IBinder> b = IInterface::asBinder(gbp);
if (b == NULL) { if (b == NULL) {
ALOGE("%s: Could not retrieve IBinder from surface.", __FUNCTION__); ALOGE("%s: Could not retrieve IBinder from surface.", __FUNCTION__);
return 0; return 0;

View File

@@ -319,7 +319,7 @@ static jlong nativeReadFromParcel(JNIEnv* env, jclass clazz,
// update the Surface only if the underlying IGraphicBufferProducer // update the Surface only if the underlying IGraphicBufferProducer
// has changed. // has changed.
if (self != NULL if (self != NULL
&& (self->getIGraphicBufferProducer()->asBinder() == binder)) { && (IInterface::asBinder(self->getIGraphicBufferProducer()) == binder)) {
// same IGraphicBufferProducer, return ourselves // same IGraphicBufferProducer, return ourselves
return jlong(self.get()); return jlong(self.get());
} }
@@ -349,7 +349,7 @@ static void nativeWriteToParcel(JNIEnv* env, jclass clazz,
return; return;
} }
sp<Surface> self(reinterpret_cast<Surface *>(nativeObject)); sp<Surface> self(reinterpret_cast<Surface *>(nativeObject));
parcel->writeStrongBinder( self != 0 ? self->getIGraphicBufferProducer()->asBinder() : NULL); parcel->writeStrongBinder( self != 0 ? IInterface::asBinder(self->getIGraphicBufferProducer()) : NULL);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -99,14 +99,14 @@ status_t CommonClockService::registerListener(
Mutex::Autolock lock(mCallbackLock); Mutex::Autolock lock(mCallbackLock);
// check whether this is a duplicate // check whether this is a duplicate
for (size_t i = 0; i < mListeners.size(); i++) { 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; return ALREADY_EXISTS;
} }
} }
mListeners.add(listener); mListeners.add(listener);
mTimeServer.reevaluateAutoDisableState(0 != mListeners.size()); mTimeServer.reevaluateAutoDisableState(0 != mListeners.size());
return listener->asBinder()->linkToDeath(this); return IInterface::asBinder(listener)->linkToDeath(this);
} }
status_t CommonClockService::unregisterListener( status_t CommonClockService::unregisterListener(
@@ -117,8 +117,8 @@ status_t CommonClockService::unregisterListener(
{ // scoping for autolock pattern { // scoping for autolock pattern
Mutex::Autolock lock(mCallbackLock); Mutex::Autolock lock(mCallbackLock);
for (size_t i = 0; i < mListeners.size(); i++) { for (size_t i = 0; i < mListeners.size(); i++) {
if (mListeners[i]->asBinder() == listener->asBinder()) { if (IInterface::asBinder(mListeners[i]) == IInterface::asBinder(listener)) {
mListeners[i]->asBinder()->unlinkToDeath(this); IInterface::asBinder(mListeners[i])->unlinkToDeath(this);
mListeners.removeAt(i); mListeners.removeAt(i);
ret_val = OK; ret_val = OK;
break; break;
@@ -136,7 +136,7 @@ void CommonClockService::binderDied(const wp<IBinder>& who) {
{ // scoping for autolock pattern { // scoping for autolock pattern
Mutex::Autolock lock(mCallbackLock); Mutex::Autolock lock(mCallbackLock);
for (size_t i = 0; i < mListeners.size(); i++) { for (size_t i = 0; i < mListeners.size(); i++) {
if (mListeners[i]->asBinder() == who) { if (IInterface::asBinder(mListeners[i]) == who) {
mListeners.removeAt(i); mListeners.removeAt(i);
break; break;
} }

View File

@@ -64,7 +64,7 @@ public:
{ {
Parcel data, reply; Parcel data, reply;
data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
data.writeStrongBinder(listener->asBinder()); data.writeStrongBinder(IInterface::asBinder(listener));
if (remote()->transact(TRANSACTION_registerListener, data, &reply) != NO_ERROR) { if (remote()->transact(TRANSACTION_registerListener, data, &reply) != NO_ERROR) {
ALOGD("registerListener could not contact remote\n"); ALOGD("registerListener could not contact remote\n");
return; return;
@@ -80,7 +80,7 @@ public:
{ {
Parcel data, reply; Parcel data, reply;
data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
data.writeStrongBinder(listener->asBinder()); data.writeStrongBinder(IInterface::asBinder(listener));
if (remote()->transact(TRANSACTION_unregisterListener, data, &reply) != NO_ERROR) { if (remote()->transact(TRANSACTION_unregisterListener, data, &reply) != NO_ERROR) {
ALOGD("unregisterListener could not contact remote\n"); ALOGD("unregisterListener could not contact remote\n");
return; return;
@@ -413,7 +413,7 @@ public:
{ {
Parcel data, reply; Parcel data, reply;
data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
data.writeStrongBinder(observer->asBinder()); data.writeStrongBinder(IInterface::asBinder(observer));
if (remote()->transact(TRANSACTION_shutdown, data, &reply) != NO_ERROR) { if (remote()->transact(TRANSACTION_shutdown, data, &reply) != NO_ERROR) {
ALOGD("shutdown could not contact remote\n"); ALOGD("shutdown could not contact remote\n");
return; return;
@@ -450,7 +450,7 @@ public:
data.writeString16(rawPath); data.writeString16(rawPath);
data.writeString16(canonicalPath); data.writeString16(canonicalPath);
data.writeString16(key); data.writeString16(key);
data.writeStrongBinder(token->asBinder()); data.writeStrongBinder(IInterface::asBinder(token));
data.writeInt32(nonce); data.writeInt32(nonce);
if (remote()->transact(TRANSACTION_mountObb, data, &reply) != NO_ERROR) { if (remote()->transact(TRANSACTION_mountObb, data, &reply) != NO_ERROR) {
ALOGD("mountObb could not contact remote\n"); ALOGD("mountObb could not contact remote\n");
@@ -470,7 +470,7 @@ public:
data.writeInterfaceToken(IMountService::getInterfaceDescriptor()); data.writeInterfaceToken(IMountService::getInterfaceDescriptor());
data.writeString16(filename); data.writeString16(filename);
data.writeInt32(force ? 1 : 0); data.writeInt32(force ? 1 : 0);
data.writeStrongBinder(token->asBinder()); data.writeStrongBinder(IInterface::asBinder(token));
data.writeInt32(nonce); data.writeInt32(nonce);
if (remote()->transact(TRANSACTION_unmountObb, data, &reply) != NO_ERROR) { if (remote()->transact(TRANSACTION_unmountObb, data, &reply) != NO_ERROR) {
ALOGD("unmountObb could not contact remote\n"); ALOGD("unmountObb could not contact remote\n");

View File

@@ -128,7 +128,7 @@ static jobject android_media_MediaHTTPConnection_native_getIMemory(
JNIEnv *env, jobject thiz) { JNIEnv *env, jobject thiz) {
sp<JMediaHTTPConnection> conn = getObject(env, 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( static jint android_media_MediaHTTPConnection_native_readAt(