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

Commit 1fea89a0 authored by Vladimir Marko's avatar Vladimir Marko
Browse files

Clear BOOTCLASSPATH for APP AOT compilation.

Let dex2oat pick up the boot classpath from the boot image,
excluding the updatable module components. This allows
updating those modules without recompiling apps.

Test: Manually check bootclasspath entry in an oat file
      compiled on device.
Bug: 122937705
Change-Id: I353f3862c9ece046a36010aa121d1f88ec9be78f
parent 174ebcf3
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -1958,6 +1958,11 @@ int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* ins
        /* child -- drop privileges before continuing */
        /* child -- drop privileges before continuing */
        drop_capabilities(uid);
        drop_capabilities(uid);


        // Clear BOOTCLASSPATH.
        // Let dex2oat use the BCP from boot image, excluding updatable BCP
        // modules for AOT to avoid app recompilation after their upgrades.
        unsetenv("BOOTCLASSPATH");

        SetDex2OatScheduling(boot_complete);
        SetDex2OatScheduling(boot_complete);
        if (flock(out_oat_fd.get(), LOCK_EX | LOCK_NB) != 0) {
        if (flock(out_oat_fd.get(), LOCK_EX | LOCK_NB) != 0) {
            PLOG(ERROR) << "flock(" << out_oat_path << ") failed";
            PLOG(ERROR) << "flock(" << out_oat_path << ") failed";