summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/ServiceUtilities.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/audioflinger/ServiceUtilities.cpp b/services/audioflinger/ServiceUtilities.cpp
index 33bd416..2e68dad 100644
--- a/services/audioflinger/ServiceUtilities.cpp
+++ b/services/audioflinger/ServiceUtilities.cpp
@@ -18,6 +18,7 @@
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/PermissionCache.h>
+#include <private/android_filesystem_config.h>
#include "ServiceUtilities.h"
/* When performing permission checks we do not use permission cache for
@@ -53,6 +54,10 @@ bool recordingAllowed(const String16& opPackageName) {
}
const uid_t uid = IPCThreadState::self()->getCallingUid();
+
+ // To permit command-line native tests
+ if (uid == AID_ROOT) return true;
+
String16 checkedOpPackageName = opPackageName;
// In some cases the calling code has no access to the package it runs under.