Merge "BT: Add CAP_NET_ADMIN for Bluetooth Process" into qt-dev

This commit is contained in:
Maciej Zenczykowski
2019-06-26 06:38:45 +00:00
committed by Android (Google) Code Review

View File

@@ -1160,6 +1160,7 @@ static jlong CalculateCapabilities(JNIEnv* env, jint uid, jint gid, jintArray gi
/*
* Grant the following capabilities to the Bluetooth user:
* - CAP_WAKE_ALARM
* - CAP_NET_ADMIN
* - CAP_NET_RAW
* - CAP_NET_BIND_SERVICE (for DHCP client functionality)
* - CAP_SYS_NICE (for setting RT priority for audio-related threads)
@@ -1167,6 +1168,7 @@ static jlong CalculateCapabilities(JNIEnv* env, jint uid, jint gid, jintArray gi
if (multiuser_get_app_id(uid) == AID_BLUETOOTH) {
capabilities |= (1LL << CAP_WAKE_ALARM);
capabilities |= (1LL << CAP_NET_ADMIN);
capabilities |= (1LL << CAP_NET_RAW);
capabilities |= (1LL << CAP_NET_BIND_SERVICE);
capabilities |= (1LL << CAP_SYS_NICE);