Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfc3b274 authored by Wei Wang's avatar Wei Wang Committed by Automerger Merge Worker
Browse files

Merge "Revert "Revert "installd: Fix set dex2oat to background after...

Merge "Revert "Revert "installd: Fix set dex2oat to background after boot_complete""" am: 3031a838 am: 25cd8c1f am: cbd7c0aa

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1526379

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If1779213eb1894dee28bf590cb6695e8e37cae86
parents 5cf6e2b1 cbd7c0aa
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -1818,10 +1818,13 @@ int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* ins


    pid_t pid = fork();
    pid_t pid = fork();
    if (pid == 0) {
    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 */
        /* child -- drop privileges before continuing */
        drop_capabilities(uid);
        drop_capabilities(uid);


        SetDex2OatScheduling(boot_complete);
        if (flock(out_oat.fd(), LOCK_EX | LOCK_NB) != 0) {
        if (flock(out_oat.fd(), LOCK_EX | LOCK_NB) != 0) {
            PLOG(ERROR) << "flock(" << out_oat.path() << ") failed";
            PLOG(ERROR) << "flock(" << out_oat.path() << ") failed";
            _exit(DexoptReturnCodes::kFlock);
            _exit(DexoptReturnCodes::kFlock);