From 0455a2c39c781a8153c1090a4638193b4181379d Mon Sep 17 00:00:00 2001 From: Tim Murray Date: Mon, 7 Feb 2022 17:03:32 -0800 Subject: [PATCH] libutils: don't call SetTaskProfiles around priority Threads should always be in the same state as their parents. This also implies that the additional SetTaskProfiles is unnecessary when creating a new thread. Test: boots, TH Bug: 208895940 Change-Id: Id971c6e87d342a695bea106cdd258bc0ef6f7ecb --- libutils/Threads.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/libutils/Threads.cpp b/libutils/Threads.cpp index 3bf577961..a85ff20bc 100644 --- a/libutils/Threads.cpp +++ b/libutils/Threads.cpp @@ -84,14 +84,6 @@ struct thread_data_t { delete t; setpriority(PRIO_PROCESS, 0, prio); - // A new thread will be in its parent's sched group by default, - // so we just need to handle the background case. - // currently set to system_background group which is different - // from background group for app. - if (prio >= ANDROID_PRIORITY_BACKGROUND) { - SetTaskProfiles(0, {"SCHED_SP_SYSTEM"}, true); - } - if (name) { androidSetThreadName(name); free(name); @@ -314,12 +306,6 @@ int androidSetThreadPriority(pid_t tid, int pri) return rc; } - if (pri >= ANDROID_PRIORITY_BACKGROUND) { - rc = SetTaskProfiles(tid, {"SCHED_SP_SYSTEM"}, true) ? 0 : -1; - } else if (curr_pri >= ANDROID_PRIORITY_BACKGROUND) { - rc = SetTaskProfiles(tid, {"SCHED_SP_FOREGROUND"}, true) ? 0 : -1; - } - if (rc) { lasterr = errno; }