Add permission for bluetooth app in non-primary users

bug 8954114
Change-Id: Id6a42f5a5beefa22c3cc8eecfb39a2222017a3b4
This commit is contained in:
Matthew Xie 2013-05-20 14:22:01 -07:00
parent 921be8b656
commit 40a91a2884
1 changed files with 8 additions and 0 deletions

View File

@ -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>
@ -271,12 +272,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) {