From 3ce4ccec69f5649693b79c757795ec415456788e Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Fri, 23 Nov 2018 19:00:32 +0000 Subject: Make ANDROID_RUNTIME_ROOT a required env variable Make ANDROID_RUNTIME_ROOT a required environment variable for AndroidRuntime.cpp. Bug: 119935277 Test: build / treehugger Change-Id: I1098b4d7de8a8642ca5f431ec56a3f086f22b44f --- core/jni/AndroidRuntime.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index f7f10c49fbae..b94ac9c29f9f 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -1052,12 +1052,18 @@ void AndroidRuntime::start(const char* className, const Vector& options if (rootDir == NULL) { rootDir = "/system"; if (!hasDir("/system")) { - LOG_FATAL("No root directory specified, and /android does not exist."); + LOG_FATAL("No root directory specified, and /system does not exist."); return; } setenv("ANDROID_ROOT", rootDir, 1); } + const char* runtimeRootDir = getenv("ANDROID_RUNTIME_ROOT"); + if (runtimeRootDir == NULL) { + LOG_FATAL("No runtime directory specified with ANDROID_RUNTIME_ROOT environment variable."); + return; + } + //const char* kernelHack = getenv("LD_ASSUME_KERNEL"); //ALOGD("Found LD_ASSUME_KERNEL='%s'\n", kernelHack); -- cgit v1.2.3-59-g8ed1b