Merge "Frameworks/base: AndroidRuntime standalone preloaded-classes" into lmp-mr1-dev
This commit is contained in:
@@ -356,6 +356,15 @@ static int hasDir(const char* dir)
|
|||||||
return 0;
|
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.
|
* Read the persistent locale.
|
||||||
*/
|
*/
|
||||||
@@ -768,10 +777,16 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
|
|||||||
parseCompilerOption("dalvik.vm.image-dex2oat-filter", dex2oatImageCompilerFilterBuf,
|
parseCompilerOption("dalvik.vm.image-dex2oat-filter", dex2oatImageCompilerFilterBuf,
|
||||||
"--compiler-filter=", "-Ximage-compiler-option");
|
"--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("-Ximage-compiler-option");
|
||||||
addOption("--image-classes-zip=/system/framework/framework.jar");
|
addOption("--image-classes=/system/etc/preloaded-classes");
|
||||||
addOption("-Ximage-compiler-option");
|
|
||||||
addOption("--image-classes=preloaded-classes");
|
|
||||||
property_get("dalvik.vm.image-dex2oat-flags", dex2oatImageFlagsBuf, "");
|
property_get("dalvik.vm.image-dex2oat-flags", dex2oatImageFlagsBuf, "");
|
||||||
parseExtraOpts(dex2oatImageFlagsBuf, "-Ximage-compiler-option");
|
parseExtraOpts(dex2oatImageFlagsBuf, "-Ximage-compiler-option");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user