OSDN Git Service

Frameworks/base: Compiled-classes support
authorAndreas Gampe <agampe@google.com>
Tue, 18 Nov 2014 19:48:22 +0000 (11:48 -0800)
committerAndreas Gampe <agampe@google.com>
Tue, 18 Nov 2014 19:48:22 +0000 (11:48 -0800)
Let AndroidRuntime check for /system/etc/compiled-classes and push
it to the runtime for boot image creation.

Bug: 18410571
Change-Id: I2510316381f2661166af24d7e14b013f4e045556

core/jni/AndroidRuntime.cpp

index c5f1d88..1fbd4a1 100644 (file)
@@ -787,6 +787,12 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
         addOption("-Ximage-compiler-option");
         addOption("--image-classes=/system/etc/preloaded-classes");
 
+        // If there is a compiled-classes file, push it.
+        if (hasFile("/system/etc/compiled-classes")) {
+            addOption("-Ximage-compiler-option");
+            addOption("--compiled-classes=/system/etc/compiled-classes");
+        }
+
         property_get("dalvik.vm.image-dex2oat-flags", dex2oatImageFlagsBuf, "");
         parseExtraOpts(dex2oatImageFlagsBuf, "-Ximage-compiler-option");