summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Wang <wvw@google.com>2021-07-07 17:32:38 -0700
committerWei Wang <wvw@google.com>2021-07-09 09:44:16 -0700
commit0efe8d5ba1365cb5bcee61c4a9faa7f7620511da (patch)
treee28fa41b9006bb146cc28f22624926a85c99f776
parenta95ed9767082a796af296cebe79208a82d4b6c94 (diff)
downloadnative-0efe8d5ba1365cb5bcee61c4a9faa7f7620511da.tar.gz
dex2oat: add a new task profile for dex2oat boot_complete policy
Since installation time is also critical and sometime we want a finer control on its behavior for vendor. Instead of setting dex2oat to background group, add a new task profile (by default same as background group). Test: Boot Bug: 188947181 Signed-off-by: Wei Wang <wvw@google.com> Change-Id: I37a36050a338f9eba8d605a00a32b99a4a590bac
-rw-r--r--cmds/installd/dexopt.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp
index 15f0c5b75c..af4a525290 100644
--- a/cmds/installd/dexopt.cpp
+++ b/cmds/installd/dexopt.cpp
@@ -43,7 +43,7 @@
#include <log/log.h> // TODO: Move everything to base/logging.
#include <openssl/sha.h>
#include <private/android_filesystem_config.h>
-#include <processgroup/sched_policy.h>
+#include <processgroup/processgroup.h>
#include <selinux/android.h>
#include <server_configurable_flags/get_flags.h>
#include <system/thread_defs.h>
@@ -282,8 +282,8 @@ static bool ShouldUseSwapFileForDexopt() {
static void SetDex2OatScheduling(bool set_to_bg) {
if (set_to_bg) {
- if (set_sched_policy(0, SP_BACKGROUND) < 0) {
- PLOG(ERROR) << "set_sched_policy failed";
+ if (!SetTaskProfiles(0, {"Dex2OatBootComplete"})) {
+ LOG(ERROR) << "Failed to set dex2oat task profile";
exit(DexoptReturnCodes::kSetSchedPolicy);
}
if (setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_BACKGROUND) < 0) {