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

Commit 72870e11 authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Android (Google) Code Review
Browse files

Merge "SchedulingPolicyService: add extra check for the target UID" into sc-dev

parents 82f6b90c 3c412a22
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -92,6 +92,12 @@ public class SchedulingPolicyService extends ISchedulingPolicyService.Stub {
                prio > PRIORITY_MAX || Process.getThreadGroupLeader(tid) != pid) {
           return PackageManager.PERMISSION_DENIED;
        }
        // If the calling UID is audio server, and this call is not for an app,
        // then it must be for the audio HAL. Validate the UID of the thread.
        if (Binder.getCallingUid() == Process.AUDIOSERVER_UID && !isForApp
                && Process.getUidForPid(tid) != Process.AUDIOSERVER_UID) {
            return PackageManager.PERMISSION_DENIED;
        }
        if (Binder.getCallingUid() != Process.BLUETOOTH_UID) {
            try {
                // make good use of our CAP_SYS_NICE capability