summaryrefslogtreecommitdiffstats
path: root/libs/ui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-05-21 19:21:59 -0700
committerMathias Agopian <mathias@google.com>2009-05-21 19:21:59 -0700
commit627e7b50be41e4fdee758a1bfad3a55de56b4e27 (patch)
treede5c88b60ad0f5454956eb457090958ebb9fc331 /libs/ui
parent384bfa270cdcb5dc3bc9ec396b783e25eb2d9b4d (diff)
downloadframeworks_base-627e7b50be41e4fdee758a1bfad3a55de56b4e27.zip
frameworks_base-627e7b50be41e4fdee758a1bfad3a55de56b4e27.tar.gz
frameworks_base-627e7b50be41e4fdee758a1bfad3a55de56b4e27.tar.bz2
split boot animation out of SurfaceFlinger
Conflicts: data/etc/platform.xml
Diffstat (limited to 'libs/ui')
-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 dd6a798..dab5f71 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;