summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorMatthew Xie <mattx@google.com>2013-05-22 17:36:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-05-22 17:36:53 +0000
commit7e72349865db83d62f98eec8bca4b170712fe0e0 (patch)
tree13f8b2d2dc35dec034d634e1447d060677a6b55f /init
parent49be240735a06f44e1d91aa51dd299779ad36d96 (diff)
parent40a91a2884333e48aacf266fde53960e03fa1cc4 (diff)
downloadsystem_core-7e72349865db83d62f98eec8bca4b170712fe0e0.zip
system_core-7e72349865db83d62f98eec8bca4b170712fe0e0.tar.gz
system_core-7e72349865db83d62f98eec8bca4b170712fe0e0.tar.bz2
Merge "Add permission for bluetooth app in non-primary users" into jb-mr2-dev
Diffstat (limited to 'init')
-rwxr-xr-xinit/property_service.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/init/property_service.c b/init/property_service.c
index 5780001..e9cf1bb 100755
--- a/init/property_service.c
+++ b/init/property_service.c
@@ -27,6 +27,7 @@
#include <cutils/misc.h>
#include <cutils/sockets.h>
+#include <cutils/multiuser.h>
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
@@ -270,12 +271,19 @@ static int check_control_perms(const char *name, unsigned int uid, unsigned int
static int check_perms(const char *name, unsigned int uid, unsigned int gid, char *sctx)
{
int i;
+ unsigned int app_id;
+
if(!strncmp(name, "ro.", 3))
name +=3;
if (uid == 0)
return check_mac_perms(name, sctx);
+ app_id = multiuser_get_app_id(uid);
+ if (app_id == AID_BLUETOOTH) {
+ uid = app_id;
+ }
+
for (i = 0; property_perms[i].prefix; i++) {
if (strncmp(property_perms[i].prefix, name,
strlen(property_perms[i].prefix)) == 0) {