Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e723498 authored by Matthew Xie's avatar Matthew Xie Committed by Android (Google) Code Review
Browse files

Merge "Add permission for bluetooth app in non-primary users" into jb-mr2-dev

parents 49be2407 40a91a28
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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) {