summaryrefslogtreecommitdiff
path: root/libs/ui/ISurfaceFlingerClient.cpp
diff options
context:
space:
mode:
author Android (Google) Code Review <android-gerrit@google.com> 2009-05-21 19:33:59 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2009-05-21 19:33:59 -0700
commit1131392281cebcf958bbf5981203b1a34eef6ba2 (patch)
treed5eca56524292b41940347ddbe5387fbf136c141 /libs/ui/ISurfaceFlingerClient.cpp
parent156f418aa83f50cd6f37546226228f6a8fd2a1dd (diff)
parenta1ecca920e15ce04fe56ebf4f1b52ba711f9eb2d (diff)
Merge change 2292 into donut
* changes: split boot animation out of SurfaceFlinger
Diffstat (limited to 'libs/ui/ISurfaceFlingerClient.cpp')
-rw-r--r--libs/ui/ISurfaceFlingerClient.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/libs/ui/ISurfaceFlingerClient.cpp b/libs/ui/ISurfaceFlingerClient.cpp
index dd6a798b98..dab5f71847 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;