From f888020c6e2735624f2b2a30e72aca24e17b8b4d Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Fri, 14 Nov 2014 07:58:25 -0800 Subject: Update calls to IInterface::asBinder() to use the new static version. Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a Conflicts: media/libmedia/IAudioFlinger.cpp media/libmedia/IMediaPlayer.cpp media/libstagefright/CameraSource.cpp --- services/audioflinger/AudioFlinger.cpp | 2 +- services/audioflinger/Threads.cpp | 2 +- services/audiopolicy/AudioPolicyService.cpp | 2 +- services/camera/libcameraservice/CameraService.cpp | 18 +++++++++--------- services/camera/libcameraservice/CameraService.h | 2 +- .../camera/libcameraservice/api1/Camera2Client.cpp | 4 ++-- services/camera/libcameraservice/api1/CameraClient.cpp | 6 +++--- .../libcameraservice/api2/CameraDeviceClient.cpp | 10 +++++----- .../libcameraservice/api_pro/ProCamera2Client.cpp | 4 ++-- .../libcameraservice/common/Camera2ClientBase.cpp | 2 +- .../camera/libcameraservice/common/Camera2ClientBase.h | 2 +- services/soundtrigger/SoundTriggerHwService.cpp | 4 ++-- 12 files changed, 29 insertions(+), 29 deletions(-) (limited to 'services') diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index e48af20..c571cf5 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -1187,7 +1187,7 @@ void AudioFlinger::registerClient(const sp& client) mNotificationClients.add(pid, notificationClient); - sp binder = client->asBinder(); + sp binder = IInterface::asBinder(client); binder->linkToDeath(notificationClient); clientAdded = true; } diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index e443476..ed8293d 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -338,7 +338,7 @@ AudioFlinger::ThreadBase::~ThreadBase() // do not lock the mutex in destructor releaseWakeLock_l(); if (mPowerManager != 0) { - sp binder = mPowerManager->asBinder(); + sp binder = IInterface::asBinder(mPowerManager); binder->unlinkToDeath(mDeathRecipient); } } diff --git a/services/audiopolicy/AudioPolicyService.cpp b/services/audiopolicy/AudioPolicyService.cpp index 3a5626d..da2defe 100644 --- a/services/audiopolicy/AudioPolicyService.cpp +++ b/services/audiopolicy/AudioPolicyService.cpp @@ -161,7 +161,7 @@ void AudioPolicyService::registerClient(const sp& cli mNotificationClients.add(uid, notificationClient); - sp binder = client->asBinder(); + sp binder = IInterface::asBinder(client); binder->linkToDeath(notificationClient); } } diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index 889be74..4229538 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -755,7 +755,7 @@ status_t CameraService::connect( Mutex::Autolock lock(mServiceLock); sp clientTmp; if (!canConnectUnsafe(cameraId, clientPackageName, - cameraClient->asBinder(), + IInterface::asBinder(cameraClient), /*out*/clientTmp)) { return -EBUSY; } else if (client.get() != NULL) { @@ -818,7 +818,7 @@ status_t CameraService::connectLegacy( Mutex::Autolock lock(mServiceLock); sp clientTmp; if (!canConnectUnsafe(cameraId, clientPackageName, - cameraClient->asBinder(), + IInterface::asBinder(cameraClient), /*out*/clientTmp)) { return -EBUSY; } else if (client.get() != NULL) { @@ -888,7 +888,7 @@ status_t CameraService::connectPro( { sp client; if (!canConnectUnsafe(cameraId, clientPackageName, - cameraCb->asBinder(), + IInterface::asBinder(cameraCb), /*out*/client)) { return -EBUSY; } @@ -961,7 +961,7 @@ status_t CameraService::connectDevice( { sp client; if (!canConnectUnsafe(cameraId, clientPackageName, - cameraCb->asBinder(), + IInterface::asBinder(cameraCb), /*out*/client)) { return -EBUSY; } @@ -1023,7 +1023,7 @@ status_t CameraService::addListener( Vector >::iterator it, end; for (it = mListenerList.begin(); it != mListenerList.end(); ++it) { - if ((*it)->asBinder() == listener->asBinder()) { + if (IInterface::asBinder(*it) == IInterface::asBinder(listener)) { ALOGW("%s: Tried to add listener %p which was already subscribed", __FUNCTION__, listener.get()); return ALREADY_EXISTS; @@ -1056,7 +1056,7 @@ status_t CameraService::removeListener( Vector >::iterator it; for (it = mListenerList.begin(); it != mListenerList.end(); ++it) { - if ((*it)->asBinder() == listener->asBinder()) { + if (IInterface::asBinder(*it) == IInterface::asBinder(listener)) { mListenerList.erase(it); return OK; } @@ -1169,7 +1169,7 @@ void CameraService::removeClientByRemote(const wp& remoteBinder) { // Found our camera, clear and leave. LOG1("removeClient: clear pro %p", clientPro.get()); - clientPro->getRemoteCallback()->asBinder()->unlinkToDeath(this); + IInterface::asBinder(clientPro->getRemoteCallback())->unlinkToDeath(this); } } @@ -1364,7 +1364,7 @@ CameraService::Client::Client(const sp& cameraService, int clientPid, uid_t clientUid, int servicePid) : CameraService::BasicClient(cameraService, - cameraClient != NULL ? cameraClient->asBinder() : NULL, + IInterface::asBinder(cameraClient), clientPackageName, cameraId, cameraFacing, clientPid, clientUid, @@ -1575,7 +1575,7 @@ CameraService::ProClient::ProClient(const sp& cameraService, int clientPid, uid_t clientUid, int servicePid) - : CameraService::BasicClient(cameraService, remoteCallback->asBinder(), + : CameraService::BasicClient(cameraService, IInterface::asBinder(remoteCallback), clientPackageName, cameraId, cameraFacing, clientPid, clientUid, servicePid) { diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h index a7328cf..126d8d9 100644 --- a/services/camera/libcameraservice/CameraService.h +++ b/services/camera/libcameraservice/CameraService.h @@ -273,7 +273,7 @@ public: } virtual sp asBinderWrapper() { - return asBinder(); + return asBinder(this); } protected: diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp index dd2f64d..ec1a341 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.cpp +++ b/services/camera/libcameraservice/api1/Camera2Client.cpp @@ -166,7 +166,7 @@ status_t Camera2Client::dump(int fd, const Vector& args) { result.appendFormat("Client2[%d] (%p) Client: %s PID: %d, dump:\n", mCameraId, (getRemoteCallback() != NULL ? - getRemoteCallback()->asBinder().get() : NULL), + (IInterface::asBinder(getRemoteCallback()).get()) : NULL), String8(mClientPackageName).string(), mClientPid); result.append(" State: "); @@ -524,7 +524,7 @@ status_t Camera2Client::setPreviewTarget( sp binder; sp window; if (bufferProducer != 0) { - binder = bufferProducer->asBinder(); + binder = IInterface::asBinder(bufferProducer); // Using controlledByApp flag to ensure that the buffer queue remains in // async mode for the old camera API, where many applications depend // on that behavior. diff --git a/services/camera/libcameraservice/api1/CameraClient.cpp b/services/camera/libcameraservice/api1/CameraClient.cpp index 2b17028..bbb2fe0 100644 --- a/services/camera/libcameraservice/api1/CameraClient.cpp +++ b/services/camera/libcameraservice/api1/CameraClient.cpp @@ -119,7 +119,7 @@ status_t CameraClient::dump(int fd, const Vector& args) { size_t len = snprintf(buffer, SIZE, "Client[%d] (%p) PID: %d\n", mCameraId, (getRemoteCallback() != NULL ? - getRemoteCallback()->asBinder().get() : NULL), + IInterface::asBinder(getRemoteCallback()).get() : NULL), mClientPid); len = (len > SIZE - 1) ? SIZE - 1 : len; write(fd, buffer, len); @@ -206,7 +206,7 @@ status_t CameraClient::connect(const sp& client) { } if (mRemoteCallback != 0 && - (client->asBinder() == mRemoteCallback->asBinder())) { + (IInterface::asBinder(client) == IInterface::asBinder(mRemoteCallback))) { LOG1("Connect to the same client"); return NO_ERROR; } @@ -329,7 +329,7 @@ status_t CameraClient::setPreviewTarget( sp binder; sp window; if (bufferProducer != 0) { - binder = bufferProducer->asBinder(); + binder = IInterface::asBinder(bufferProducer); // Using controlledByApp flag to ensure that the buffer queue remains in // async mode for the old camera API, where many applications depend // on that behavior. diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp index c6d62e7..920adf6 100644 --- a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp +++ b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp @@ -43,7 +43,7 @@ CameraDeviceClientBase::CameraDeviceClientBase( uid_t clientUid, int servicePid) : BasicClient(cameraService, - remoteCallback != NULL ? remoteCallback->asBinder() : NULL, + IInterface::asBinder(remoteCallback), clientPackageName, cameraId, cameraFacing, @@ -163,7 +163,7 @@ status_t CameraDeviceClient::submitRequestList(List > request if (surface == 0) continue; sp gbp = surface->getIGraphicBufferProducer(); - int idx = mStreamMap.indexOfKey(gbp->asBinder()); + int idx = mStreamMap.indexOfKey(IInterface::asBinder(gbp)); // Trying to submit request with surface that wasn't created if (idx == NAME_NOT_FOUND) { @@ -333,7 +333,7 @@ status_t CameraDeviceClient::createStream(int width, int height, int format, // Don't create multiple streams for the same target surface { - ssize_t index = mStreamMap.indexOfKey(bufferProducer->asBinder()); + ssize_t index = mStreamMap.indexOfKey(IInterface::asBinder(bufferProducer)); if (index != NAME_NOT_FOUND) { ALOGW("%s: Camera %d: Buffer producer already has a stream for it " "(ID %zd)", @@ -359,7 +359,7 @@ status_t CameraDeviceClient::createStream(int width, int height, int format, useAsync = true; } - sp binder = bufferProducer->asBinder(); + sp binder = IInterface::asBinder(bufferProducer); sp anw = new Surface(bufferProducer, useAsync); // TODO: remove w,h,f since we are ignoring them @@ -517,7 +517,7 @@ status_t CameraDeviceClient::dump(int fd, const Vector& args) { result.appendFormat("CameraDeviceClient[%d] (%p) dump:\n", mCameraId, (getRemoteCallback() != NULL ? - getRemoteCallback()->asBinder().get() : NULL) ); + IInterface::asBinder(getRemoteCallback()).get() : NULL) ); result.appendFormat(" Current client: %s (PID %d, UID %u)\n", String8(mClientPackageName).string(), mClientPid, mClientUid); diff --git a/services/camera/libcameraservice/api_pro/ProCamera2Client.cpp b/services/camera/libcameraservice/api_pro/ProCamera2Client.cpp index 9c8f0f4..59e5083 100644 --- a/services/camera/libcameraservice/api_pro/ProCamera2Client.cpp +++ b/services/camera/libcameraservice/api_pro/ProCamera2Client.cpp @@ -276,7 +276,7 @@ status_t ProCamera2Client::createStream(int width, int height, int format, sp binder; sp window; if (bufferProducer != 0) { - binder = bufferProducer->asBinder(); + binder = IInterface::asBinder(bufferProducer); window = new Surface(bufferProducer); } @@ -335,7 +335,7 @@ status_t ProCamera2Client::dump(int fd, const Vector& args) { result.appendFormat("ProCamera2Client[%d] (%p) PID: %d, dump:\n", mCameraId, (getRemoteCallback() != NULL ? - getRemoteCallback()->asBinder().get() : NULL), + IInterface::asBinder(getRemoteCallback()).get() : NULL), mClientPid); result.append(" State:\n"); write(fd, result.string(), result.size()); diff --git a/services/camera/libcameraservice/common/Camera2ClientBase.cpp b/services/camera/libcameraservice/common/Camera2ClientBase.cpp index eb91bd4..453c8bd 100644 --- a/services/camera/libcameraservice/common/Camera2ClientBase.cpp +++ b/services/camera/libcameraservice/common/Camera2ClientBase.cpp @@ -129,7 +129,7 @@ status_t Camera2ClientBase::dump(int fd, result.appendFormat("Camera2ClientBase[%d] (%p) PID: %d, dump:\n", TClientBase::mCameraId, (TClientBase::getRemoteCallback() != NULL ? - TClientBase::getRemoteCallback()->asBinder().get() : NULL), + IInterface::asBinder(TClientBase::getRemoteCallback()).get() : NULL), TClientBase::mClientPid); result.append(" State: "); diff --git a/services/camera/libcameraservice/common/Camera2ClientBase.h b/services/camera/libcameraservice/common/Camera2ClientBase.h index d198e4e..e09c1b5 100644 --- a/services/camera/libcameraservice/common/Camera2ClientBase.h +++ b/services/camera/libcameraservice/common/Camera2ClientBase.h @@ -111,7 +111,7 @@ protected: pid_t mInitialClientPid; virtual sp asBinderWrapper() { - return IInterface::asBinder(); + return IInterface::asBinder(this); } virtual status_t dumpDevice(int fd, const Vector& args); diff --git a/services/soundtrigger/SoundTriggerHwService.cpp b/services/soundtrigger/SoundTriggerHwService.cpp index b5aaee3..b625b01 100644 --- a/services/soundtrigger/SoundTriggerHwService.cpp +++ b/services/soundtrigger/SoundTriggerHwService.cpp @@ -143,7 +143,7 @@ status_t SoundTriggerHwService::attach(const sound_trigger_module_handle_t handl sp module = mModules.valueAt(index); module->setClient(client); - client->asBinder()->linkToDeath(module); + IInterface::asBinder(client)->linkToDeath(module); moduleInterface = module; module->setCaptureState_l(mCaptureState); @@ -510,7 +510,7 @@ void SoundTriggerHwService::Module::detach() { mModels.clear(); } if (mClient != 0) { - mClient->asBinder()->unlinkToDeath(this); + IInterface::asBinder(mClient)->unlinkToDeath(this); } sp service = mService.promote(); if (service == 0) { -- cgit v1.1