summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wei Wang <wvw@google.com> 2020-12-14 19:02:47 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-12-14 19:02:47 +0000
commit3031a838c20f9d46d1c52cc362e47f3295a398dc (patch)
treee351ebb740f7677a669b5c11604480e1d20c431d
parent9b795b5f563e98b4620a10895575d8f013ff3c5f (diff)
parente0dbd9b05cefcd2588654e8e91b9a85386cf5ffc (diff)
Merge "Revert "Revert "installd: Fix set dex2oat to background after boot_complete"""
-rw-r--r--cmds/installd/dexopt.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp
index 594880ac60..65fc46ecaf 100644
--- a/cmds/installd/dexopt.cpp
+++ b/cmds/installd/dexopt.cpp
@@ -1818,10 +1818,13 @@ int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* ins
pid_t pid = fork();
if (pid == 0) {
+ // Need to set schedpolicy before dropping privileges
+ // for cgroup migration. See details at b/175178520.
+ SetDex2OatScheduling(boot_complete);
+
/* child -- drop privileges before continuing */
drop_capabilities(uid);
- SetDex2OatScheduling(boot_complete);
if (flock(out_oat.fd(), LOCK_EX | LOCK_NB) != 0) {
PLOG(ERROR) << "flock(" << out_oat.path() << ") failed";
_exit(DexoptReturnCodes::kFlock);