Loading core/java/android/os/ISchedulingPolicyService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,6 @@ interface ISchedulingPolicyService { * The thread group leader of tid must be pid. * There may be restrictions on who can call this. */ int requestPriority(int pid, int tid, int prio); int requestPriority(int pid, int tid, int prio, boolean isForApp); } services/core/java/com/android/server/os/SchedulingPolicyService.java +4 −2 Original line number Diff line number Diff line Loading @@ -37,7 +37,9 @@ public class SchedulingPolicyService extends ISchedulingPolicyService.Stub { public SchedulingPolicyService() { } public int requestPriority(int pid, int tid, int prio) { // TODO(b/35196900) We should pass the period in time units, rather // than a fixed priority number. public int requestPriority(int pid, int tid, int prio, boolean isForApp) { //Log.i(TAG, "requestPriority(pid=" + pid + ", tid=" + tid + ", prio=" + prio + ")"); // Verify that the caller uid is permitted, priority is in range, Loading @@ -52,7 +54,7 @@ public class SchedulingPolicyService extends ISchedulingPolicyService.Stub { } try { // make good use of our CAP_SYS_NICE capability Process.setThreadGroup(tid, Binder.getCallingPid() == pid ? Process.setThreadGroup(tid, !isForApp ? Process.THREAD_GROUP_AUDIO_SYS : Process.THREAD_GROUP_AUDIO_APP); // must be in this order or it fails the schedulability constraint Process.setThreadScheduler(tid, Process.SCHED_FIFO | Process.SCHED_RESET_ON_FORK, Loading Loading
core/java/android/os/ISchedulingPolicyService.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,6 @@ interface ISchedulingPolicyService { * The thread group leader of tid must be pid. * There may be restrictions on who can call this. */ int requestPriority(int pid, int tid, int prio); int requestPriority(int pid, int tid, int prio, boolean isForApp); }
services/core/java/com/android/server/os/SchedulingPolicyService.java +4 −2 Original line number Diff line number Diff line Loading @@ -37,7 +37,9 @@ public class SchedulingPolicyService extends ISchedulingPolicyService.Stub { public SchedulingPolicyService() { } public int requestPriority(int pid, int tid, int prio) { // TODO(b/35196900) We should pass the period in time units, rather // than a fixed priority number. public int requestPriority(int pid, int tid, int prio, boolean isForApp) { //Log.i(TAG, "requestPriority(pid=" + pid + ", tid=" + tid + ", prio=" + prio + ")"); // Verify that the caller uid is permitted, priority is in range, Loading @@ -52,7 +54,7 @@ public class SchedulingPolicyService extends ISchedulingPolicyService.Stub { } try { // make good use of our CAP_SYS_NICE capability Process.setThreadGroup(tid, Binder.getCallingPid() == pid ? Process.setThreadGroup(tid, !isForApp ? Process.THREAD_GROUP_AUDIO_SYS : Process.THREAD_GROUP_AUDIO_APP); // must be in this order or it fails the schedulability constraint Process.setThreadScheduler(tid, Process.SCHED_FIFO | Process.SCHED_RESET_ON_FORK, Loading