diff options
author | Wei Wang | 2017-03-28 13:13:51 -0500 |
---|---|---|
committer | Wei Wang | 2017-03-28 15:19:16 -0500 |
commit | bc41166d563d7e8d90ab48216730920d6eb90440 (patch) | |
tree | 241feafd24c3a73f0059ad0caba2b8192bfb1d15 | |
parent | 94f3ca87767fe84163012638053bf79ce01f693a (diff) | |
download | platform-system-core-bc41166d563d7e8d90ab48216730920d6eb90440.tar.gz platform-system-core-bc41166d563d7e8d90ab48216730920d6eb90440.tar.xz platform-system-core-bc41166d563d7e8d90ab48216730920d6eb90440.zip |
libcutils: remove sched_set/getscheduler
Bug: 36667354
Test: angler taking video
Change-Id: Ic077d856212c48610a0587c60d1186090166da2b
(cherry-picked from a8d59faa753c027e7375067f96a30e6429178105)
-rw-r--r-- | libcutils/sched_policy.cpp | 22 |
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 | ¶m); | ||
439 | } | 423 | } |
440 | 424 | ||
441 | if (__sys_supports_timerslack) { | 425 | if (__sys_supports_timerslack) { |