Add support for ANDROID_TZDATA_ROOT

Soon, code in the Android Core Library / ICU4C library will depend on the
ANDROID_TZDATA_ROOT environment variable being set. On device this points
to the root of the com.android.tzdata module.

Unlike ANDROID_RUNTIME_ROOT, ANDROID_TZDATA_ROOT it doesn't have to point to
anything that exists because the code will fall back to looking in
ANDROID_RUNTIME_ROOT if it can't find the files it is looking for. Most
of the changes in this commit are plumbing to make sure the environment
variable is set to benign defaults or passed through to the runtime.

This commit has been put together by looking for usages of
ANDROID_RUNTIME_ROOT and duplicating the logic.

Bug: 128422035
Test: build only
Change-Id: I2fd73fe16f5022742aaf634be158765cac8759e6
diff --git a/tools/art b/tools/art
index 58a8150..9e39464 100644
--- a/tools/art
+++ b/tools/art
@@ -200,6 +200,7 @@
     verbose_run ANDROID_DATA=$ANDROID_DATA                    \
           ANDROID_ROOT=$ANDROID_ROOT                          \
           ANDROID_RUNTIME_ROOT=$ANDROID_RUNTIME_ROOT          \
+          ANDROID_TZDATA_ROOT=$ANDROID_TZDATA_ROOT            \
           LD_LIBRARY_PATH=$LD_LIBRARY_PATH                    \
           PATH=$ANDROID_ROOT/bin:$PATH                        \
           LD_USE_LOAD_BIAS=1                                  \
@@ -275,6 +276,7 @@
   verbose_run ANDROID_DATA="$ANDROID_DATA"                  \
               ANDROID_ROOT="$ANDROID_ROOT"                  \
               ANDROID_RUNTIME_ROOT="$ANDROID_RUNTIME_ROOT"  \
+              ANDROID_TZDATA_ROOT="$ANDROID_TZDATA_ROOT"    \
               LD_LIBRARY_PATH="$LD_LIBRARY_PATH"            \
               PATH="$ANDROID_ROOT/bin:$PATH"                \
               LD_USE_LOAD_BIAS=1                            \
@@ -435,6 +437,13 @@
   fi
 fi
 
+# If ANDROID_TZDATA_ROOT is not set point it to somewhere safe. Android code
+# currently treats the module as optional so it does not require the path exists.
+if [ -z "$ANDROID_TZDATA_ROOT" ]; then
+  # Safe stubbed location that we don't need to exist.
+  ANDROID_TZDATA_ROOT="$ANDROID_ROOT/com.android.tzdata_doesnotexist"
+fi
+
 ART_BINARY_PATH=$ANDROID_ROOT/bin/$ART_BINARY
 
 if [ ! -x "$ART_BINARY_PATH" ]; then