am 7e723498: Merge "Add permission for bluetooth app in non-primary users" into jb-mr2-dev
* commit '7e72349865db83d62f98eec8bca4b170712fe0e0': Add permission for bluetooth app in non-primary users
This commit is contained in:
commit
5cb9a02b03
1 changed files with 8 additions and 0 deletions
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
#include <cutils/misc.h>
|
#include <cutils/misc.h>
|
||||||
#include <cutils/sockets.h>
|
#include <cutils/sockets.h>
|
||||||
|
#include <cutils/multiuser.h>
|
||||||
|
|
||||||
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
|
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
|
||||||
#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)
|
static int check_perms(const char *name, unsigned int uid, unsigned int gid, char *sctx)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
unsigned int app_id;
|
||||||
|
|
||||||
if(!strncmp(name, "ro.", 3))
|
if(!strncmp(name, "ro.", 3))
|
||||||
name +=3;
|
name +=3;
|
||||||
|
|
||||||
if (uid == 0)
|
if (uid == 0)
|
||||||
return check_mac_perms(name, sctx);
|
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++) {
|
for (i = 0; property_perms[i].prefix; i++) {
|
||||||
if (strncmp(property_perms[i].prefix, name,
|
if (strncmp(property_perms[i].prefix, name,
|
||||||
strlen(property_perms[i].prefix)) == 0) {
|
strlen(property_perms[i].prefix)) == 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue