diff options
author | Ying Wang <wangying@google.com> | 2014-11-17 18:14:23 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-11-17 18:14:25 +0000 |
commit | 7f5fbe9e11e432a986387cdd72af9afaad8e7fd3 (patch) | |
tree | 3159a11b8772880ce3808a4b22c4efe9316eb57b /core/jni | |
parent | 867a0de0b4632984b7a73ee3489e4d1f66c19dd7 (diff) | |
parent | 995c62d6abd4b7080e52a60d1bffa32ae4a798a3 (diff) | |
download | frameworks_base-7f5fbe9e11e432a986387cdd72af9afaad8e7fd3.zip frameworks_base-7f5fbe9e11e432a986387cdd72af9afaad8e7fd3.tar.gz frameworks_base-7f5fbe9e11e432a986387cdd72af9afaad8e7fd3.tar.bz2 |
Merge "Frameworks/base: AndroidRuntime standalone preloaded-classes" into lmp-mr1-dev
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/AndroidRuntime.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 4d17877..c5f1d88 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -356,6 +356,15 @@ static int hasDir(const char* dir) return 0; } +static bool hasFile(const char* file) { + struct stat s; + int res = stat(file, &s); + if (res == 0) { + return S_ISREG(s.st_mode); + } + return false; +} + /* * Read the persistent locale. */ @@ -768,10 +777,16 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) parseCompilerOption("dalvik.vm.image-dex2oat-filter", dex2oatImageCompilerFilterBuf, "--compiler-filter=", "-Ximage-compiler-option"); } + + // Make sure there is a preloaded-classes file. + if (!hasFile("/system/etc/preloaded-classes")) { + ALOGE("Missing preloaded-classes file, /system/etc/preloaded-classes not found: %s\n", + strerror(errno)); + goto bail; + } addOption("-Ximage-compiler-option"); - addOption("--image-classes-zip=/system/framework/framework.jar"); - addOption("-Ximage-compiler-option"); - addOption("--image-classes=preloaded-classes"); + addOption("--image-classes=/system/etc/preloaded-classes"); + property_get("dalvik.vm.image-dex2oat-flags", dex2oatImageFlagsBuf, ""); parseExtraOpts(dex2oatImageFlagsBuf, "-Ximage-compiler-option"); |