Merge "libutils: do not follow process's group" into sc-v2-dev am: a2c0b86ad0 am: 0c54932e9e
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/16434460
Change-Id: I77333110d1a9ff52d7e3f812a1c57caec109ab86
diff --git a/libutils/Threads.cpp b/libutils/Threads.cpp
index 5acd478..fb75f7d 100644
--- a/libutils/Threads.cpp
+++ b/libutils/Threads.cpp
@@ -317,10 +317,7 @@
if (pri >= ANDROID_PRIORITY_BACKGROUND) {
rc = SetTaskProfiles(tid, {"SCHED_SP_SYSTEM"}, true) ? 0 : -1;
} else if (curr_pri >= ANDROID_PRIORITY_BACKGROUND) {
- SchedPolicy policy = SP_FOREGROUND;
- // Change to the sched policy group of the process.
- get_sched_policy(getpid(), &policy);
- rc = SetTaskProfiles(tid, {get_sched_policy_profile_name(policy)}, true) ? 0 : -1;
+ rc = SetTaskProfiles(tid, {"SCHED_SP_FOREGROUND"}, true) ? 0 : -1;
}
if (rc) {