diff options
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r-- | runtime/runtime.cc | 49 |
1 files changed, 3 insertions, 46 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 97911d4e20..15e3b1cfc7 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -108,9 +108,9 @@ #include "native/java_lang_VMClassLoader.h" #include "native/java_lang_ref_FinalizerReference.h" #include "native/java_lang_ref_Reference.h" -#include "native/java_lang_reflect_AbstractMethod.h" #include "native/java_lang_reflect_Array.h" #include "native/java_lang_reflect_Constructor.h" +#include "native/java_lang_reflect_Executable.h" #include "native/java_lang_reflect_Field.h" #include "native/java_lang_reflect_Method.h" #include "native/java_lang_reflect_Parameter.h" @@ -639,11 +639,7 @@ bool Runtime::Start() { system_class_loader_ = CreateSystemClassLoader(this); - if (is_zygote_) { - if (!InitZygote()) { - return false; - } - } else { + if (!is_zygote_) { if (is_native_bridge_loaded_) { PreInitializeNativeBridge("."); } @@ -688,45 +684,6 @@ void Runtime::EndThreadBirth() REQUIRES(Locks::runtime_shutdown_lock_) { } } -// Do zygote-mode-only initialization. -bool Runtime::InitZygote() { -#ifdef __linux__ - // zygote goes into its own process group - setpgid(0, 0); - - // See storage config details at http://source.android.com/tech/storage/ - // Create private mount namespace shared by all children - if (unshare(CLONE_NEWNS) == -1) { - PLOG(ERROR) << "Failed to unshare()"; - return false; - } - - // Mark rootfs as being a slave so that changes from default - // namespace only flow into our children. - if (mount("rootfs", "/", nullptr, (MS_SLAVE | MS_REC), nullptr) == -1) { - PLOG(ERROR) << "Failed to mount() rootfs as MS_SLAVE"; - return false; - } - - // Create a staging tmpfs that is shared by our children; they will - // bind mount storage into their respective private namespaces, which - // are isolated from each other. - const char* target_base = getenv("EMULATED_STORAGE_TARGET"); - if (target_base != nullptr) { - if (mount("tmpfs", target_base, "tmpfs", MS_NOSUID | MS_NODEV, - "uid=0,gid=1028,mode=0751") == -1) { - PLOG(ERROR) << "Failed to mount tmpfs to " << target_base; - return false; - } - } - - return true; -#else - UNIMPLEMENTED(FATAL); - return false; -#endif -} - void Runtime::InitNonZygoteOrPostFork( JNIEnv* env, bool is_system_server, NativeBridgeAction action, const char* isa) { is_zygote_ = false; @@ -1421,9 +1378,9 @@ void Runtime::RegisterRuntimeNativeMethods(JNIEnv* env) { register_java_lang_DexCache(env); register_java_lang_Object(env); register_java_lang_ref_FinalizerReference(env); - register_java_lang_reflect_AbstractMethod(env); register_java_lang_reflect_Array(env); register_java_lang_reflect_Constructor(env); + register_java_lang_reflect_Executable(env); register_java_lang_reflect_Field(env); register_java_lang_reflect_Method(env); register_java_lang_reflect_Parameter(env); |