Bug 976839 - Grant AID_RADIO access to android.permission.MODIFY_AUDIO_SETTINGS. r=mwu
authorMichael Vines <mvines@codeaurora.org>
Wed, 19 Feb 2014 09:53:06 -0800
changeset 171420 aef202258c60598a03559aaa6201464d9aa7daa1
parent 171419 fe0f587afa4df798dd934458af1b1d5dfeb11dce
child 171421 e875056eb094d75119a2251d9badd4f872174a04
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersmwu
bugs976839
milestone30.0a1
Bug 976839 - Grant AID_RADIO access to android.permission.MODIFY_AUDIO_SETTINGS. r=mwu
widget/gonk/GonkPermission.cpp
--- a/widget/gonk/GonkPermission.cpp
+++ b/widget/gonk/GonkPermission.cpp
@@ -30,28 +30,34 @@ using namespace mozilla;
 
 bool
 GonkPermissionService::checkPermission(const String16& permission, int32_t pid,
                                      int32_t uid)
 {
   if (0 == uid)
     return true;
 
+  String8 perm8(permission);
+
+
+  // Some ril implementations need android.permission.MODIFY_AUDIO_SETTINGS
+  if (uid == AID_RADIO &&
+      perm8 == "android.permission.MODIFY_AUDIO_SETTINGS")
+    return true;
+
   // Camera/audio record permissions are only for apps with the
   // "camera" permission.  These apps are also the only apps granted
   // the AID_SDCARD_RW supplemental group (bug 785592)
 
   if (uid < AID_APP) {
     ALOGE("%s for pid=%d,uid=%d denied: not an app",
       String8(permission).string(), pid, uid);
     return false;
   }
 
-  String8 perm8(permission);
-
   if (perm8 != "android.permission.CAMERA" &&
     perm8 != "android.permission.RECORD_AUDIO") {
     ALOGE("%s for pid=%d,uid=%d denied: unsupported permission",
       String8(permission).string(), pid, uid);
     return false;
   }
 
   // Users granted the permission through a prompt dialog.