From b99050d89c0ef8a4a13f34246e06c4152e35712c Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Wed, 13 Mar 2019 15:29:48 +0000 Subject: [PATCH] Require the ANDROID_TZDATA_ROOT env var The ANDROID_TZDATA_ROOT serves a similar purpose to the ANDROID_RUNTIME_ROOT: it determines the location that can be used to find time zone data files. Since the Android Core Library will soon require it to be set it makes sense to check it alongside the ANDROID_RUNTIME_ROOT variable. Bug: 128422035 Test: build / boot Change-Id: Ie4860f60760905a06a744bd48fd773d0a4e8cf6d --- core/jni/AndroidRuntime.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 388285a5687f9..79850d03160ac 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -1112,6 +1112,12 @@ void AndroidRuntime::start(const char* className, const Vector& options return; } + const char* tzdataRootDir = getenv("ANDROID_TZDATA_ROOT"); + if (tzdataRootDir == NULL) { + LOG_FATAL("No tz data directory specified with ANDROID_TZDATA_ROOT environment variable."); + return; + } + //const char* kernelHack = getenv("LD_ASSUME_KERNEL"); //ALOGD("Found LD_ASSUME_KERNEL='%s'\n", kernelHack);