From 0fabba396fe2ff0be864ea6c6a1ed8030ce5de7d Mon Sep 17 00:00:00 2001 From: Philip Cuadra Date: Wed, 26 Apr 2017 13:49:37 -0700 Subject: Allow Bluetooth CAP_SYS_NICE Bluetooth needs CAP_SYS_NICE in order to make important threads use RT scheduling policy. Bug 37518404 Test: Play Bluetooth audio, confirm RT priority in systrace Change-Id: I388ef78d1aaf3f5fe1aa901b48d76c5c992acacc Merged-In: I0ee55a2f2cfd80cbb066d9c034bb85d8d85ba470 --- core/jni/com_android_internal_os_Zygote.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index b95258bca49c..6000fb56299d 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -685,11 +685,14 @@ static jint com_android_internal_os_Zygote_nativeForkAndSpecialize( // Grant CAP_WAKE_ALARM to the Bluetooth process. // Additionally, allow bluetooth to open packet sockets so it can start the DHCP client. + // Grant CAP_SYS_NICE to allow Bluetooth to set RT priority for + // audio-related threads. // TODO: consider making such functionality an RPC to netd. if (multiuser_get_app_id(uid) == AID_BLUETOOTH) { capabilities |= (1LL << CAP_WAKE_ALARM); capabilities |= (1LL << CAP_NET_RAW); capabilities |= (1LL << CAP_NET_BIND_SERVICE); + capabilities |= (1LL << CAP_SYS_NICE); } // Grant CAP_BLOCK_SUSPEND to processes that belong to GID "wakelock" -- cgit v1.2.3-59-g8ed1b