Merge "Prevent FIFO threads from creating more FIFO threads." into nyc-mr1-dev

This commit is contained in:
Tim Murray
2016-08-18 20:25:36 +00:00
committed by Android (Google) Code Review

View File

@@ -55,7 +55,8 @@ public class SchedulingPolicyService extends ISchedulingPolicyService.Stub {
Process.setThreadGroup(tid, Binder.getCallingPid() == pid ? Process.setThreadGroup(tid, Binder.getCallingPid() == pid ?
Process.THREAD_GROUP_AUDIO_SYS : Process.THREAD_GROUP_AUDIO_APP); Process.THREAD_GROUP_AUDIO_SYS : Process.THREAD_GROUP_AUDIO_APP);
// must be in this order or it fails the schedulability constraint // must be in this order or it fails the schedulability constraint
Process.setThreadScheduler(tid, Process.SCHED_FIFO, prio); Process.setThreadScheduler(tid, Process.SCHED_FIFO | Process.SCHED_RESET_ON_FORK,
prio);
} catch (RuntimeException e) { } catch (RuntimeException e) {
return PackageManager.PERMISSION_DENIED; return PackageManager.PERMISSION_DENIED;
} }