summaryrefslogtreecommitdiffstats
path: root/core/jni
diff options
context:
space:
mode:
authorneo.chae <neo.chae@lge.com>2015-01-07 15:32:15 +0900
committerAndreas Gampe <agampe@google.com>2015-01-07 13:28:36 -0800
commit155118fee81f2761289438f4c4cd47d740ff8f88 (patch)
treea2c6dde65650b7d0bb349073cd030734217bbff1 /core/jni
parentea4cdd44541d76adea9b0b185740796d6cf6ac64 (diff)
downloadframeworks_base-155118fee81f2761289438f4c4cd47d740ff8f88.zip
frameworks_base-155118fee81f2761289438f4c4cd47d740ff8f88.tar.gz
frameworks_base-155118fee81f2761289438f4c4cd47d740ff8f88.tar.bz2
Core/jni: Disallow relocation for decryption
When decrypting a device, a tmpfs is temporarily mounted as /data, the size of which is usually small. When the zygote, system server and necessary apps are brought up, they will be compiled into the tmpfs. If the system image contains prebuilts, they will be relocated instead of compiled. This is unnecessary. In this special situation it is acceptable to run out of the prebuilt oat files without relocation, which can save space in the tmpfs. This patch ensures that the boot image is not being relocated. Change-Id: I42bfb7e3039574b7e4f2772e0d395f093d59ed1b Signed-off-by: Hyangseok Chae <neo.chae@lge.com>
Diffstat (limited to 'core/jni')
-rw-r--r--core/jni/AndroidRuntime.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index fb0d5d5..ce7f0d5 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -696,6 +696,14 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
if (skip_compilation) {
addOption("-Xcompiler-option");
addOption("--compiler-filter=verify-none");
+
+ // We skip compilation when a minimal runtime is brought up for decryption. In that case
+ // /data is temporarily backed by a tmpfs, which is usually small.
+ // If the system image contains prebuilts, they will be relocated into the tmpfs. In this
+ // specific situation it is acceptable to *not* relocate and run out of the prebuilts
+ // directly instead.
+ addOption("--runtime-arg");
+ addOption("-Xnorelocate");
} else {
parseCompilerOption("dalvik.vm.dex2oat-filter", dex2oatCompilerFilterBuf,
"--compiler-filter=", "-Xcompiler-option");