summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcutils/sched_policy.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/libcutils/sched_policy.cpp b/libcutils/sched_policy.cpp
index 0d459cce1..73ca5180e 100644
--- a/libcutils/sched_policy.cpp
+++ b/libcutils/sched_policy.cpp
@@ -271,17 +271,9 @@ int get_sched_policy(int tid, SchedPolicy *policy)
271 return -1; 271 return -1;
272 } 272 }
273 } else { 273 } else {
274 int rc = sched_getscheduler(tid); 274 // In b/34193533, we removed bg_non_interactive cgroup, so now
275 if (rc < 0) 275 // all threads are in FOREGROUND cgroup
276 return -1; 276 *policy = SP_FOREGROUND;
277 else if (rc == SCHED_NORMAL)
278 *policy = SP_FOREGROUND;
279 else if (rc == SCHED_BATCH)
280 *policy = SP_BACKGROUND;
281 else {
282 errno = ERANGE;
283 return -1;
284 }
285 } 277 }
286 return 0; 278 return 0;
287} 279}
@@ -428,14 +420,6 @@ int set_sched_policy(int tid, SchedPolicy policy)
428 return -errno; 420 return -errno;
429 } 421 }
430 422
431 } else {
432 struct sched_param param;
433
434 param.sched_priority = 0;
435 sched_setscheduler(tid,
436 (policy == SP_BACKGROUND) ?
437 SCHED_BATCH : SCHED_NORMAL,
438 &param);
439 } 423 }
440 424
441 if (__sys_supports_timerslack) { 425 if (__sys_supports_timerslack) {