diff options
author | 2009-05-21 19:36:53 -0700 | |
---|---|---|
committer | 2009-05-21 19:36:53 -0700 | |
commit | bdbf6b094d61f694f162a5a5279caededcb1f0a5 (patch) | |
tree | b7a3cd2bd1a437237e71598d05b88be3f681c610 /libs/ui/ISurfaceFlingerClient.cpp | |
parent | 3cf34f1345eca75c5282b65dc4bda5f1e4f23d0d (diff) | |
parent | 1131392281cebcf958bbf5981203b1a34eef6ba2 (diff) |
am 69a6c3eb: Merge change 2292 into donut
Merge commit '69a6c3ebd46a8de0e896747757f364322c12608d'
* commit '69a6c3ebd46a8de0e896747757f364322c12608d':
split boot animation out of SurfaceFlinger
Diffstat (limited to 'libs/ui/ISurfaceFlingerClient.cpp')
-rw-r--r-- | libs/ui/ISurfaceFlingerClient.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libs/ui/ISurfaceFlingerClient.cpp b/libs/ui/ISurfaceFlingerClient.cpp index 69731ab0cf..a93ae67ab8 100644 --- a/libs/ui/ISurfaceFlingerClient.cpp +++ b/libs/ui/ISurfaceFlingerClient.cpp @@ -35,6 +35,13 @@ // --------------------------------------------------------------------------- +/* ideally AID_GRAPHICS would be in a semi-public header + * or there would be a way to map a user/group name to its id + */ +#ifndef AID_GRAPHICS +#define AID_GRAPHICS 1003 +#endif + #define LIKELY( exp ) (__builtin_expect( (exp) != 0, true )) #define UNLIKELY( exp ) (__builtin_expect( (exp) != 0, false )) @@ -136,13 +143,13 @@ status_t BnSurfaceFlingerClient::onTransact( IPCThreadState* ipc = IPCThreadState::self(); const int pid = ipc->getCallingPid(); - const int self_pid = getpid(); - if (UNLIKELY(pid != self_pid)) { + const int uid = ipc->getCallingUid(); + const int self_pid = getpid(); + if (UNLIKELY(pid != self_pid && uid != AID_GRAPHICS)) { // we're called from a different process, do the real check if (!checkCallingPermission( String16("android.permission.ACCESS_SURFACE_FLINGER"))) { - const int uid = ipc->getCallingUid(); LOGE("Permission Denial: " "can't openGlobalTransaction pid=%d, uid=%d", pid, uid); return PERMISSION_DENIED; |