From 2956beeec97df6ee7fe0c826ccc8c6f625f36d75 Mon Sep 17 00:00:00 2001 From: Pavlin Radoslavov Date: Wed, 27 Jan 2016 16:22:15 -0800 Subject: [PATCH] Grant CAP_WAKE_ALARM to the Bluetooth process for any user Use multiuser_get_app_id(uid) to check for AID_BLUETOOTH and allow the CAP_WAKE_ALARM capability for any user. Bug: 26784675 Change-Id: I11641e212b7c815e9137ae5620da6ad55f95a899 --- core/jni/com_android_internal_os_Zygote.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 041e693089dec..4194aa4107928 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -608,7 +608,7 @@ static jint com_android_internal_os_Zygote_nativeForkAndSpecialize( jlong capabilities = 0; // Grant CAP_WAKE_ALARM to the Bluetooth process. - if (uid == AID_BLUETOOTH) { + if (multiuser_get_app_id(uid) == AID_BLUETOOTH) { capabilities |= (1LL << CAP_WAKE_ALARM); }