From a67932fe6864ac346e7f78b86df11cf6c5344137 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 20 Apr 2011 14:20:59 -0700 Subject: unify SurfaceTexture and Surface Add the concept of synchronous dequeueBuffer in SurfaceTexture Implement {Surface|SurfaceTextureClient}::setSwapInterval() Add SurfaceTexture logging fix onFrameAvailable --- libs/gui/ISurfaceComposerClient.cpp | 56 +------------------------------------ 1 file changed, 1 insertion(+), 55 deletions(-) (limited to 'libs/gui/ISurfaceComposerClient.cpp') diff --git a/libs/gui/ISurfaceComposerClient.cpp b/libs/gui/ISurfaceComposerClient.cpp index ea38e08a55..8d83392588 100644 --- a/libs/gui/ISurfaceComposerClient.cpp +++ b/libs/gui/ISurfaceComposerClient.cpp @@ -50,9 +50,7 @@ namespace android { enum { - GET_CBLK = IBinder::FIRST_CALL_TRANSACTION, - GET_TOKEN, - CREATE_SURFACE, + CREATE_SURFACE = IBinder::FIRST_CALL_TRANSACTION, DESTROY_SURFACE, SET_STATE }; @@ -65,23 +63,6 @@ public: { } - virtual sp getControlBlock() const - { - Parcel data, reply; - data.writeInterfaceToken(ISurfaceComposerClient::getInterfaceDescriptor()); - remote()->transact(GET_CBLK, data, &reply); - return interface_cast(reply.readStrongBinder()); - } - - virtual ssize_t getTokenForSurface(const sp& sur) const - { - Parcel data, reply; - data.writeInterfaceToken(ISurfaceComposerClient::getInterfaceDescriptor()); - data.writeStrongBinder(sur->asBinder()); - remote()->transact(GET_TOKEN, data, &reply); - return reply.readInt32(); - } - virtual sp createSurface( surface_data_t* params, const String8& name, DisplayID display, @@ -131,41 +112,6 @@ IMPLEMENT_META_INTERFACE(SurfaceComposerClient, "android.ui.ISurfaceComposerClie status_t BnSurfaceComposerClient::onTransact( uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { - // codes that don't require permission check - - switch(code) { - case GET_CBLK: { - CHECK_INTERFACE(ISurfaceComposerClient, data, reply); - sp ctl(getControlBlock()); - reply->writeStrongBinder(ctl->asBinder()); - return NO_ERROR; - } break; - case GET_TOKEN: { - CHECK_INTERFACE(ISurfaceComposerClient, data, reply); - sp sur = interface_cast(data.readStrongBinder()); - ssize_t token = getTokenForSurface(sur); - reply->writeInt32(token); - return NO_ERROR; - } break; - } - - // these must be checked - - IPCThreadState* ipc = IPCThreadState::self(); - const int pid = ipc->getCallingPid(); - const int uid = ipc->getCallingUid(); - const int self_pid = getpid(); - if (UNLIKELY(pid != self_pid && uid != AID_GRAPHICS && uid != 0)) { - // we're called from a different process, do the real check - if (!checkCallingPermission( - String16("android.permission.ACCESS_SURFACE_FLINGER"))) - { - LOGE("Permission Denial: " - "can't openGlobalTransaction pid=%d, uid=%d", pid, uid); - return PERMISSION_DENIED; - } - } - switch(code) { case CREATE_SURFACE: { CHECK_INTERFACE(ISurfaceComposerClient, data, reply); -- cgit v1.2.3-59-g8ed1b