diff options
| author | 2019-02-22 21:42:45 +0000 | |
|---|---|---|
| committer | 2019-02-26 14:43:40 +0000 | |
| commit | ab0a190b009cb2feba6d01af043151a6a3723d9e (patch) | |
| tree | 1606ec303428831ca6666eef20f825622e5fad78 | |
| parent | d7d075fbf61f8391da21ffe17eb6d8ffbec0359c (diff) | |
Use DEX2OATBOOTCLASSPATH in installd.
Bug: 119800099
Bug: 122937705
Test: dexopt_test
Change-Id: Ie31762910a51ddb1211eed6a24456f0a70379d9c
| -rw-r--r-- | cmds/installd/dexopt.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp index acc06471b5..444ed870e6 100644 --- a/cmds/installd/dexopt.cpp +++ b/cmds/installd/dexopt.cpp @@ -293,6 +293,14 @@ class RunDex2Oat : public ExecVHelper { : "dalvik.vm.boot-dex2oat-threads"; std::string dex2oat_threads_arg = MapPropertyToArg(threads_property, "-j%s"); + std::string bootclasspath; + char* dex2oat_bootclasspath = getenv("DEX2OATBOOTCLASSPATH"); + if (dex2oat_bootclasspath != nullptr) { + bootclasspath = StringPrintf("-Xbootclasspath:%s", dex2oat_bootclasspath); + } + // If DEX2OATBOOTCLASSPATH is not in the environment, dex2oat is going to query + // BOOTCLASSPATH. + const std::string dex2oat_isa_features_key = StringPrintf("dalvik.vm.isa.%s.features", instruction_set); std::string instruction_set_features_arg = @@ -440,6 +448,7 @@ class RunDex2Oat : public ExecVHelper { AddArg(instruction_set_features_arg); AddRuntimeArg(boot_image); + AddRuntimeArg(bootclasspath); AddRuntimeArg(dex2oat_Xms_arg); AddRuntimeArg(dex2oat_Xmx_arg); @@ -1961,11 +1970,6 @@ int dexopt(const char* dex_path, uid_t uid, const char* pkgname, const char* ins /* child -- drop privileges before continuing */ 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); if (flock(out_oat_fd.get(), LOCK_EX | LOCK_NB) != 0) { PLOG(ERROR) << "flock(" << out_oat_path << ") failed"; |