DO NOT MERGE - Skip pi-platform-release (PPRL.190505.001) in stage-aosp-master

Bug: 132622481
Change-Id: I9d675961067b16bfa4442e221d85a6b3c96a653c
diff --git a/Android.mk b/Android.mk
index 888404c..1711bfd 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,3 +1,18 @@
+# -*- mode: makefile -*-
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 LOCAL_PATH := $(call my-dir)
 
 include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..ac2cb6d
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,4 @@
+# Default code reviewers picked from top 3 or more developers.
+# Please update this list if you find better candidates.
+nfuller@google.com
+vichang@google.com
diff --git a/README.android b/README.android
index 127bd99..490de9b 100644
--- a/README.android
+++ b/README.android
@@ -4,6 +4,13 @@
 Directory structure
 ===================
 
+apex
+  - Code related to the Android time zone update APEX file that can be used
+    to update time zone rules on Android devices.
+
+debug_tools
+  - Contains tools useful for debugging time zone issues on Android devices.
+
 distro
   - Code related to "distros", the collection of files that can be used to
     update time zone rules on Android devices. See distro/README for details.
@@ -13,10 +20,13 @@
     Some files come from external sources and some are mastered in Android.
     See also download-iana-data.py.
 
+input_tools
+  - Contains tools that generate Android time zone files.
+
 output_data
   - Contains some derived files from the time zone rules update process and
-    used in the Android system image and distros. Some files are also held by
-    ICU - see also update-tzdata.py
+    used in the Android system image, distros and APEX files. Some files are
+    also held by ICU - see also update-tzdata.py
 
 testing
   - Contains tools and scripts related to testing time zone update code. See
@@ -28,19 +38,16 @@
     /data (as could happen if the device has just received an OTA upgrade).
     It is also responsible for committing staged install/uninstalls.
 
-zone_compactor
-  - Used to create Android's native tzdata file format from the files
-    produced by the zic tool. See also update-tzdata.py.
 
 
 Data file update tools
 ======================
 
-download-iana-data.py
+download-iana-files.py
   - A helper script run before update-tzdata.py.
-    It downloads the latest tzdata update from IANA and puts it in
-    the system/timezone/input_data/iana directory for use by the
-    update-tzdata.py script.
+    It downloads the latest tzdata and/or tzcode files from IANA and puts them
+    in the input_data/iana and input_tools/iana directories for use by the
+    update-tzdata.py script. See download-iana-files.py --help for more.
 
 update-tzdata.py
   - Regenerates the external/icu and system/timezone/output_data timezone
@@ -53,10 +60,8 @@
 
 When IANA release new time zone rules, the update process is:
 
-1) Run download-iana-data.py to update the system/timezone/input_data/iana
-  file.
-2) Make manual modifications to system/timezone/input_data/android files as
-  needed.
+1) Run "download-iana-files.py --data" to update the input_data/iana file.
+2) Make manual modifications to input_data/android files as needed.
 3) There are sometimes code and metadata changes associated with tzdata updates
   that should be applied to Android's copy of ICU.
   e.g. see http://bugs.icu-project.org/trac/search?q=2015d
@@ -72,33 +77,66 @@
 REMINDER: Any prebuilt apks of OEM-specific time zone data apps .apk files
 (i.e. ones that that contain distro files) will also need to be regenerated
 with a new version code / string and any OEM-specific tests should be run.
+APEX files containing time zone data files will also need to be regenerated.
+
+IANA tools changes
+==================
+
+Occasionally it might be necessary / desirable to update the version of zic
+used to generate Android's tzdata file. For example, if IANA introduce new
+syntax to the text rules files (e.g. asia, north_america, etc.) or adds useful
+command-line arguments to zic. This should be needed very rarely.
+
+It is recommended that this is done independently of a data update to help
+isolate unexpected changes to behavior.
+
+Note that updating the version of zic used to create the tzdata file is
+independent of the copy of zic used by ICU. Also, bionic contains
+a copy of tzcode (e.g. localtime.c) which is based on yet another IANA
+release so compatibility and consistency is a consideration.
+
+The steps for updating IANA tools are similar to updating IANA data except
+you can use "download-iana-files.py --tools" instead of "--data" and testing
+should be more rigorous.
+
+REMINDER: As above, having updated the tooling then all binaries that contain
+tzdata should also be regenerated. e.g. APK and APEX files.
 
 
-Distro Versioning
-=================
+Time Zone Data Set Versioning
+=============================
 
-The Android time zone "distro" is a zip archive containing the files needed
-to update a device's time zone rules by overlaying files into locations in /
-data. See distro/ for details.
+Android needs various files to be updated to take a time zone data update.
+These files come from various sources and we needed a concise shorthand
+to indicate compatibility between a set of files and an Android release. This is
+known as the "Time Zone Data Set Version". Currently we expect to increment this
+version with every dessert release, though this may change in future.
 
-The distro format (i.e. the files contained within the zip file) can change
-between major releases as Android evolves or makes updates to components that
-use the time zone data.
+The idea of a single version to describe time zone data updates was first
+introduced in O-MR1 with the concept of a "distro" which could be delivered by
+an APK. The Android time zone "distro" is a zip archive containing the files
+needed to update a device's time zone rules by overlaying files into locations
+in /data. See distro/ for details.
 
-Distros have a major and minor format version number:
+The "distro" concept will be removed in a future release of Android as it is
+being replaced by an APEX file containing the same data. As the APEX contains
+the same files we continue to use a shorthand version code. See apex/ for
+details.
 
-- Major format version numbers are mutually incompatible. e.g. v2 is not
-  compatible with a v1 or a v3 device.
-- Minor format version numbers are backwards compatible. e.g. a v2.2 distro
-  will work on a v2.1 device but not a v2.3 device.
+Time Zone Data Set Versions have a major and minor version number:
+
+- Major version numbers are mutually incompatible. e.g. v2 is not compatible
+  with a v1 or a v3 device.
+- Minor version numbers are backwards compatible. e.g. a v2.2 distro will work
+  on a v2.1 device but not a v2.3 device.
 - The minor version is reset to 1 when the major version is incremented.
 
 The most obvious/common change that can occur between Android releases is an
-ICU upgrade, which currently requires a major format version increment: Android
-uses the ICU4C's native format for both ICU4C and ICU4J time zone code which is
+ICU upgrade, which currently requires a major version increment: Android uses
+the ICU4C's native file format for both ICU4C and ICU4J time zone code which is
 tied to the ICU major version. The main .dat file used by ICU is held in
 external/icu and will naturally be updated when ICU is updated. Less obviously,
-the distro code and files must be updated as well.
+the time zone data set version code and files must be updated as well.
 
 Other examples of changes that affect format versioning:
 
@@ -114,29 +152,22 @@
     change to tzdata / tzlookup.xml).
 
 
-Changing the distro format version
-----------------------------------
+Changing the Time Zone Data Set Version
+---------------------------------------
 
-1) Modify distro/core/src/main/com/android/timezone/distro/DistroVersion.java:
+1) Modify libcore/luni/src/main/java/libcore/timezone/TzDataSetVersion.java
   - CURRENT_FORMAT_MAJOR_VERSION, CURRENT_FORMAT_MINOR_VERSION
-2) Modify: tzdatacheck/tzdatacheck.cpp
-  - SUPPORTED_DISTRO_MAJOR_VERSION, SUPPORTED_DISTRO_MINOR_VERSION
-3) Run update-tzdata.py to regenerate the system/timezone/output_data,
-  system/timezone/testing/data, external/icu runtime files and testing equivalents.
-4) Build/flash a device image with the changes and run CTS:
-    cts-tradefed
-    run cts -m CtsHostTzDataTests
-    run cts -m CtsLibcoreTestCases
-5) Run non-CTS test cases:
-    make -j30 FrameworksServicesTests
-    adb install -r -g \
-        "${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk"
-    adb shell am instrument -e package com.android.server.timezone -w \
-        com.android.frameworks.servicestests \
-        "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"
-6) Upload, review, submit the changes from system/timezone.
+2) Run update-tzdata.py to regenerate the system/timezone/output_data,
+   system/timezone/testing/data, external/icu runtime files and testing equivalents.
+3) Build/flash a device image with the changes and run CTS tests:
+    atest CtsHostTzDataTests
+    atest CtsLibcoreTestCases
+4) Run non-CTS test cases:
+    atest FrameworksServicesTests:com.android.server.timezone
+5) Upload, review, submit the changes from system/timezone and libcore.
+   Note: you may have changes in external/icu/ but usually there is no need to update
+   external/icu as only a timestamp in zoneinfo64.txt should have changed.
 
-REMINDER: Any prebuilt apks of OEM-specific time zone data apps .apk files
-(i.e. ones that that contain distro files) will also need to be regenerated
-with a new version code / string and any OEM-specific tests should be run.
+REMINDER: Any prebuilt apks / apex files (i.e. ones that that contain time zone files)
+will also need to be regenerated after this change.
 
diff --git a/apex/Android.bp b/apex/Android.bp
new file mode 100644
index 0000000..f1459a1
--- /dev/null
+++ b/apex/Android.bp
@@ -0,0 +1,58 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Defaults shared between real and test versions of the APEX.
+apex_defaults {
+    name: "com.android.tzdata-defaults",
+
+    // Use a custom AndroidManifest.xml used for API targeting.
+    androidManifest: ":com.android.tzdata-androidManifest",
+
+    // Explicit because the defaulting behavior only works for the real
+    // module.
+    file_contexts: "com.android.tzdata",
+
+    // Shared signing information.
+    key: "apex.tzdata.key",
+    certificate: ":com.android.tzdata.certificate",
+}
+
+filegroup {
+    name: "com.android.tzdata-androidManifest",
+    srcs: ["AndroidManifest.xml"],
+}
+
+apex_key {
+    name: "apex.tzdata.key",
+    public_key: "com.android.tzdata.avbpubkey",
+    private_key: "com.android.tzdata.pem",
+}
+
+android_app_certificate {
+    name: "com.android.tzdata.certificate",
+    certificate: "com.android.tzdata",
+}
+
+// The definition for the real (not test) tzdata APEX.
+apex {
+    name: "com.android.tzdata",
+    defaults: ["com.android.tzdata-defaults"],
+    manifest: "manifest.json",
+    prebuilts: [
+        "apex_tz_version",
+        "apex_tzlookup.xml",
+        "apex_tzdata",
+        "apex_icu_tzdata.dat",
+    ],
+}
diff --git a/apex/AndroidManifest.xml b/apex/AndroidManifest.xml
new file mode 100644
index 0000000..980d723
--- /dev/null
+++ b/apex/AndroidManifest.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+  package="com.android.tzdata">
+  <!-- APEX does not have classes.dex -->
+  <application android:hasCode="false" />
+  <!--
+    *  The content of the time zone data module is tied to (among other things)
+    *  the version of ICU being used on the device. Since that typically
+    *  updates every dessert release, we lock the module to a single API level.
+    -->
+  <uses-sdk android:minSdkVersion="28" android:maxSdkVersion="28" />
+</manifest>
diff --git a/apex/com.android.tzdata.avbpubkey b/apex/com.android.tzdata.avbpubkey
new file mode 100644
index 0000000..932091d
--- /dev/null
+++ b/apex/com.android.tzdata.avbpubkey
Binary files differ
diff --git a/apex/com.android.tzdata.pem b/apex/com.android.tzdata.pem
new file mode 100644
index 0000000..54e230f
--- /dev/null
+++ b/apex/com.android.tzdata.pem
@@ -0,0 +1,51 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIJJwIBAAKCAgEA5v5DXTp4uMYwEtOWBDT3sYo7NB1xHI65eeShmA8qn11E6vOJ
+bNfLt7smcvs3tfRli/1TlEwewnrshZJAfdexfpGLBzRW08ifHrZCFsWoGWm8cS5o
+qiN492DNaUNSRbGgK5atDzoz3xOwSlXGLgh8ychdVahQWThxLdVsj4auiMkb2/Rw
+PIEzIRbbI7QnVvEWGXpofV4cSgoTFMZtbnMpL33yxFolt/to/re+CYl1Bmj2zdpH
+cFNYPCU9lLJsLY/2IfhWHBrvAlsny3Z3oqJzkVEZo6d3bpMWD2zPqvdkeLe1NgSQ
+4tfZgMYTYM+bOGLKyZUWyUlderl69zRSA4rHxiFW3UIHAV1orrprjIrhrigVjAOG
+YBk1I8n7dwRhwWTvmvlTsa2/9gQmA7JMI50dbd6aNVm7ZpQ+vLQ7g8qobe403iwn
+IDxiIzPSLE9Ci2AiallOv6OfVApHfnOtFrBm7Xkx9IxQlyFjmd/NvnElNufZ/REM
+qKk/Wvlvxx9/m0ZaxtCOdLd8ShYgMIO28aDLh2IcSOpc9AAPuHp0/XoqoFlKdjK3
+qarUszqkjtFYITutqQe9KXSKOO2U8lmSedAXnB7TWWv6yyR+L9z3LfNoYTqB4HkS
+Wfefk1bi7ZU0YgIDS2aw9yrxh9HSAYMkKgxbrpPtWJK7EjhLPqtynP8lUTUCAwEA
+AQKCAgAj3PAahlx9249VLPKKnqqiLuL4OWX5WBNl4GBSWnB0o6dyjvMUKgDf+reC
+fIxuvI4TiPYz/Ql9ilY0ert2jklpbDFYogClCu3hd8yU+oUZxPfT3q+zUqSSS744
+jJI2bdh/S/p8db3d8ZGaSOzm8rxlG62aAfLPl1rDEfKz6eYpKIghwza1vh1xErpd
+Nbgx4GZc+EtGw5jCygOiYxhUYJ7RV82cPJ7EjM0FVwOzOVso7pz64tvajaYSWHnS
+H016WXKOXZ8I6AmZpQttpGv4nR4yPpQre3Gogj+Xj35CffxkXalNxLG19ms3eglC
+K5lezL/NQk9yWuifiDKWNNJS6HYRekxFs0azfEf8FziSApPDS93fNuz4KfMBwSde
+6DzxdClrA+uptS/azUPOWFj7xjZLFCcDpq8r+W4MY8oTgRhApSByGrLxHpVan81f
+aFoJ5tYcvEDXVSYqUn32Mkne5VqM/h/6U3xQ2hf8kgI841+t1ANbuJRX1CZ37IFb
+5VqifN+MzZX6FMueYsLPNr2Ss0qXaJp+nFUgUd+YvuC9gr7Hkik/Wx7f16M89h90
+9yBYeROdYapbtO6Mjhh4P3kB/G8E6qIMOWOFchWFQQqTO5FxqfoMgP1sL0xWhApP
+2DwjzVJd8GYEanWDpZVIxi5wmAMCkadMEs9M4+020RNt/eYPAQKCAQEA+bgIYFeF
+Jq00iUhF6agBFud97Ln2R4TkvQrJ0S5db5abNWDXkrI9RQZ1y9uYi1R5V2MB/QXX
+Nln8eXk9gnilFXEMNtTjdoOx6NHdVA3bSeiDdYc2FSVv9WvbwnmifO5oTivNE20H
+uAPNUcdwjl2eBmBZgTkC2JoaL3uHGG12K5sKEWfJSRIMaQk/TMm1SFsvljvEegBG
+bu78ku9OwhFfe4tkSeppYL7u/da4gCvXmxP4JGXARMkqbckj1Nkc6PBqXCucGk0p
+7IecyEgIIXIINXC9Lgde20yW7cOLOngKTTNyWbZws4rfTqaQ56Sm48QjFd+A05Lm
+oPT2NxLiWFGBQQKCAQEA7M2nYQioPmTrJ2JlUidwPYHPRTapGQl+xqp6vU5eklKA
+4GMfufK5v/0R9acpceSy82ZnuiG0fMOR3UDyPogNJVLY5hLDly+NXgWjGNuduS9r
+zJ412bdekUpr6ciSIq2SwzDQTq4P6sZO4dYgQYRQp62557uvdsR/49yKIVMCuTqg
+HIymewcOit4U+lKEgcTWOBDxwx5xDs19eKGTKDP3DJK5vZJT+f/psPS06lzUrKZP
+QueRDrAWNP7lvggNCPFEsHDE6AON5+fl3gQ0r5oukJWxN9KeZ3aKlB/3PF5LcSDH
+skdrAVQJk3mTsYhZW1/NMV7jmB/zWn+NKI/B3T8e9QKCAQBgVFae24QYrF4EyyV1
+AgMRk9EmvYG8iw41wnChydHvVtiembHu++TYuKo+LoLE1JxOUnoU4ejoJYRYU6Wf
+q+x6vfYpPKxWLm0106ceYo4CD7iOYM9DDwMGWEoY1hURPmJsLUdZxAhjOsw8TMQl
+lwV7jjVYvOZVKfUJ9gviJ2+bWJ5konWqQ1UYO6H4fCL7O3m66WlcarjA2F4ETF5E
+TLFZlibkwJFP6beFogvgHYl5YBWr7LhjkHpWiW3SEMKvNPbCgWwhVTzj6lhXhjnk
+tPlnrAq+M8eqrvvV0kXmEyJeL4dgBhmpmNuVmnlxcjmSyTmDmYk3lIZ09qn4CsfX
+q/FBAoIBABe5ivl3ypNlvQGXJBuVA/PFm6SNk2eEwgTZc66fuW3jgjH4/Ga+4MlR
+a4k3FDnq9drY+a92TQTq+yQ1q4+ERfzlTgHPA3WUOA+hdPO6nRS+oYhAmZiUfI8F
+68XiaHG8/iU8MMKRQdr9v011DIpD3WjPSP7kmPHHQiDsKZKpJG62ZvA1T0CoNlbH
+ZUanGct+kw/O8snftOgMwnNhjMLMYgYKdT1++Zbkgt9NxQpt/ojFqM9FMA1Oqwro
+NtBRMi0hLwaWZcPxBziizS7vMPAe/GdT+AtluKUZBU1N3pFXySsuY5ODAD+D0enK
+lneE957l/ELkBN1q5hC9EsFrlbq65jkCggEAczfsroQpAUknZWCuClrxmxH7WGy+
+InwDfmE8s74DaF9qH4NJA73ju7X8HEhqWRu1z7nfqJhPzQGp0ic6P8cwuynwceSx
+oHMJEYSSnpU99l6C/qHS7N30+OuVb5MFlbrQj65Haglg2MxaW9exNdE/Y3tVKKfg
+j/Ln1jgEbt6zkBpBz+9kHSRMY9Bs+SXMEqOTYfVtHfEvNGNkkcWOTbl7T3ep8lfk
+bTdA/5m/MnaOzznGPBbUsxWI/cC/ODtlVyY231iGMyeK6gWHJGJo81+aoT93WEbA
+++tuCuob3VIV4IZnn/m31KtajMDpFRxYbCJsqiR2K1sWckSHY+1mjHjPKQ==
+-----END RSA PRIVATE KEY-----
diff --git a/apex/com.android.tzdata.pk8 b/apex/com.android.tzdata.pk8
new file mode 100644
index 0000000..f786710
--- /dev/null
+++ b/apex/com.android.tzdata.pk8
Binary files differ
diff --git a/apex/com.android.tzdata.x509.pem b/apex/com.android.tzdata.x509.pem
new file mode 100644
index 0000000..bf78bee
--- /dev/null
+++ b/apex/com.android.tzdata.x509.pem
@@ -0,0 +1,34 @@
+-----BEGIN CERTIFICATE-----
+MIIFzjCCA7agAwIBAgIJAIyjs8l5WRp5MA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNV
+BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBW
+aWV3MRAwDgYDVQQKDAdBbmRyb2lkMRAwDgYDVQQLDAdBbmRyb2lkMRswGQYDVQQD
+DBJjb20uYW5kcm9pZC50emRhdGEwIBcNMTkwMTI1MTY0ODE0WhgPNDc1NjEyMjEx
+NjQ4MTRaMHsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYD
+VQQHDA1Nb3VudGFpbiBWaWV3MRAwDgYDVQQKDAdBbmRyb2lkMRAwDgYDVQQLDAdB
+bmRyb2lkMRswGQYDVQQDDBJjb20uYW5kcm9pZC50emRhdGEwggIiMA0GCSqGSIb3
+DQEBAQUAA4ICDwAwggIKAoICAQC3PzY5waM71QpWUVQPfTrtCf9Mx9097DjM6RlD
+jaOd2FtN7gUN/d+z19h0WRkBcBMDWH3z4aHIDp4YXABIdqIzXehhdCFLro4W6H4I
+TNcbH6/M4rmtGs2v0zCkrr8z/mEasCdsw9iz8LOiyouGxgt0Q2qPSQ3OcbZSGX0C
+T8VNxDIP1RpQdRUKhZt/hsmcuPHGq64yil/i7FHX4dLgjnik4sUkHPsQTam/H/J/
+brl9OToTCyRuTgaq6EfxCZVXPfxQE6KTDchFr4wYSbxIgSN9zk2wPLXCsyvSb2lV
+fDSbkRmS89cCaCArF3SP3FAKoZdxdNtT1Q/KayMs7c/jrhFloiIpkstNCzMrPT9i
+j5QwRqcBscSijqaEJOyK458EhaO7m3GHc9e+1afsxTIn//vbrpJU7ewOiwcAsJAT
+KGFMotbK1fV4jGCzKxDVBd1OP5yN/iPYS8INH4tt1W1Q5jaQn/Uy+RuS1tPZTtrL
+ldj/QJ/K9XNSg4v12hXlLDwUlwEMu2Akbe6BYItfhdAEITRr332l6e466cQDp3V2
+mOWANPEX35s5/CaxeqJOi3Y+DSx4iwjOKiormnnEalRFAZrSDU2UNxIqrmidl03Y
+/0p13ugbPmJbpXFPZFDPsUuvPuGLSAU2luUuFSgT0FVyWj5BfzFmcuLxQom03+ds
+cX8GxQIDAQABo1MwUTAdBgNVHQ4EFgQUVCZf+AGkP1wMi7C0l6FFefk9kVAwHwYD
+VR0jBBgwFoAUVCZf+AGkP1wMi7C0l6FFefk9kVAwDwYDVR0TAQH/BAUwAwEB/zAN
+BgkqhkiG9w0BAQsFAAOCAgEAc0NA+Ya/L5Vs+8CZ/5rP6dIbzbgL7tm1nmjU65jY
+8znsSrB0JDTEHCLc+9u35YU77Z3sW9lFE9el1i693gYQnYSy1lducHHKzbnss2/f
++DJ4QExrPR+PfnkSxdjL8+MXVAtVZDCeEBTcUgLES6m4WLS9hKL4+Oe+igXkAJA+
+d8w1/5ASuood3cTNy3nxssdueAKl4Tyj0y0zejoVlznaYw4zMTmlnrz1l0ZbaKiM
+tr52U2kASEVQW6EhiielsLMzDngqAQ49FQriv7oUhrlbmP3+CkhhPWbM3keSHm/a
+vIQGD3+mbJpekuRgC5w1nCborCxpnHoZUXMyb6/3PnY9u4O8VT5rY5NipVfL/Cvu
+12w0kvcuXTP58gvOJANB5t8Jo4tctG99hO0ECr7/439YM4NMkL5nYEcJe3DemquB
+pB7xVBAD7WKEcB5KV/oDXoLjxMlassKSAvBVbx+fvbGIW6k1pe3uiHl8p/zvxoNb
+9FFRoElCyuzzVP5r/kN5uNbPVIexbVET4elOcUhKigHWZHYv/PQ9ncpA8tbDeAIr
+vzoofKWv4r4tyQZLR4YnEYTGBORO6rX//Mcg8zKE6vXb0zKLW5vW1zxv31q1p2lC
+0R5e4ix7UjR8OJcBCnyKuqSRdCIpMitam2V+BXwh/7mLZBA4LuV4koNofVaBFxlt
+BCo=
+-----END CERTIFICATE-----
diff --git a/apex/manifest.json b/apex/manifest.json
new file mode 100644
index 0000000..a088815
--- /dev/null
+++ b/apex/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "com.android.tzdata",
+  "version": 1
+}
diff --git a/debug_tools/host/Android.bp b/debug_tools/host/Android.bp
new file mode 100644
index 0000000..c07e062
--- /dev/null
+++ b/debug_tools/host/Android.bp
@@ -0,0 +1,20 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+java_library_host {
+    name: "timezone_host_debug_tools",
+    srcs: ["main/java/**/*.java"],
+    static_libs: ["guava"],
+}
+
diff --git a/debug_tools/host/README.android b/debug_tools/host/README.android
new file mode 100644
index 0000000..7ea52ef
--- /dev/null
+++ b/debug_tools/host/README.android
@@ -0,0 +1,11 @@
+This directory contains tooling to help when debugging time zone issues on
+Android.
+
+dump-tzdata.py
+ - A tool that takes a tzdata file and splits it into component tzfiles,
+   zone.tab, etc. Run it with --help for usage. The individual tzfiles can
+   be inspected with tools like zdump, for example with "zdump -V <tzfile>"
+
+   It also dumps human-readable CSV files of the (v1) content currently used by
+   Android's ZoneInfo class. These can be inspected and compared with dumps from
+   other tzdata files easily using your favourite text diffing tool.
diff --git a/debug_tools/host/dump-tzdata.py b/debug_tools/host/dump-tzdata.py
new file mode 100755
index 0000000..30cc9ac
--- /dev/null
+++ b/debug_tools/host/dump-tzdata.py
@@ -0,0 +1,97 @@
+#!/usr/bin/python -B
+
+# Copyright 2019 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Dumps the contents of a tzdata file."""
+
+from __future__ import print_function
+
+import argparse
+import os
+import subprocess
+import sys
+
+sys.path.append('%s/external/icu/tools' % os.environ.get('ANDROID_BUILD_TOP'))
+import i18nutil
+
+
+# Calculate the paths that are referred to by multiple functions.
+android_build_top = i18nutil.GetAndroidRootOrDie()
+timezone_dir = os.path.realpath('%s/system/timezone' % android_build_top)
+i18nutil.CheckDirExists(timezone_dir, 'system/timezone')
+
+android_host_out = i18nutil.GetAndroidHostOutOrDie()
+
+debug_tools_dir = os.path.realpath('%s/system/timezone/debug_tools/host' % android_build_top)
+i18nutil.CheckDirExists(debug_tools_dir, 'system/timezone/debug_tools/host')
+
+
+def BuildDebugTools():
+  subprocess.check_call(['make', '-C', android_build_top, '-j30', 'timezone_host_debug_tools'])
+
+
+def SplitTzData(tzdata_file, output_dir):
+  jar_file = '%s/framework/timezone_host_debug_tools.jar' % android_host_out
+  subprocess.check_call(['java', '-cp', jar_file, 'ZoneSplitter', tzdata_file, output_dir])
+
+
+def CreateCsvFiles(zones_dir, csvs_dir):
+  jar_file = '%s/framework/timezone_host_debug_tools.jar' % android_host_out
+  subprocess.check_call(['java', '-cp', jar_file, 'TzFileDumper', zones_dir, csvs_dir])
+
+
+def CheckFileExists(file, filename):
+  if not os.path.isfile(file):
+    print("Couldn't find %s (%s)!" % (filename, file))
+    sys.exit(1)
+
+
+def main():
+  parser = argparse.ArgumentParser()
+  parser.add_argument('-tzdata', required=True,
+      help='The tzdata file to process')
+  parser.add_argument('-output', required=True,
+      help='The output directory for the dump')
+  args = parser.parse_args()
+
+  tzdata_file = args.tzdata
+  output_dir = args.output
+
+  CheckFileExists(tzdata_file, '-tzdata')
+  if not os.path.exists(output_dir):
+    print('Creating dir: %s'  % output_dir)
+    os.mkdir(output_dir)
+  i18nutil.CheckDirExists(output_dir, '-output')
+
+  BuildDebugTools()
+
+  SplitTzData(tzdata_file, output_dir)
+
+  zones_dir = '%s/zones' % output_dir
+  csvs_dir = '%s/csvs' % output_dir
+
+  i18nutil.CheckDirExists(zones_dir, 'zones output dir')
+  if not os.path.exists(csvs_dir):
+    os.mkdir(csvs_dir)
+
+  CreateCsvFiles(zones_dir, csvs_dir)
+
+  print('Look in %s for all extracted files' % output_dir)
+  print('Look in %s for dumped CSVs' % csvs_dir)
+  sys.exit(0)
+
+
+if __name__ == '__main__':
+  main()
diff --git a/debug_tools/host/main/java/TzFileDumper.java b/debug_tools/host/main/java/TzFileDumper.java
new file mode 100644
index 0000000..d06a66c
--- /dev/null
+++ b/debug_tools/host/main/java/TzFileDumper.java
@@ -0,0 +1,393 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.google.common.base.Joiner;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.nio.MappedByteBuffer;
+import java.nio.charset.StandardCharsets;
+import java.time.Duration;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Dumps out the contents of a tzfile in a CSV form.
+ *
+ * <p>This class contains a near copy of logic found in Android's ZoneInfo class.
+ */
+public class TzFileDumper {
+
+    public static void main(String[] args) throws Exception {
+        if (args.length != 2) {
+            System.err.println("usage: java TzFileDumper <tzfile|dir> <output file|output dir>");
+            System.exit(0);
+        }
+
+        File input = new File(args[0]);
+        File output = new File(args[1]);
+        if (input.isDirectory()) {
+            if (!output.isDirectory()) {
+                System.err.println("If first args is a directory, second arg must be a directory");
+                System.exit(1);
+            }
+
+            for (File inputFile : input.listFiles()) {
+                if (inputFile.isFile()) {
+                    File outputFile = new File(output, inputFile.getName() + ".csv");
+                    try {
+                        new TzFileDumper(inputFile, outputFile).execute();
+                    } catch (IOException e) {
+                        System.err.println("Error processing:" + inputFile);
+                    }
+                }
+            }
+        } else {
+            new TzFileDumper(input, output).execute();
+        }
+    }
+
+    private final File inputFile;
+    private final File outputFile;
+
+    private TzFileDumper(File inputFile, File outputFile) {
+        this.inputFile = inputFile;
+        this.outputFile = outputFile;
+    }
+
+    private void execute() throws IOException {
+        System.out.println("Dumping " + inputFile + " to " + outputFile);
+        MappedByteBuffer mappedTzFile = ZoneSplitter.createMappedByteBuffer(inputFile);
+
+        try (Writer fileWriter = new OutputStreamWriter(
+                new FileOutputStream(outputFile), StandardCharsets.UTF_8)) {
+            Header header32Bit = readHeader(mappedTzFile);
+            List<Transition> transitions32Bit = read32BitTransitions(mappedTzFile, header32Bit);
+            List<Type> types32Bit = readTypes(mappedTzFile, header32Bit);
+            skipUninteresting32BitData(mappedTzFile, header32Bit);
+            types32Bit = mergeTodInfo(mappedTzFile, header32Bit, types32Bit);
+
+            writeCsvRow(fileWriter, "File format version: " + (char) header32Bit.tzh_version);
+            writeCsvRow(fileWriter);
+            writeCsvRow(fileWriter, "32-bit data");
+            writeCsvRow(fileWriter);
+            writeTypes(types32Bit, fileWriter);
+            writeCsvRow(fileWriter);
+            writeTransitions(transitions32Bit, types32Bit, fileWriter);
+            writeCsvRow(fileWriter);
+
+            if (header32Bit.tzh_version >= '2') {
+                Header header64Bit = readHeader(mappedTzFile);
+                List<Transition> transitions64Bit = read64BitTransitions(mappedTzFile, header64Bit);
+                List<Type> types64Bit = readTypes(mappedTzFile, header64Bit);
+                skipUninteresting64BitData(mappedTzFile, header64Bit);
+                types64Bit = mergeTodInfo(mappedTzFile, header64Bit, types64Bit);
+
+                writeCsvRow(fileWriter, "64-bit data");
+                writeCsvRow(fileWriter);
+                writeTypes(types64Bit, fileWriter);
+                writeCsvRow(fileWriter);
+                writeTransitions(transitions64Bit, types64Bit, fileWriter);
+            }
+        }
+    }
+
+    private Header readHeader(MappedByteBuffer mappedTzFile) throws IOException {
+        // Variable names beginning tzh_ correspond to those in "tzfile.h".
+        // Check tzh_magic.
+        int tzh_magic = mappedTzFile.getInt();
+        if (tzh_magic != 0x545a6966) { // "TZif"
+            throw new IOException("File=" + inputFile + " has an invalid header=" + tzh_magic);
+        }
+
+        byte tzh_version = mappedTzFile.get();
+
+        // Skip the uninteresting part of the header.
+        mappedTzFile.position(mappedTzFile.position() + 15);
+        int tzh_ttisgmtcnt = mappedTzFile.getInt();
+        int tzh_ttisstdcnt = mappedTzFile.getInt();
+        int tzh_leapcnt = mappedTzFile.getInt();
+
+        // Read the sizes of the arrays we're about to read.
+        int tzh_timecnt = mappedTzFile.getInt();
+        // Arbitrary ceiling to prevent allocating memory for corrupt data.
+        // 2 per year with 2^32 seconds would give ~272 transitions.
+        final int MAX_TRANSITIONS = 2000;
+        if (tzh_timecnt < 0 || tzh_timecnt > MAX_TRANSITIONS) {
+            throw new IOException(
+                    "File=" + inputFile + " has an invalid number of transitions=" + tzh_timecnt);
+        }
+
+        int tzh_typecnt = mappedTzFile.getInt();
+        final int MAX_TYPES = 256;
+        if (tzh_typecnt < 1) {
+            throw new IOException("ZoneInfo requires at least one type to be provided for each"
+                    + " timezone but could not find one for '" + inputFile + "'");
+        } else if (tzh_typecnt > MAX_TYPES) {
+            throw new IOException(
+                    "File=" + inputFile + " has too many types=" + tzh_typecnt);
+        }
+
+        int tzh_charcnt = mappedTzFile.getInt();
+
+        return new Header(
+                tzh_version, tzh_ttisgmtcnt, tzh_ttisstdcnt, tzh_leapcnt, tzh_timecnt, tzh_typecnt,
+                tzh_charcnt);
+    }
+
+    private List<Transition> read32BitTransitions(MappedByteBuffer mappedTzFile, Header header)
+            throws IOException {
+
+        // Read the data.
+        int[] transitionTimes = new int[header.tzh_timecnt];
+        fillIntArray(mappedTzFile, transitionTimes);
+
+        byte[] typeIndexes = new byte[header.tzh_timecnt];
+        mappedTzFile.get(typeIndexes);
+
+        // Convert int times to longs
+        long[] transitionTimesLong = new long[header.tzh_timecnt];
+        for (int i = 0; i < header.tzh_timecnt; ++i) {
+            transitionTimesLong[i] = transitionTimes[i];
+        }
+
+        return createTransitions(header, transitionTimesLong, typeIndexes);
+    }
+
+    private List<Transition> createTransitions(Header header,
+            long[] transitionTimes, byte[] typeIndexes) throws IOException {
+        List<Transition> transitions = new ArrayList<>();
+        for (int i = 0; i < header.tzh_timecnt; ++i) {
+            if (i > 0 && transitionTimes[i] <= transitionTimes[i - 1]) {
+                throw new IOException(
+                        inputFile + " transition at " + i + " is not sorted correctly, is "
+                                + transitionTimes[i] + ", previous is " + transitionTimes[i - 1]);
+            }
+
+            int typeIndex = typeIndexes[i] & 0xff;
+            if (typeIndex >= header.tzh_typecnt) {
+                throw new IOException(inputFile + " type at " + i + " is not < "
+                        + header.tzh_typecnt + ", is " + typeIndex);
+            }
+
+            Transition transition = new Transition(transitionTimes[i], typeIndex);
+            transitions.add(transition);
+        }
+        return transitions;
+    }
+
+    private List<Transition> read64BitTransitions(MappedByteBuffer mappedTzFile, Header header)
+            throws IOException {
+        long[] transitionTimes = new long[header.tzh_timecnt];
+        fillLongArray(mappedTzFile, transitionTimes);
+
+        byte[] typeIndexes = new byte[header.tzh_timecnt];
+        mappedTzFile.get(typeIndexes);
+
+        return createTransitions(header, transitionTimes, typeIndexes);
+    }
+
+    private void writeTransitions(List<Transition> transitions, List<Type> types, Writer fileWriter)
+            throws IOException {
+
+        List<Object[]> rows = new ArrayList<>();
+        for (Transition transition : transitions) {
+            Type type = types.get(transition.typeIndex);
+            Object[] row = new Object[] {
+                    transition.transitionTimeSeconds,
+                    transition.typeIndex,
+                    formatTimeSeconds(transition.transitionTimeSeconds),
+                    formatDurationSeconds(type.gmtOffsetSeconds),
+                    formatIsDst(type.isDst),
+            };
+            rows.add(row);
+        }
+
+        writeCsvRow(fileWriter, "Transitions");
+        writeTuplesCsv(fileWriter, rows, "transition", "type", "[UTC time]", "[Type offset]",
+                "[Type isDST]");
+    }
+
+    private List<Type> readTypes(MappedByteBuffer mappedTzFile, Header header) throws IOException {
+        List<Type> types = new ArrayList<>();
+        for (int i = 0; i < header.tzh_typecnt; ++i) {
+            int gmtOffsetSeconds = mappedTzFile.getInt();
+            byte isDst = mappedTzFile.get();
+            if (isDst != 0 && isDst != 1) {
+                throw new IOException(inputFile + " dst at " + i + " is not 0 or 1, is " + isDst);
+            }
+
+            // We skip the abbreviation index.
+            mappedTzFile.get();
+
+            types.add(new Type(gmtOffsetSeconds, isDst));
+        }
+        return types;
+    }
+
+    private static void skipUninteresting32BitData(MappedByteBuffer mappedTzFile, Header header) {
+        mappedTzFile.get(new byte[header.tzh_charcnt]);
+        int leapInfoSize = 4 + 4;
+        mappedTzFile.get(new byte[header.tzh_leapcnt * leapInfoSize]);
+    }
+
+
+    private void skipUninteresting64BitData(MappedByteBuffer mappedTzFile, Header header) {
+        mappedTzFile.get(new byte[header.tzh_charcnt]);
+        int leapInfoSize = 8 + 4;
+        mappedTzFile.get(new byte[header.tzh_leapcnt * leapInfoSize]);
+    }
+
+    /**
+     * Populate ttisstd and ttisgmt information by copying {@code types} and populating those fields
+     * in the copies.
+     */
+    private static List<Type> mergeTodInfo(
+            MappedByteBuffer mappedTzFile, Header header, List<Type> types) {
+
+        byte[] ttisstds = new byte[header.tzh_ttisstdcnt];
+        mappedTzFile.get(ttisstds);
+        byte[] ttisgmts = new byte[header.tzh_ttisgmtcnt];
+        mappedTzFile.get(ttisgmts);
+
+        List<Type> outputTypes = new ArrayList<>();
+        for (int i = 0; i < types.size(); i++) {
+            Type inputType = types.get(i);
+            Byte ttisstd = ttisstds.length == 0 ? null : ttisstds[i];
+            Byte ttisgmt = ttisgmts.length == 0 ? null : ttisgmts[i];
+            Type outputType =
+                    new Type(inputType.gmtOffsetSeconds, inputType.isDst, ttisstd, ttisgmt);
+            outputTypes.add(outputType);
+        }
+        return outputTypes;
+    }
+
+    private void writeTypes(List<Type> types, Writer fileWriter) throws IOException {
+        List<Object[]> rows = new ArrayList<>();
+        for (Type type : types) {
+            Object[] row = new Object[] {
+                    type.gmtOffsetSeconds,
+                    type.isDst,
+                    type.ttisgmt,
+                    type.ttisstd,
+                    formatDurationSeconds(type.gmtOffsetSeconds),
+                    formatIsDst(type.isDst),
+            };
+            rows.add(row);
+        }
+
+        writeCsvRow(fileWriter, "Types");
+        writeTuplesCsv(
+                fileWriter, rows, "gmtOffset (seconds)", "isDst", "ttisgmt", "ttisstd",
+                "[gmtOffset ISO]", "[DST?]");
+    }
+
+    private static void fillIntArray(MappedByteBuffer mappedByteBuffer, int[] toFill) {
+        for (int i = 0; i < toFill.length; i++) {
+            toFill[i] = mappedByteBuffer.getInt();
+        }
+    }
+
+    private static void fillLongArray(MappedByteBuffer mappedByteBuffer, long[] toFill) {
+        for (int i = 0; i < toFill.length; i++) {
+            toFill[i] = mappedByteBuffer.getLong();
+        }
+    }
+
+    private static String formatTimeSeconds(long timeInSeconds) {
+        long timeInMillis = timeInSeconds * 1000L;
+        return Instant.ofEpochMilli(timeInMillis).toString();
+    }
+
+    private static String formatDurationSeconds(int duration) {
+        return Duration.ofSeconds(duration).toString();
+    }
+
+    private String formatIsDst(byte isDst) {
+        return isDst == 0 ? "STD" : "DST";
+    }
+
+    private static void writeCsvRow(Writer writer, Object... values) throws IOException {
+        writer.append(Joiner.on(',').join(values));
+        writer.append('\n');
+    }
+
+    private static void writeTuplesCsv(Writer writer, List<Object[]> lines, String... headings)
+            throws IOException {
+
+        writeCsvRow(writer, (Object[]) headings);
+        for (Object[] line : lines) {
+            writeCsvRow(writer, line);
+        }
+    }
+
+    private static class Header {
+
+        /** The version. Known values are 0 (ASCII NUL), 50 (ASCII '2'), 51 (ASCII '3'). */
+        final byte tzh_version;
+        final int tzh_timecnt;
+        final int tzh_typecnt;
+        final int tzh_charcnt;
+        final int tzh_leapcnt;
+        final int tzh_ttisstdcnt;
+        final int tzh_ttisgmtcnt;
+
+        Header(byte tzh_version, int tzh_ttisgmtcnt, int tzh_ttisstdcnt, int tzh_leapcnt,
+                int tzh_timecnt, int tzh_typecnt, int tzh_charcnt) {
+            this.tzh_version = tzh_version;
+            this.tzh_timecnt = tzh_timecnt;
+            this.tzh_typecnt = tzh_typecnt;
+            this.tzh_charcnt = tzh_charcnt;
+            this.tzh_leapcnt = tzh_leapcnt;
+            this.tzh_ttisstdcnt = tzh_ttisstdcnt;
+            this.tzh_ttisgmtcnt = tzh_ttisgmtcnt;
+        }
+    }
+
+    private static class Type {
+
+        final int gmtOffsetSeconds;
+        final byte isDst;
+        final Byte ttisstd;
+        final Byte ttisgmt;
+
+        Type(int gmtOffsetSeconds, byte isDst) {
+            this(gmtOffsetSeconds, isDst, null, null);
+        }
+
+        Type(int gmtOffsetSeconds, byte isDst, Byte ttisstd, Byte ttisgmt) {
+            this.gmtOffsetSeconds = gmtOffsetSeconds;
+            this.isDst = isDst;
+            this.ttisstd = ttisstd;
+            this.ttisgmt = ttisgmt;
+        }
+    }
+
+    private static class Transition {
+
+        final long transitionTimeSeconds;
+        final int typeIndex;
+
+        Transition(long transitionTimeSeconds, int typeIndex) {
+            this.transitionTimeSeconds = transitionTimeSeconds;
+            this.typeIndex = typeIndex;
+        }
+    }
+}
diff --git a/debug_tools/host/main/java/ZoneSplitter.java b/debug_tools/host/main/java/ZoneSplitter.java
new file mode 100644
index 0000000..3dd30ff
--- /dev/null
+++ b/debug_tools/host/main/java/ZoneSplitter.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.StandardOpenOption;
+import java.util.Arrays;
+
+/**
+ * Reverses the ZoneCompactor process to extract information and zic output files from Android's
+ * tzdata file. This enables easier debugging / inspection of Android's tzdata file with standard
+ * tools like zdump or Android tools like TzFileDumper.
+ *
+ * <p>This class contains a copy of logic found in Android's ZoneInfoDB.
+ */
+public class ZoneSplitter {
+
+    public static void main(String[] args) throws Exception {
+        if (args.length != 2) {
+            System.err.println("usage: java ZoneSplitter <tzdata file> <output directory>");
+            System.exit(0);
+        }
+        new ZoneSplitter(args[0], args[1]).execute();
+    }
+
+    private final File tzData;
+    private final File outputDir;
+
+    private ZoneSplitter(String tzData, String outputDir) {
+        this.tzData = new File(tzData);
+        this.outputDir = new File(outputDir);
+    }
+
+    private void execute() throws IOException {
+        if (!(tzData.exists() && tzData.isFile() && tzData.canRead())) {
+            throw new IOException(tzData + " not found or is not readable");
+        }
+        if (!(outputDir.exists() && outputDir.isDirectory())) {
+            throw new IOException(outputDir + " not found or is not a directory");
+        }
+
+        MappedByteBuffer mappedFile = createMappedByteBuffer(tzData);
+
+        // byte[12] tzdata_version  -- "tzdata2012f\0"
+        // int index_offset
+        // int data_offset
+        // int zonetab_offset
+        writeVersionFile(mappedFile, outputDir);
+
+        final int fileSize = (int) tzData.length();
+        int index_offset = mappedFile.getInt();
+        validateOffset(index_offset, fileSize);
+        int data_offset = mappedFile.getInt();
+        validateOffset(data_offset, fileSize);
+        int zonetab_offset = mappedFile.getInt();
+        validateOffset(zonetab_offset, fileSize);
+
+        if (index_offset >= data_offset || data_offset >= zonetab_offset) {
+            throw new IOException("Invalid offset: index_offset=" + index_offset
+                    + ", data_offset=" + data_offset + ", zonetab_offset=" + zonetab_offset
+                    + ", fileSize=" + fileSize);
+        }
+
+        File zicFilesDir = new File(outputDir, "zones");
+        zicFilesDir.mkdir();
+        extractZicFiles(mappedFile, index_offset, data_offset, zicFilesDir);
+
+        writeZoneTabFile(mappedFile, zonetab_offset, fileSize - zonetab_offset, outputDir);
+    }
+
+    static MappedByteBuffer createMappedByteBuffer(File tzData) throws IOException {
+        MappedByteBuffer mappedFile;
+        RandomAccessFile file = new RandomAccessFile(tzData, "r");
+        try (FileChannel fileChannel = file.getChannel()) {
+            mappedFile = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, file.length());
+        }
+        mappedFile.load();
+        return mappedFile;
+    }
+
+    private static void validateOffset(int offset, int size) throws IOException {
+        if (offset < 0 || offset >= size) {
+            throw new IOException("Invalid offset=" + offset + ", size=" + size);
+        }
+    }
+
+    private static void writeVersionFile(MappedByteBuffer mappedFile, File targetDir)
+            throws IOException {
+
+        byte[] tzdata_version = new byte[12];
+        mappedFile.get(tzdata_version);
+
+        String magic = new String(tzdata_version, 0, 6, StandardCharsets.US_ASCII);
+        if (!magic.startsWith("tzdata") || tzdata_version[11] != 0) {
+            throw new IOException("bad tzdata magic: " + Arrays.toString(tzdata_version));
+        }
+        writeStringUtf8ToFile(new File(targetDir, "version"),
+                new String(tzdata_version, 6, 5, StandardCharsets.US_ASCII));
+    }
+
+    private static void extractZicFiles(MappedByteBuffer mappedFile, int indexOffset,
+            int dataOffset, File outputDir) throws IOException {
+
+        mappedFile.position(indexOffset);
+
+        // The index of the tzdata file is made up of entries for each time zone ID which describe
+        // the location of the associated zic data in the data section of the file. The index
+        // section has no padding so we can determine the number of entries from the size.
+        //
+        // Each index entry consists of:
+        // byte[MAXNAME] idBytes - the id string, \0 terminated. e.g. "America/New_York\0"
+        // int32 byteOffset      - the offset of the start of the zic data relative to the start of
+        //                         the tzdata data section
+        // int32 length          - the length of the of the zic data
+        // int32 unused          - no longer used
+        final int MAXNAME = 40;
+        final int SIZEOF_OFFSET = 4;
+        final int SIZEOF_INDEX_ENTRY = MAXNAME + 3 * SIZEOF_OFFSET;
+
+        int indexSize = (dataOffset - indexOffset);
+        if (indexSize % SIZEOF_INDEX_ENTRY != 0) {
+            throw new IOException("Index size is not divisible by " + SIZEOF_INDEX_ENTRY
+                    + ", indexSize=" + indexSize);
+        }
+
+        byte[] idBytes = new byte[MAXNAME];
+        int entryCount = indexSize / SIZEOF_INDEX_ENTRY;
+        int[] byteOffsets = new int[entryCount];
+        int[] lengths = new int[entryCount];
+        String[] ids = new String[entryCount];
+
+        for (int i = 0; i < entryCount; i++) {
+            // Read the fixed length timezone ID.
+            mappedFile.get(idBytes, 0, idBytes.length);
+
+            // Read the offset into the file where the data for ID can be found.
+            byteOffsets[i] = mappedFile.getInt();
+            byteOffsets[i] += dataOffset;
+
+            lengths[i] = mappedFile.getInt();
+            if (lengths[i] < 44) {
+                throw new IOException("length in index file < sizeof(tzhead)");
+            }
+            mappedFile.getInt(); // Skip the unused 4 bytes that used to be the raw offset.
+
+            // Calculate the true length of the ID.
+            int len = 0;
+            while (len < idBytes.length && idBytes[len] != 0) {
+                len++;
+            }
+            if (len == 0) {
+                throw new IOException("Invalid ID at index=" + i);
+            }
+            ids[i] = new String(idBytes, 0, len, StandardCharsets.US_ASCII);
+            if (i > 0) {
+                if (ids[i].compareTo(ids[i - 1]) <= 0) {
+                    throw new IOException(
+                            "Index not sorted or contains multiple entries with the same ID"
+                            + ", index=" + i + ", ids[i]=" + ids[i] + ", ids[i - 1]=" + ids[i - 1]);
+                }
+            }
+        }
+        for (int i = 0; i < entryCount; i++) {
+            String id = ids[i];
+            int byteOffset = byteOffsets[i];
+            int length = lengths[i];
+
+            File subFile = new File(outputDir, id.replace('/', '_'));
+            mappedFile.position(byteOffset);
+            byte[] bytes = new byte[length];
+            mappedFile.get(bytes, 0, length);
+
+            writeBytesToFile(subFile, bytes);
+        }
+    }
+
+    private static void writeZoneTabFile(MappedByteBuffer mappedFile,
+            int zoneTabOffset, int zoneTabSize, File outputDir) throws IOException {
+        byte[] bytes = new byte[zoneTabSize];
+        mappedFile.position(zoneTabOffset);
+        mappedFile.get(bytes, 0, bytes.length);
+        writeBytesToFile(new File(outputDir, "zone.tab"), bytes);
+    }
+
+    private static void writeStringUtf8ToFile(File file, String string) throws IOException {
+        writeBytesToFile(file, string.getBytes(StandardCharsets.UTF_8));
+    }
+
+    private static void writeBytesToFile(File file, byte[] bytes) throws IOException {
+        System.out.println("Writing: " + file);
+        Files.write(file.toPath(), bytes, StandardOpenOption.CREATE);
+    }
+}
diff --git a/distro/core/Android.bp b/distro/core/Android.bp
index 2adff01..67536da 100644
--- a/distro/core/Android.bp
+++ b/distro/core/Android.bp
@@ -18,17 +18,22 @@
 // This is distinct from time_zone_distro_unbundled. It should be used
 // for platform code as it avoids circular dependencies when stubs targets
 // need to build framework (as appears to be the case in aosp/master).
-// Also used for host-side tests.
-java_library_static {
+// Also used from host-side tests and tools.
+java_library {
     name: "time_zone_distro",
     host_supported: true,
 
     srcs: ["src/main/**/*.java"],
+    target: {
+        host: {
+            static_libs: ["timezone-host"],
+        },
+    },
 }
 
 // Library of classes for handling time zone distros. Used in unbundled
 // cases. Same as above, except dependent on system_current stubs.
-java_library_static {
+java_library {
     name: "time_zone_distro_unbundled",
 
     srcs: ["src/main/**/*.java"],
@@ -36,12 +41,13 @@
 }
 
 // Tests for time_zone_distro code.
-java_library_static {
+java_library {
     name: "time_zone_distro-tests",
 
     srcs: ["src/test/**/*.java"],
     static_libs: [
         "time_zone_distro",
+        "core-tests-support",
         "junit",
     ],
 }
diff --git a/distro/core/src/main/com/android/timezone/distro/DistroVersion.java b/distro/core/src/main/com/android/timezone/distro/DistroVersion.java
index 5d87d28..a3ead3f 100644
--- a/distro/core/src/main/com/android/timezone/distro/DistroVersion.java
+++ b/distro/core/src/main/com/android/timezone/distro/DistroVersion.java
@@ -26,27 +26,11 @@
  */
 public class DistroVersion {
 
-    /**
-     * The major distro format version supported by this device.
-     * Increment this for non-backwards compatible changes to the distro format. Reset the minor
-     * version to 1 when doing so.
-     * This constant must match the one in system/core/tzdatacheck/tzdatacheck.cpp.
-     */
-    public static final int CURRENT_FORMAT_MAJOR_VERSION = 2;
-
-    /**
-     * The minor distro format version supported by this device. Increment this for
-     * backwards-compatible changes to the distro format.
-     * This constant must match the one in system/core/tzdatacheck/tzdatacheck.cpp.
-     */
-    public static final int CURRENT_FORMAT_MINOR_VERSION = 1;
-
-    /** The full major + minor distro format version for this device. */
-    private static final String FULL_CURRENT_FORMAT_VERSION_STRING =
-            toFormatVersionString(CURRENT_FORMAT_MAJOR_VERSION, CURRENT_FORMAT_MINOR_VERSION);
+    /** An example major + minor distro format version string. */
+    private static final String SAMPLE_FORMAT_VERSION_STRING = toFormatVersionString(1, 1);
 
     private static final int FORMAT_VERSION_STRING_LENGTH =
-            FULL_CURRENT_FORMAT_VERSION_STRING.length();
+            SAMPLE_FORMAT_VERSION_STRING.length();
     private static final Pattern FORMAT_VERSION_PATTERN = Pattern.compile("(\\d{3})\\.(\\d{3})");
 
     /** A pattern that matches the IANA rules value of a rules update. e.g. "2016g" */
@@ -124,11 +108,6 @@
                 .getBytes(StandardCharsets.US_ASCII);
     }
 
-    public static boolean isCompatibleWithThisDevice(DistroVersion distroVersion) {
-        return (CURRENT_FORMAT_MAJOR_VERSION == distroVersion.formatMajorVersion)
-                && (CURRENT_FORMAT_MINOR_VERSION <= distroVersion.formatMinorVersion);
-    }
-
     @Override
     public boolean equals(Object o) {
         if (this == o) {
diff --git a/distro/core/src/main/com/android/timezone/distro/TimeZoneDistro.java b/distro/core/src/main/com/android/timezone/distro/TimeZoneDistro.java
index a21b261..27dca1d 100644
--- a/distro/core/src/main/com/android/timezone/distro/TimeZoneDistro.java
+++ b/distro/core/src/main/com/android/timezone/distro/TimeZoneDistro.java
@@ -21,8 +21,6 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Arrays;
-import java.util.function.Supplier;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
diff --git a/distro/core/src/test/com/android/timezone/distro/DistroVersionTest.java b/distro/core/src/test/com/android/timezone/distro/DistroVersionTest.java
index a4d96c5..7f54e84 100644
--- a/distro/core/src/test/com/android/timezone/distro/DistroVersionTest.java
+++ b/distro/core/src/test/com/android/timezone/distro/DistroVersionTest.java
@@ -63,38 +63,6 @@
         assertEquals(distroVersion, DistroVersion.fromBytes(distroVersion.toBytes()));
     }
 
-    public void testIsCompatibleWithThisDevice() throws Exception {
-        DistroVersion exactMatch = createDistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION);
-        assertTrue(DistroVersion.isCompatibleWithThisDevice(exactMatch));
-
-        DistroVersion newerMajor = createDistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION + 1,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION);
-        assertFalse(DistroVersion.isCompatibleWithThisDevice(newerMajor));
-
-        DistroVersion newerMinor = createDistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION + 1);
-        assertTrue(DistroVersion.isCompatibleWithThisDevice(newerMinor));
-
-        // The constant versions should never be below 1. We allow 0 but want to start version
-        // numbers at 1 to allow testing of older version logic.
-        assertTrue(DistroVersion.CURRENT_FORMAT_MAJOR_VERSION >= 1);
-        assertTrue(DistroVersion.CURRENT_FORMAT_MINOR_VERSION >= 1);
-
-        DistroVersion olderMajor = createDistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION - 1,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION);
-        assertFalse(DistroVersion.isCompatibleWithThisDevice(olderMajor));
-
-        DistroVersion olderMinor = createDistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION - 1);
-        assertFalse(DistroVersion.isCompatibleWithThisDevice(olderMinor));
-    }
-
     private DistroVersion createDistroVersion(int majorFormatVersion, int minorFormatVersion)
             throws DistroException {
         return new DistroVersion(majorFormatVersion, minorFormatVersion, VALID_RULES_VERSION, 3);
diff --git a/distro/core/src/test/com/android/timezone/distro/FileUtilsTest.java b/distro/core/src/test/com/android/timezone/distro/FileUtilsTest.java
index 8606009..6b51a4d 100644
--- a/distro/core/src/test/com/android/timezone/distro/FileUtilsTest.java
+++ b/distro/core/src/test/com/android/timezone/distro/FileUtilsTest.java
@@ -21,6 +21,8 @@
 import android.system.OsConstants;
 import android.system.StructStat;
 
+import libcore.testing.io.TestIoUtils;
+
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
@@ -30,7 +32,6 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
-import libcore.io.IoUtils;
 
 /**
  * Tests for {@link FileUtils}.
@@ -344,7 +345,7 @@
 
     private File createTempDir() {
         final String tempPrefix = getClass().getSimpleName();
-        File tempDir = IoUtils.createTemporaryDirectory(tempPrefix);
+        File tempDir = TestIoUtils.createTemporaryDirectory(tempPrefix);
         testFiles.add(tempDir);
         return tempDir;
     }
diff --git a/distro/core/src/test/com/android/timezone/distro/TimeZoneDistroTest.java b/distro/core/src/test/com/android/timezone/distro/TimeZoneDistroTest.java
index ce3669e..ac6d825 100644
--- a/distro/core/src/test/com/android/timezone/distro/TimeZoneDistroTest.java
+++ b/distro/core/src/test/com/android/timezone/distro/TimeZoneDistroTest.java
@@ -17,6 +17,9 @@
 
 import junit.framework.TestCase;
 
+import libcore.testing.io.TestIoUtils;
+import libcore.timezone.TzDataSetVersion;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -27,10 +30,8 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.function.Supplier;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
-import libcore.io.IoUtils;
 
 /**
  * Tests for {@link TimeZoneDistro}.
@@ -50,8 +51,9 @@
     }
 
     public void testGetDistroVersion() throws Exception {
-        DistroVersion distroVersion = new DistroVersion(DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION, "2016c", 1);
+        DistroVersion distroVersion = new DistroVersion(
+                TzDataSetVersion.currentFormatMajorVersion(),
+                TzDataSetVersion.currentFormatMinorVersion(), "2016c", 1);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try (ZipOutputStream zipOutputStream = new ZipOutputStream(baos)) {
             addZipEntry(zipOutputStream, TimeZoneDistro.DISTRO_VERSION_FILE_NAME,
@@ -63,8 +65,8 @@
     }
 
     public void testGetDistroVersion_closesStream() throws Exception {
-        DistroVersion distroVersion = new DistroVersion(DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION, "2016c", 1);
+        DistroVersion distroVersion = new DistroVersion(
+                3 /* majorVersion */, 2 /* minorVersion */, "2016c", 1);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try (ZipOutputStream zipOutputStream = new ZipOutputStream(baos)) {
             addZipEntry(zipOutputStream, TimeZoneDistro.DISTRO_VERSION_FILE_NAME,
@@ -79,8 +81,8 @@
     }
 
     public void testExtractTo_closesStream() throws Exception {
-        DistroVersion distroVersion = new DistroVersion(DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION, "2016c", 1);
+        DistroVersion distroVersion = new DistroVersion(
+                3 /* majorVersion */, 2 /* minorVersion */, "2016c", 1);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try (ZipOutputStream zipOutputStream = new ZipOutputStream(baos)) {
             addZipEntry(zipOutputStream, TimeZoneDistro.DISTRO_VERSION_FILE_NAME,
@@ -166,7 +168,7 @@
 
     private File createTempDir() {
         final String tempPrefix = getClass().getSimpleName();
-        File tempDir = IoUtils.createTemporaryDirectory(tempPrefix);
+        File tempDir = TestIoUtils.createTemporaryDirectory(tempPrefix);
         testFiles.add(tempDir);
         return tempDir;
     }
diff --git a/distro/installer/Android.bp b/distro/installer/Android.bp
index 8750f91..75c1939 100644
--- a/distro/installer/Android.bp
+++ b/distro/installer/Android.bp
@@ -13,7 +13,7 @@
 // limitations under the License.
 
 // The classes needed to handle installation of time zone distros.
-java_library_static {
+java_library {
     name: "time_zone_distro_installer",
 
     srcs: ["src/main/**/*.java"],
@@ -21,13 +21,13 @@
 }
 
 // Tests for time_zone_distro_installer code
-java_library_static {
+java_library {
     name: "time_zone_distro_installer-tests",
 
     srcs: ["src/test/**/*.java"],
     static_libs: [
         "time_zone_distro",
-        "time_zone_distro_tools",
+        "time_zone_distro_builder",
         "time_zone_distro_installer",
         "tzdata-testing",
         "junit",
diff --git a/distro/installer/src/main/com/android/timezone/distro/installer/TimeZoneDistroInstaller.java b/distro/installer/src/main/com/android/timezone/distro/installer/TimeZoneDistroInstaller.java
index 68c9715..6c33bd7 100644
--- a/distro/installer/src/main/com/android/timezone/distro/installer/TimeZoneDistroInstaller.java
+++ b/distro/installer/src/main/com/android/timezone/distro/installer/TimeZoneDistroInstaller.java
@@ -29,8 +29,10 @@
 import java.io.IOException;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
-import libcore.util.TimeZoneFinder;
-import libcore.util.ZoneInfoDB;
+import libcore.timezone.TzDataSetVersion;
+import libcore.timezone.TzDataSetVersion.TzDataSetException;
+import libcore.timezone.TimeZoneFinder;
+import libcore.timezone.ZoneInfoDB;
 
 /**
  * A distro-validation / extraction class. Separate from the services code that uses it for easier
@@ -110,15 +112,15 @@
     public static final String UNINSTALL_TOMBSTONE_FILE_NAME = "STAGED_UNINSTALL_TOMBSTONE";
 
     private final String logTag;
-    private final File systemTzDataFile;
+    private final File baseVersionFile;
     private final File oldStagedDataDir;
     private final File stagedTzDataDir;
     private final File currentTzDataDir;
     private final File workingDir;
 
-    public TimeZoneDistroInstaller(String logTag, File systemTzDataFile, File installDir) {
+    public TimeZoneDistroInstaller(String logTag, File baseVersionFile, File installDir) {
         this.logTag = logTag;
-        this.systemTzDataFile = systemTzDataFile;
+        this.baseVersionFile = baseVersionFile;
         oldStagedDataDir = new File(installDir, OLD_TZ_DATA_DIR_NAME);
         stagedTzDataDir = new File(installDir, STAGED_TZ_DATA_DIR_NAME);
         currentTzDataDir = new File(installDir, CURRENT_TZ_DATA_DIR_NAME);
@@ -175,7 +177,19 @@
                 Slog.i(logTag, "Update not applied: Distro version could not be loaded");
                 return INSTALL_FAIL_BAD_DISTRO_STRUCTURE;
             }
-            if (!DistroVersion.isCompatibleWithThisDevice(distroVersion)) {
+
+            // The TzDataSetVersion class replaces the DistroVersion class after P. Convert to the
+            // new class so we can use the isCompatibleWithThisDevice() method.
+            TzDataSetVersion distroTzDataSetVersion;
+            try {
+                distroTzDataSetVersion = new TzDataSetVersion(
+                        distroVersion.formatMajorVersion, distroVersion.formatMinorVersion,
+                        distroVersion.rulesVersion, distroVersion.revision);
+            } catch (TzDataSetException e) {
+                Slog.i(logTag, "Update not applied: Distro version could not be converted", e);
+                return INSTALL_FAIL_BAD_DISTRO_STRUCTURE;
+            }
+            if (!TzDataSetVersion.isCompatibleWithThisDevice(distroTzDataSetVersion)) {
                 Slog.i(logTag, "Update not applied: Distro format version check failed: "
                         + distroVersion);
                 return INSTALL_FAIL_BAD_DISTRO_FORMAT_VERSION;
@@ -186,7 +200,7 @@
                 return INSTALL_FAIL_BAD_DISTRO_STRUCTURE;
             }
 
-            if (!checkDistroRulesNewerThanSystem(systemTzDataFile, distroVersion)) {
+            if (!checkDistroRulesNewerThanBase(baseVersionFile, distroVersion)) {
                 Slog.i(logTag, "Update not applied: Distro rules version check failed");
                 return INSTALL_FAIL_RULES_TOO_OLD;
             }
@@ -251,7 +265,7 @@
 
     /**
      * Stage an uninstall of the current timezone update in /data which, on reboot, will return the
-     * device to using data from /system. If there was something else already staged it will be
+     * device to using the base data. If there was something else already staged it will be
      * removed by this call.
      *
      * Returns {@link #UNINSTALL_SUCCESS} if staging the uninstallation was
@@ -339,13 +353,26 @@
     }
 
     /**
-     * Reads the timezone rules version present in /system. i.e. the version that would be present
-     * after a factory reset.
+     * Reads the base time zone rules version. i.e. the version that would be present after an
+     * installed update is removed.
      *
      * @throws IOException if there was a problem reading data
      */
-    public String getSystemRulesVersion() throws IOException {
-        return readSystemRulesVersion(systemTzDataFile);
+    public TzDataSetVersion readBaseVersion() throws IOException {
+        return readBaseVersion(baseVersionFile);
+    }
+
+    private TzDataSetVersion readBaseVersion(File baseVersionFile) throws IOException {
+        if (!baseVersionFile.exists()) {
+            Slog.i(logTag, "version file cannot be found in " + baseVersionFile);
+            throw new FileNotFoundException(
+                    "base version file does not exist: " + baseVersionFile);
+        }
+        try {
+            return TzDataSetVersion.readFromFile(baseVersionFile);
+        } catch (TzDataSetException e) {
+            throw new IOException("Unable to read: " + baseVersionFile, e);
+        }
     }
 
     private void deleteBestEffort(File dir) {
@@ -384,34 +411,27 @@
     }
 
     /**
-     * Returns true if the the distro IANA rules version is >= system IANA rules version.
+     * Returns true if the the distro IANA rules version is >= base IANA rules version.
      */
-    private boolean checkDistroRulesNewerThanSystem(
-            File systemTzDataFile, DistroVersion distroVersion) throws IOException {
+    private boolean checkDistroRulesNewerThanBase(
+            File baseVersionFile, DistroVersion distroVersion) throws IOException {
 
-        // We only check the /system tzdata file and assume that other data like ICU is in sync.
-        // There is a CTS test that checks ICU and bionic/libcore are in sync.
-        Slog.i(logTag, "Reading /system rules version");
-        String systemRulesVersion = readSystemRulesVersion(systemTzDataFile);
+        // We only check the base tz_version file and assume that data like ICU is in sync.
+        // There is a CTS test that checks tz_version, ICU and bionic/libcore are in sync.
+        Slog.i(logTag, "Reading base time zone rules version");
+        TzDataSetVersion baseVersion = readBaseVersion(baseVersionFile);
 
+        String baseRulesVersion = baseVersion.rulesVersion;
         String distroRulesVersion = distroVersion.rulesVersion;
-        // canApply = distroRulesVersion >= systemRulesVersion
-        boolean canApply = distroRulesVersion.compareTo(systemRulesVersion) >= 0;
+        // canApply = distroRulesVersion >= baseRulesVersion
+        boolean canApply = distroRulesVersion.compareTo(baseRulesVersion) >= 0;
         if (!canApply) {
             Slog.i(logTag, "Failed rules version check: distroRulesVersion="
-                    + distroRulesVersion + ", systemRulesVersion=" + systemRulesVersion);
+                    + distroRulesVersion + ", baseRulesVersion=" + baseRulesVersion);
         } else {
             Slog.i(logTag, "Passed rules version check: distroRulesVersion="
-                    + distroRulesVersion + ", systemRulesVersion=" + systemRulesVersion);
+                    + distroRulesVersion + ", baseRulesVersion=" + baseRulesVersion);
         }
         return canApply;
     }
-
-    private String readSystemRulesVersion(File systemTzDataFile) throws IOException {
-        if (!systemTzDataFile.exists()) {
-            Slog.i(logTag, "tzdata file cannot be found in /system");
-            throw new FileNotFoundException("system tzdata does not exist: " + systemTzDataFile);
-        }
-        return ZoneInfoDB.TzData.getRulesVersion(systemTzDataFile);
-    }
 }
diff --git a/distro/installer/src/test/com/android/timezone/distro/installer/TimeZoneDistroInstallerTest.java b/distro/installer/src/test/com/android/timezone/distro/installer/TimeZoneDistroInstallerTest.java
index ab8f512..50bea96 100644
--- a/distro/installer/src/test/com/android/timezone/distro/installer/TimeZoneDistroInstallerTest.java
+++ b/distro/installer/src/test/com/android/timezone/distro/installer/TimeZoneDistroInstallerTest.java
@@ -19,7 +19,7 @@
 import com.android.timezone.distro.FileUtils;
 import com.android.timezone.distro.StagedDistroOperation;
 import com.android.timezone.distro.TimeZoneDistro;
-import com.android.timezone.distro.tools.TimeZoneDistroBuilder;
+import com.android.timezone.distro.builder.TimeZoneDistroBuilder;
 
 import junit.framework.TestCase;
 
@@ -38,7 +38,8 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
 import libcore.io.IoUtils;
-import libcore.tzdata.testing.ZoneInfoTestHelper;
+import libcore.timezone.TzDataSetVersion;
+import libcore.timezone.testing.ZoneInfoTestHelper;
 
 import static org.junit.Assert.assertArrayEquals;
 
@@ -47,31 +48,36 @@
  */
 public class TimeZoneDistroInstallerTest extends TestCase {
 
-    // OLDER_RULES_VERSION < SYSTEM_RULES_VERSION < NEW_RULES_VERSION < NEWER_RULES_VERSION
+    // OLDER_RULES_VERSION < BASE_RULES_VERSION < NEW_RULES_VERSION < NEWER_RULES_VERSION
     private static final String OLDER_RULES_VERSION = "2030a";
-    private static final String SYSTEM_RULES_VERSION = "2030b";
+    private static final String BASE_RULES_VERSION = "2030b";
     private static final String NEW_RULES_VERSION = "2030c";
     private static final String NEWER_RULES_VERSION = "2030d";
 
     private TimeZoneDistroInstaller installer;
     private File tempDir;
     private File testInstallDir;
-    private File testSystemTzDataDir;
+    private File testBaseDataDir;
 
     @Override
     public void setUp() throws Exception {
         super.setUp();
         tempDir = createUniqueDirectory(null, "tempDir");
         testInstallDir = createSubDirectory(tempDir, "testInstall");
-        testSystemTzDataDir =  createSubDirectory(tempDir, "testSystemTzData");
+        testBaseDataDir =  createSubDirectory(tempDir, "testBaseData");
 
-        // Create a file to represent the tzdata file in the /system partition of the device.
-        File testSystemTzDataFile = new File(testSystemTzDataDir, "tzdata");
-        byte[] systemTzDataBytes = createTzData(SYSTEM_RULES_VERSION);
-        createFile(testSystemTzDataFile, systemTzDataBytes);
+        // Create a tz_version file to indicate the base version of tz data on a device.
+        TzDataSetVersion tzDataSetVersion =
+                new TzDataSetVersion(
+                        TzDataSetVersion.currentFormatMajorVersion(),
+                        TzDataSetVersion.currentFormatMinorVersion(),
+                        BASE_RULES_VERSION,
+                        1 /* revision */);
+        File testBaseVersionFile = new File(testBaseDataDir, TzDataSetVersion.DEFAULT_FILE_NAME);
+        createFile(testBaseVersionFile, tzDataSetVersion.toBytes());
 
         installer = new TimeZoneDistroInstaller(
-                "TimeZoneDistroInstallerTest", testSystemTzDataFile, testInstallDir);
+                "TimeZoneDistroInstallerTest", testBaseVersionFile, testInstallDir);
     }
 
     /**
@@ -99,15 +105,15 @@
         super.tearDown();
     }
 
-    /** Tests the an update on a device will fail if the /system tzdata file cannot be found. */
-    public void testStageInstallWithErrorCode_badSystemFile() throws Exception {
-        File doesNotExist = new File(testSystemTzDataDir, "doesNotExist");
-        TimeZoneDistroInstaller brokenSystemInstaller = new TimeZoneDistroInstaller(
+    /** Tests the an update on a device will fail if the base tz_version file cannot be found. */
+    public void testStageInstallWithErrorCode_badBaseFile() throws Exception {
+        File doesNotExist = new File(testBaseDataDir, "doesNotExist");
+        TimeZoneDistroInstaller brokenBaseInstaller = new TimeZoneDistroInstaller(
                 "TimeZoneDistroInstallerTest", doesNotExist, testInstallDir);
         byte[] distroBytes = createValidTimeZoneDistroBytes(NEW_RULES_VERSION, 1);
 
         try {
-            brokenSystemInstaller.stageInstallWithErrorCode(new TimeZoneDistro(distroBytes));
+            brokenBaseInstaller.stageInstallWithErrorCode(new TimeZoneDistro(distroBytes));
             fail();
         } catch (IOException expected) {}
 
@@ -127,11 +133,11 @@
     }
 
     /**
-     * Tests we can install an update the same version as is in /system.
+     * Tests we can install an update with the same version as the base version.
      */
-    public void testStageInstallWithErrorCode_successfulFirstUpdate_sameVersionAsSystem()
+    public void testStageInstallWithErrorCode_successfulFirstUpdate_sameVersionAsBase()
             throws Exception {
-        byte[] distroBytes = createValidTimeZoneDistroBytes(SYSTEM_RULES_VERSION, 1);
+        byte[] distroBytes = createValidTimeZoneDistroBytes(BASE_RULES_VERSION, 1);
         assertEquals(
                 TimeZoneDistroInstaller.INSTALL_SUCCESS,
                 installer.stageInstallWithErrorCode(new TimeZoneDistro(distroBytes)));
@@ -140,9 +146,9 @@
     }
 
     /**
-     * Tests we cannot install an update older than the version in /system.
+     * Tests we cannot install an update older than the base version.
      */
-    public void testStageInstallWithErrorCode_unsuccessfulFirstUpdate_olderVersionThanSystem()
+    public void testStageInstallWithErrorCode_unsuccessfulFirstUpdate_olderVersionThanBase()
             throws Exception {
         byte[] distroBytes = createValidTimeZoneDistroBytes(OLDER_RULES_VERSION, 1);
         assertEquals(
@@ -179,7 +185,7 @@
 
     /**
      * Tests an update on a device when there is a prior update already applied, but the follow
-     * on update is older than in /system.
+     * on update is older than the base version.
      */
     public void testStageInstallWithErrorCode_unsuccessfulFollowOnUpdate_olderVersion()
             throws Exception {
@@ -333,8 +339,8 @@
         // Create a distro that will appear to be newer than the one currently supported.
         byte[] distroBytes = createValidTimeZoneDistroBuilder(NEW_RULES_VERSION, 1)
                 .replaceFormatVersionForTests(
-                        DistroVersion.CURRENT_FORMAT_MAJOR_VERSION + 1,
-                        DistroVersion.CURRENT_FORMAT_MINOR_VERSION)
+                        TzDataSetVersion.currentFormatMajorVersion() + 1,
+                        TzDataSetVersion.currentFormatMinorVersion())
                 .buildUnvalidatedBytes();
         assertEquals(
                 TimeZoneDistroInstaller.INSTALL_FAIL_BAD_DISTRO_FORMAT_VERSION,
@@ -493,8 +499,9 @@
         assertInstalledDistro(installedDistroBytes);
     }
 
-    public void testGetSystemRulesVersion() throws Exception {
-        assertEquals(SYSTEM_RULES_VERSION, installer.getSystemRulesVersion());
+    public void testReadBaseRulesVersion() throws Exception {
+        TzDataSetVersion actualBaseVersion = installer.readBaseVersion();
+        assertEquals(BASE_RULES_VERSION, actualBaseVersion.rulesVersion);
     }
 
     public void testGetInstalledDistroVersion() throws Exception {
@@ -597,8 +604,8 @@
                 + "  </countryzones>\n"
                 + "</timezones>\n";
         DistroVersion distroVersion = new DistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION,
+                TzDataSetVersion.currentFormatMajorVersion(),
+                TzDataSetVersion.currentFormatMinorVersion(),
                 rulesVersion,
                 revision);
         return new TimeZoneDistroBuilder()
diff --git a/distro/tools/Android.bp b/distro/tools/Android.bp
index 8d9d9b1..0495983 100644
--- a/distro/tools/Android.bp
+++ b/distro/tools/Android.bp
@@ -12,15 +12,24 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// Library of tools classes for creating / interpreting time zone distros.
-// Used when generating distros and in host-side tests.
-java_library_static {
-    name: "time_zone_distro_tools",
-    host_supported: true,
+// The tool used to create time zone distro.zip files.
+java_library_host {
+    name: "create_time_zone_distro",
 
     srcs: ["src/main/**/*.java"],
     libs: [
         "time_zone_distro",
     ],
+}
+
+// Code that can build a time zone distro.zip. Used in tests.
+java_library {
+    name: "time_zone_distro_builder",
+    host_supported: true,
+
+    srcs: ["src/main/**/builder/*.java"],
+    libs: [
+        "time_zone_distro",
+    ],
     no_framework_libs: true,
 }
diff --git a/distro/tools/create-distro.py b/distro/tools/create-distro.py
index 90899fe..fa15004 100755
--- a/distro/tools/create-distro.py
+++ b/distro/tools/create-distro.py
@@ -16,6 +16,8 @@
 
 """Generates a time zone distro file"""
 
+from __future__ import print_function
+
 import argparse
 import os
 import shutil
@@ -31,12 +33,12 @@
 timezone_dir = os.path.realpath('%s/system/timezone' % android_build_top)
 i18nutil.CheckDirExists(timezone_dir, 'system/timezone')
 
-def RunCreateTimeZoneDistro(properties_file, distro_output_dir):
+def RunCreateTimeZoneDistro(properties_file):
   # Build the libraries needed.
-  subprocess.check_call(['make', '-C', android_build_top, 'time_zone_distro_tools',
+  subprocess.check_call(['make', '-C', android_build_top, 'create_time_zone_distro',
       'time_zone_distro'])
 
-  libs = [ 'time_zone_distro_tools', 'time_zone_distro' ]
+  libs = [ 'create_time_zone_distro', 'time_zone_distro' ]
   host_java_libs_dir = '%s/../common/obj/JAVA_LIBRARIES' % android_host_out_dir
   classpath_components = []
   for lib in libs:
@@ -46,11 +48,12 @@
 
   # Run the CreateTimeZoneDistro tool
   subprocess.check_call(['java', '-cp', classpath,
-      'com.android.timezone.distro.tools.CreateTimeZoneDistro', properties_file,
-      distro_output_dir])
+      'com.android.timezone.distro.tools.CreateTimeZoneDistro', properties_file])
 
 
-def CreateTimeZoneDistro(iana_version, revision, tzdata_file, icu_file, tzlookup_file, output_dir):
+def CreateTimeZoneDistro(
+    iana_version, revision, tzdata_file, icu_file, tzlookup_file, output_distro_dir,
+    output_version_file):
   original_cwd = os.getcwd()
 
   i18nutil.SwitchToNewTemporaryDirectory()
@@ -64,8 +67,10 @@
     properties.write('tzdata.file=%s\n' % tzdata_file)
     properties.write('icu.file=%s\n' % icu_file)
     properties.write('tzlookup.file=%s\n' % tzlookup_file)
+    properties.write('output.distro.dir=%s\n' % output_distro_dir)
+    properties.write('output.version.file=%s\n' % output_version_file)
 
-  RunCreateTimeZoneDistro(properties_file, output_dir)
+  RunCreateTimeZoneDistro(properties_file)
 
   os.chdir(original_cwd)
 
@@ -81,7 +86,10 @@
       help='The location of the ICU overlay .dat file to include')
   parser.add_argument('-tzlookup', required=True,
       help='The location of the tzlookup.xml file to include')
-  parser.add_argument('-output', required=True, help='The output directory')
+  parser.add_argument('-output_distro_dir', required=True,
+      help='The output directory for the distro.zip')
+  parser.add_argument('-output_version_file', required=True,
+      help='The output path for the version file')
   args = parser.parse_args()
 
   iana_version = args.iana_version
@@ -89,7 +97,8 @@
   tzdata_file = os.path.abspath(args.tzdata)
   icu_file = os.path.abspath(args.icu)
   tzlookup_file = os.path.abspath(args.tzlookup)
-  output_dir = os.path.abspath(args.output)
+  output_distro_dir = os.path.abspath(args.output_distro_dir)
+  output_version_file = os.path.abspath(args.output_version_file)
 
   CreateTimeZoneDistro(
       iana_version=iana_version,
@@ -97,9 +106,11 @@
       tzdata_file=tzdata_file,
       icu_file=icu_file,
       tzlookup_file=tzlookup_file,
-      output_dir=output_dir)
+      output_distro_dir=output_distro_dir,
+      output_version_file=output_version_file)
 
-  print 'Distro files created in %s' % output_dir
+  print('Distro file created in %s' % output_distro_dir)
+  print('Version file created as %s' % output_version_file)
   sys.exit(0)
 
 
diff --git a/distro/tools/src/main/com/android/timezone/distro/tools/TimeZoneDistroBuilder.java b/distro/tools/src/main/com/android/timezone/distro/builder/TimeZoneDistroBuilder.java
similarity index 99%
rename from distro/tools/src/main/com/android/timezone/distro/tools/TimeZoneDistroBuilder.java
rename to distro/tools/src/main/com/android/timezone/distro/builder/TimeZoneDistroBuilder.java
index ed21aeb..4540608 100644
--- a/distro/tools/src/main/com/android/timezone/distro/tools/TimeZoneDistroBuilder.java
+++ b/distro/tools/src/main/com/android/timezone/distro/builder/TimeZoneDistroBuilder.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.timezone.distro.tools;
+package com.android.timezone.distro.builder;
 
 import com.android.timezone.distro.DistroException;
 import com.android.timezone.distro.DistroVersion;
diff --git a/distro/tools/src/main/com/android/timezone/distro/tools/CreateTimeZoneDistro.java b/distro/tools/src/main/com/android/timezone/distro/tools/CreateTimeZoneDistro.java
index b53b43e..06698ea 100644
--- a/distro/tools/src/main/com/android/timezone/distro/tools/CreateTimeZoneDistro.java
+++ b/distro/tools/src/main/com/android/timezone/distro/tools/CreateTimeZoneDistro.java
@@ -15,8 +15,11 @@
  */
 package com.android.timezone.distro.tools;
 
+import libcore.timezone.TzDataSetVersion;
+
 import com.android.timezone.distro.DistroVersion;
 import com.android.timezone.distro.TimeZoneDistro;
+import com.android.timezone.distro.builder.TimeZoneDistroBuilder;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -28,14 +31,13 @@
 import java.util.Properties;
 
 /**
- * A command-line tool for creating a time zone update distro file.
+ * A command-line tool for creating a time zone update distro and associated
+ * files.
  *
  * <p>Args:
  * <dl>
  *     <dt>input properties file</dt>
- *     <dd>the file describing the distro</dd>
- *     <dt>output dir</dt>
- *     <dd>the directory to generate files into</dd>
+ *     <dd>the file describing the distro and output dirs</dd>
  * </dl>
  *
  * <p>The input properties file must have the entries:
@@ -50,12 +52,17 @@
  *     <dd>The location of the ICU overlay .dat file.</dd>
  *     <dt>tzlookup.file</dt>
  *     <dd>The location of the tzlookup.xml file.</dd>
+ *     <dt>output.distro.dir</dt>
+ *     <dd>The directory to write the distro.zip file to.</dd>
+ *     <dt>output.version.file</dt>
+ *     <dd>The location to write the version file to.</dd>
  * </dl>
  *
  * <p>The output consists of:
  * <ul>
  *     <li>A distro .zip containing the input files. See
  *     {@link com.android.timezone.distro.TimeZoneDistro}</li>
+ *     <li>A version file (same as contained in the distro .zip).</li>
  * </ul>
  */
 public class CreateTimeZoneDistro {
@@ -63,7 +70,7 @@
     private CreateTimeZoneDistro() {}
 
     public static void main(String[] args) throws Exception {
-        if (args.length != 2) {
+        if (args.length != 1) {
             printUsage();
             System.exit(1);
         }
@@ -73,25 +80,42 @@
             printUsage();
             System.exit(2);
         }
-        Properties inputProperties = loadProperties(f);
-        String ianaRulesVersion = getMandatoryProperty(inputProperties, "rules.version");
-        int revision = Integer.parseInt(getMandatoryProperty(inputProperties, "revision"));
-        DistroVersion distroVersion = new DistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION,
+        Properties properties = loadProperties(f);
+        String ianaRulesVersion = getMandatoryProperty(properties, "rules.version");
+        int revision = Integer.parseInt(getMandatoryProperty(properties, "revision"));
+
+        // Create an object to hold version metadata for the tz data.
+        TzDataSetVersion tzDataSetVersion = new TzDataSetVersion(
+                TzDataSetVersion.currentFormatMajorVersion(),
+                TzDataSetVersion.currentFormatMinorVersion(),
                 ianaRulesVersion,
                 revision);
+        byte[] tzDataSetVersionBytes = tzDataSetVersion.toBytes();
+
+        // Create a DistroVersion from the TzDataSetVersion.
+        DistroVersion distroVersion = new DistroVersion(
+                tzDataSetVersion.formatMajorVersion,
+                tzDataSetVersion.formatMinorVersion,
+                tzDataSetVersion.rulesVersion,
+                tzDataSetVersion.revision);
         TimeZoneDistroBuilder builder = new TimeZoneDistroBuilder()
                 .setDistroVersion(distroVersion)
-                .setTzDataFile(getMandatoryPropertyFile(inputProperties, "tzdata.file"))
-                .setIcuDataFile(getMandatoryPropertyFile(inputProperties, "icu.file"))
-                .setTzLookupFile(getMandatoryPropertyFile(inputProperties, "tzlookup.file"));
-
+                .setTzDataFile(getMandatoryPropertyFile(properties, "tzdata.file"))
+                .setIcuDataFile(getMandatoryPropertyFile(properties, "icu.file"))
+                .setTzLookupFile(getMandatoryPropertyFile(properties, "tzlookup.file"));
         byte[] distroBytes = builder.buildBytes();
 
+        File outputDistroDir = getMandatoryPropertyFile(properties, "output.distro.dir");
+        File outputVersionFile = new File(getMandatoryProperty(properties, "output.version.file"));
+
+        // Write the tz data set version file.
+        try (OutputStream os = new FileOutputStream(outputVersionFile)) {
+            os.write(tzDataSetVersionBytes);
+        }
+        System.out.println("Wrote " + outputVersionFile);
+
         // Write the distro file.
-        File outputDir = new File(args[1]);
-        File outputDistroFile = new File(outputDir, TimeZoneDistro.FILE_NAME);
+        File outputDistroFile = new File(outputDistroDir, TimeZoneDistro.FILE_NAME);
         try (OutputStream os = new FileOutputStream(outputDistroFile)) {
             os.write(distroBytes);
         }
@@ -131,6 +155,6 @@
     private static void printUsage() {
         System.out.println("Usage:");
         System.out.println("\t" + CreateTimeZoneDistro.class.getName() +
-                " <tzupdate.properties file> <output dir>");
+                " <tzupdate.properties file>");
     }
 }
diff --git a/distro/tools/tzupdate.properties b/distro/tools/tzupdate.properties
index 0770bd5..2bc30c3 100644
--- a/distro/tools/tzupdate.properties
+++ b/distro/tools/tzupdate.properties
@@ -6,6 +6,11 @@
 # This is used to indicate when Android has issued a revision. e.g. "1", "2".
 revision=1
 
+# Input files
 tzdata.file=
 icu.file=
 tzlookup.file=
+
+# Output locations
+output.distro.dir=
+output.version.file=
diff --git a/download-iana-data.py b/download-iana-data.py
deleted file mode 100755
index 6b9865b..0000000
--- a/download-iana-data.py
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/python -B
-
-# Copyright 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Downloads the latest IANA timezone data."""
-
-import ftplib
-import os
-import shutil
-import subprocess
-import sys
-
-sys.path.append('%s/external/icu/tools' % os.environ.get('ANDROID_BUILD_TOP'))
-import i18nutil
-import tzdatautil
-
-# Calculate the paths that are referred to by multiple functions.
-android_build_top = i18nutil.GetAndroidRootOrDie()
-iana_data_dir = os.path.realpath('%s/system/timezone/input_data/iana' % android_build_top)
-
-def FtpRetrieveFile(ftp, filename):
-  ftp.retrbinary('RETR %s' % filename, open(filename, 'wb').write)
-
-def CheckSignature(data_filename, signature_filename):
-  """Checks the signature of a file."""
-  print 'Verifying signature...'
-  try:
-    subprocess.check_call(['gpg', '--trusted-key=ED97E90E62AA7E34', '--verify',
-                          signature_filename, data_filename])
-  except subprocess.CalledProcessError as err:
-    print 'Unable to verify signature'
-    print '\n\n******'
-    print 'If this fails for you, you probably need to import Paul Eggert''s public key:'
-    print '  gpg --receive-keys ED97E90E62AA7E34'
-    print '******\n\n'
-    raise
-
-# Run with no arguments from any directory, with no special setup required.
-# See http://www.iana.org/time-zones/ for more about the source of this data.
-def main():
-  print 'Looking for new IANA tzdata...'
-
-  iana_tar_filenames = []
-
-  ftp = ftplib.FTP('ftp.iana.org')
-  ftp.login()
-  ftp.cwd('tz/releases')
-  for filename in ftp.nlst():
-    if "/" in filename:
-      print "FTP server returned bogus file name"
-      sys.exit(1)
-
-    if filename.startswith('tzdata20') and filename.endswith('.tar.gz'):
-      iana_tar_filenames.append(filename)
-  iana_tar_filenames.sort(reverse=True)
-
-  if len(iana_tar_filenames) == 0:
-    print 'No tzdata files found'
-    sys.exit(1)
-
-  latest_iana_tar_filename = iana_tar_filenames[0]
-
-  local_iana_tar_file = tzdatautil.GetIanaTarFile(iana_data_dir, 'data')
-
-  if local_iana_tar_file:
-    local_iana_tar_filename = os.path.basename(local_iana_tar_file)
-    if latest_iana_tar_filename <= local_iana_tar_filename:
-      print 'Available data %s is older or the same as current data %s' % (latest_iana_tar_filename, local_iana_tar_filename)
-      sys.exit(0)
-
-  print 'Found new tzdata: %s' % latest_iana_tar_filename
-  i18nutil.SwitchToNewTemporaryDirectory()
-
-  print 'Downloading data (%s)...' % latest_iana_tar_filename
-  FtpRetrieveFile(ftp, latest_iana_tar_filename)
-
-  signature_filename = '%s.asc' % latest_iana_tar_filename
-  print 'Downloading signature (%s)...' % signature_filename
-  FtpRetrieveFile(ftp, signature_filename)
-
-  CheckSignature(latest_iana_tar_filename, signature_filename)
-
-  new_local_iana_tar_file = '%s/%s' % (iana_data_dir, latest_iana_tar_filename)
-  shutil.copyfile(latest_iana_tar_filename, new_local_iana_tar_file)
-  new_local_signature_file = '%s/%s' % (iana_data_dir, signature_filename)
-  shutil.copyfile(signature_filename, new_local_signature_file)
-
-  # Delete the existing local IANA tar file, if there is one.
-  if local_iana_tar_file:
-    os.remove(local_iana_tar_file)
-
-  local_signature_file = '%s.asc' % local_iana_tar_file
-  if os.path.exists(local_signature_file):
-    os.remove(local_signature_file)
-
-  print 'Look in %s for new IANA data files' % new_local_iana_tar_file
-  sys.exit(0)
-
-
-if __name__ == '__main__':
-  main()
diff --git a/download-iana-files.py b/download-iana-files.py
new file mode 100755
index 0000000..a09a356
--- /dev/null
+++ b/download-iana-files.py
@@ -0,0 +1,156 @@
+#!/usr/bin/python -B
+
+# Copyright 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Downloads the latest IANA time zone files."""
+
+import argparse
+import ftplib
+import os
+import shutil
+import subprocess
+import sys
+
+sys.path.append('%s/external/icu/tools' % os.environ.get('ANDROID_BUILD_TOP'))
+import i18nutil
+import tzdatautil
+
+# Calculate the paths that are referred to by multiple functions.
+android_build_top = i18nutil.GetAndroidRootOrDie()
+iana_data_dir = os.path.realpath('%s/system/timezone/input_data/iana' % android_build_top)
+iana_tools_dir = os.path.realpath('%s/system/timezone/input_tools/iana' % android_build_top)
+
+def FtpRetrieveFile(ftp, filename):
+  ftp.retrbinary('RETR %s' % filename, open(filename, 'wb').write)
+
+
+def CheckSignature(data_filename, signature_filename):
+  """Checks the signature of a file."""
+  print 'Verifying signature of %s using %s...' % (data_filename, signature_filename)
+  try:
+    subprocess.check_call(['gpg', '--trusted-key=ED97E90E62AA7E34', '--verify',
+                          signature_filename, data_filename])
+  except subprocess.CalledProcessError as err:
+    print 'Unable to verify signature'
+    print '\n\n******'
+    print 'If this fails for you, you probably need to import Paul Eggert''s public key:'
+    print '  gpg --receive-keys ED97E90E62AA7E34'
+    print '******\n\n'
+    raise
+
+
+def FindLatestRemoteTar(ftp, file_prefix):
+  iana_tar_filenames = []
+
+  for filename in ftp.nlst():
+    if "/" in filename:
+      print "FTP server returned bogus file name"
+      sys.exit(1)
+
+    if filename.startswith(file_prefix) and filename.endswith('.tar.gz'):
+      iana_tar_filenames.append(filename)
+
+  iana_tar_filenames.sort(reverse=True)
+
+  if len(iana_tar_filenames) == 0:
+    print 'No files found'
+    sys.exit(1)
+
+  return iana_tar_filenames[0]
+
+
+def DownloadAndReplaceLocalFiles(file_prefixes, ftp, local_dir):
+  output_files = []
+
+  for file_prefix in file_prefixes:
+    latest_iana_tar_filename = FindLatestRemoteTar(ftp, file_prefix)
+    local_iana_tar_file = tzdatautil.GetIanaTarFile(local_dir, file_prefix)
+    if local_iana_tar_file:
+      local_iana_tar_filename = os.path.basename(local_iana_tar_file)
+      if latest_iana_tar_filename <= local_iana_tar_filename:
+        print('Latest remote file for %s is called %s and is older or the same as'
+              ' current local file %s'
+              % (local_dir, latest_iana_tar_filename, local_iana_tar_filename))
+        continue
+
+    print 'Found new %s* file for %s: %s' % (file_prefix, local_dir, latest_iana_tar_filename)
+    i18nutil.SwitchToNewTemporaryDirectory()
+
+    print 'Downloading file %s...' % latest_iana_tar_filename
+    FtpRetrieveFile(ftp, latest_iana_tar_filename)
+
+    signature_filename = '%s.asc' % latest_iana_tar_filename
+    print 'Downloading signature %s...' % signature_filename
+    FtpRetrieveFile(ftp, signature_filename)
+
+    CheckSignature(latest_iana_tar_filename, signature_filename)
+
+    new_local_iana_tar_file = '%s/%s' % (local_dir, latest_iana_tar_filename)
+    shutil.copyfile(latest_iana_tar_filename, new_local_iana_tar_file)
+    new_local_signature_file = '%s/%s' % (local_dir, signature_filename)
+    shutil.copyfile(signature_filename, new_local_signature_file)
+
+    output_files.append(new_local_iana_tar_file)
+    output_files.append(new_local_signature_file)
+
+    # Delete the existing local IANA tar file, if there is one.
+    if local_iana_tar_file:
+      os.remove(local_iana_tar_file)
+
+    local_signature_file = '%s.asc' % local_iana_tar_file
+    if os.path.exists(local_signature_file):
+      os.remove(local_signature_file)
+
+  return output_files
+
+# Run from any directory after having run source/envsetup.sh / lunch
+# See http://www.iana.org/time-zones/ for more about the source of this data.
+def main():
+  parser = argparse.ArgumentParser(description=('Update IANA files from upstream'))
+  parser.add_argument('--tools', help='Download tools files', action='store_true')
+  parser.add_argument('--data', help='Download data files', action='store_true')
+  args = parser.parse_args()
+  if not args.tools and not args.data:
+    parser.error("Nothing to do")
+    sys.exit(1)
+
+  print 'Looking for new IANA files...'
+
+  ftp = ftplib.FTP('ftp.iana.org')
+  ftp.login()
+  ftp.cwd('tz/releases')
+
+  output_files = []
+  if args.tools:
+    # The tools and data files are kept separate to make the updates independent.
+    # This means we duplicate the tzdata20xx file (once in the tools dir, once
+    # in the data dir) but the contents of the data tar appear to be needed for
+    # the zic build.
+    new_files = DownloadAndReplaceLocalFiles(['tzdata20', 'tzcode20'], ftp, iana_tools_dir)
+    output_files += new_files
+  if args.data:
+    new_files = DownloadAndReplaceLocalFiles(['tzdata20'], ftp, iana_data_dir)
+    output_files += new_files
+
+  if len(output_files) == 0:
+    print 'No files updated'
+  else:
+    print 'New files:'
+    for output_file in output_files:
+      print '  %s' % output_file
+
+
+if __name__ == '__main__':
+  main()
diff --git a/input_data/android/countryzones.txt b/input_data/android/countryzones.txt
index ca74897..d3d84bf 100644
--- a/input_data/android/countryzones.txt
+++ b/input_data/android/countryzones.txt
@@ -25,7 +25,7 @@
 # a time zone for an Android device.
 
 # ianaVersion: The version of the IANA rules this file matches.
-ianaVersion:"2018i"
+ianaVersion:"2019a"
 
 # countries:
 #
diff --git a/input_data/iana/tzdata2018i.tar.gz b/input_data/iana/tzdata2018i.tar.gz
deleted file mode 100644
index be28d0c..0000000
--- a/input_data/iana/tzdata2018i.tar.gz
+++ /dev/null
Binary files differ
diff --git a/input_data/iana/tzdata2018i.tar.gz.asc b/input_data/iana/tzdata2018i.tar.gz.asc
deleted file mode 100644
index 1fd503f..0000000
--- a/input_data/iana/tzdata2018i.tar.gz.asc
+++ /dev/null
@@ -1,16 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQIyBAABCgAdFiEEfjeSqdis99YzvBWI7ZfpDmKqfjQFAlwpGB8ACgkQ7ZfpDmKq
-fjTMog/3YJT5eFuwlijuTDxlt+VMTaAEaDaSUfzmQhaTDuHPKVDXxCaWq+tcO4J8
-gzzecRj40Xc/jZId7MREq2S3uyUu7D6tJR7kRMw8BeTYVkhf+wX4Xmfh+6bVB9bO
-34GNTSK9BXoieio68AkaCziVhBy6KynKhzUS4d1sqEDUxhS7r3ir6jTiU4UGAf54
-PKWh2YKYITuYww4XnseG9rQsKbVKK4GUm/e7OmV3zf5pI9lhf/TQh1XZXKFbKK70
-gDmFPUDAyuiFBCxkA7YsGolAnkscVmuF301brsNg+VKPy1qgMbxY/vF0lo/f7xRw
-dzi8+ek6/pKCIUmVRWCsg68wUDh1j3pAh9MLT8zhMtxOc42Kh+4b1BNq0x45zVbQ
-693ufcf056654Y27bCexy1JbGBNEd6UUGUv/Ou9EGrl6nfrfMSmUneqmBEnl8NY+
-6/cge/JOr+rVbmEku+nuC9kLZx63lSy4BXJ8+vv4DgzE6/3906V30+w/oJUGaImx
-PjE9tjm6biIWdRi6bZRdFcg0mktBEyzJuAuurX0ZRgcaNkrhNd4zw2Q3yuKDcD67
-aM5wUA4JVLX5v6P+s5j5Y+B+OY4sVk8fFzev8BJX+wRulqEmchVertypir17PUSr
-oqRUAww6oaYwenZNE+6dN0OWtpLDdBUv7+pesiYcaJRrXDCLAA==
-=ttI4
------END PGP SIGNATURE-----
diff --git a/input_data/iana/tzdata2019a.tar.gz b/input_data/iana/tzdata2019a.tar.gz
new file mode 100644
index 0000000..8d6c3f7
--- /dev/null
+++ b/input_data/iana/tzdata2019a.tar.gz
Binary files differ
diff --git a/input_data/iana/tzdata2019a.tar.gz.asc b/input_data/iana/tzdata2019a.tar.gz.asc
new file mode 100644
index 0000000..c163977
--- /dev/null
+++ b/input_data/iana/tzdata2019a.tar.gz.asc
@@ -0,0 +1,16 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQIzBAABCgAdFiEEfjeSqdis99YzvBWI7ZfpDmKqfjQFAlyZs50ACgkQ7ZfpDmKq
+fjTPrg/9HBD7RK0/e2NQc/IEg0BeZPOG/SsWOo78lQ23UVwqXdXqQz9LJXl9gTqM
+ENe8Ecknctk6fmfriAYnSydXx/MwWDbze5nmi4p7wzlogL/ctPILJvQbc/T62fDK
+NpGNwDlaUX/ht7cRG9VO+oun3Zc7efGHJB9UpZDDVZGtq6VT5+AZIryM12XvHfcR
+g0P+0pZfZu9LI4H0K/JUmNnRRXLoq6/5OsV6+hFlTzS7quVfUu+Vb+gsoUVejXld
+77hNvqdAaRBwVW69hjdUL2WJXymQtP/1ZoeOVHskti0HQBFRJsDc4Fhs3Pe5MUWd
+PXVanz/C0sHhHbTLfHs4wVQvNg4g4OP5nl9DyF+KG2SqfuqWOzfbEs5bc8dGqFCk
+HLdj7Nd4eQA8x/Xl6OSukE1yzUR8Xkb9GFgTmpHlP7uq/TH2URJdd/ZXhSgPv+u6
+bM9ghH9eirnVDPxWxsj0bwkZYHY6eJC8pgLPpXsxBY0ktJD/hqS1IMXOAyPRj9fO
+uRt7QLcsJW+wx6Q7ggsgTs7cxnq/Pk55S0lcp63mAu960+2XuBy8ffFJp4J2OwqS
+U6nBCtAZ6ZONKvsoQ4UpIcNfkYEiM3A4XNjn/rL2Jtb0cDA8e0j66/k1vcOc9p6u
+KQSXvSrhoqGTqhKy03XuQJ7LYhSgtD790sxFOXWS59cs/WcLO+M=
+=g5BY
+-----END PGP SIGNATURE-----
diff --git a/zone_compactor/Android.bp b/input_tools/android/Android.bp
similarity index 100%
rename from zone_compactor/Android.bp
rename to input_tools/android/Android.bp
diff --git a/zone_compactor/main/java/ZoneCompactor.java b/input_tools/android/main/java/ZoneCompactor.java
similarity index 100%
rename from zone_compactor/main/java/ZoneCompactor.java
rename to input_tools/android/main/java/ZoneCompactor.java
diff --git a/zone_compactor/main/manifest/MANIFEST.mf b/input_tools/android/main/manifest/MANIFEST.mf
similarity index 100%
rename from zone_compactor/main/manifest/MANIFEST.mf
rename to input_tools/android/main/manifest/MANIFEST.mf
diff --git a/input_tools/iana/tzcode2014b.tar.gz b/input_tools/iana/tzcode2014b.tar.gz
deleted file mode 100644
index 8e48396..0000000
--- a/input_tools/iana/tzcode2014b.tar.gz
+++ /dev/null
Binary files differ
diff --git a/input_tools/iana/tzcode2014b.tar.gz.asc b/input_tools/iana/tzcode2014b.tar.gz.asc
deleted file mode 100644
index 9cb7108..0000000
--- a/input_tools/iana/tzcode2014b.tar.gz.asc
+++ /dev/null
@@ -1,17 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.14 (GNU/Linux)
-
-iQIcBAABAgAGBQJTMQbFAAoJEO2X6Q5iqn40MmQP/jLFMoyIrHEHptt7gTxOiakP
-u+U2qhynw/tXQb44I+YgpYw54UPiZ7mGqQ9phGbmjcTsFT6vG9qO61LEMg9Y6nyr
-wu+qHYyKfqcLednTUFztR3x2aj4HWNVpMENXyoU+ZvVUw/Hd7J2uaNkw3n+zZYqY
-tZjMAkn7wPLVv2BGQPshkGQB7S5YEVdHcXyeey9mtS1TBCkPadldgSk6afsc7x89
-lTiQ5v89dNJPfOqjRbyIBbS6I26XTxOlEQzuHdzWz5p1m1SUqznosEKw5Mnat5qe
-LNo3HnmwJyXXXrJDsgYja3yH3Ie4Bhs+y1kjJfwrArnQaex9UWmetHEKuJrz5VY1
-HZadsNfVoBb4QYyZQiLxr/iqs/ZiTocX6xAdZpHdI5WSoUABfKLTgU67z1UFFVgd
-qEi335xK3/l6rFAOjwEzqEriugthSWU1SlqGCUAmP6c87gBgFFC+mMW/T1FnmZtn
-v/ST9L2xmeyS8a1693fnak1fATlTaF2j/JbrhqbhOFTim/k+u6LgXBpSZyuzs80/
-gnLjGN5gAD7OhAMkjU1Ty5T3F1cGGev3kGgWX093JXugj4DszwUzzgG/NZniFkQc
-t+7B56jbxMTdFs+RB0YWfJ34QUbusAkWNprFyftPYMyF9PElKv6ngF+1XVFdq84Z
-jz7+k6FTz3hkU/Ru2s+4
-=+BVZ
------END PGP SIGNATURE-----
diff --git a/input_tools/iana/tzcode2019a.tar.gz b/input_tools/iana/tzcode2019a.tar.gz
new file mode 100644
index 0000000..b5caf8a
--- /dev/null
+++ b/input_tools/iana/tzcode2019a.tar.gz
Binary files differ
diff --git a/input_tools/iana/tzcode2019a.tar.gz.asc b/input_tools/iana/tzcode2019a.tar.gz.asc
new file mode 100644
index 0000000..619c705
--- /dev/null
+++ b/input_tools/iana/tzcode2019a.tar.gz.asc
@@ -0,0 +1,16 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQIzBAABCgAdFiEEfjeSqdis99YzvBWI7ZfpDmKqfjQFAlyZs50ACgkQ7ZfpDmKq
+fjRR5xAAqsWv2T1beL9TnJ2JaadySGOZiJg3M3RqW8Vm4Dd0ye8Dz8t+YtDtBX1/
+8+xGdlS7LWjwK2EQC6xWhp0EiqpiFjMU1FRGFeAlAOOv8SE0dPRfP9vIeKzCNXKp
+UwtSrzM5JUX6/iza9UUTlzpwHaEM/gVIfP+sLgT15RJiB84teHro/rpcfOvNRyj1
+bteknySCtbPcETe9VW3qH2YgMRtNQgkt/DcJgCvY2qWLsnicWRH9Ec6NhqYLFpuv
+QwvqC0Odaehrytu+DNhi1wuxt90YHgGHMgIZXtG+kO8eJy2aWFP9zQJ80wVvNqat
+Xgl6T5AU5ZIdBEQkMnk0EhqFlKYFX/81hEWT0gsMBCzteVFhhQQPPyptUwtL5U17
+MX1oVaZbiTbTCqjAjHAJbfW61Fbu9H0wzZhoRLvDqaFfOxQ1HEMh2Ioh+KlJ0nLw
++l5dLNed7D/kjRE0ja7Jj+ocCl4Hf1DTQknfqtk1USGctWLZ3WfKHk6jCS0vid7g
+IrN6POYhZ6kg4NLF1G2pD7tTiog37Kvd/c3FHC76cqbbA5wkye+L/A73xmy0qOlv
+tp14wxd99ETI5loWgMb5SgRzzeEjNbTrG5AuAOX0qK4Fz3cEdK9/PYYJDSOkueJJ
+0DpP9Eo3Kmhhk7E4PheygmX+Vk+Ntutu7jx8r6EFNck/erZrnJs=
+=kJqF
+-----END PGP SIGNATURE-----
diff --git a/input_tools/iana/tzdata2014b.tar.gz b/input_tools/iana/tzdata2014b.tar.gz
deleted file mode 100644
index 31fb9e8..0000000
--- a/input_tools/iana/tzdata2014b.tar.gz
+++ /dev/null
Binary files differ
diff --git a/input_tools/iana/tzdata2014b.tar.gz.asc b/input_tools/iana/tzdata2014b.tar.gz.asc
deleted file mode 100644
index c50a53a..0000000
--- a/input_tools/iana/tzdata2014b.tar.gz.asc
+++ /dev/null
@@ -1,17 +0,0 @@
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.14 (GNU/Linux)
-
-iQIcBAABAgAGBQJTMQbFAAoJEO2X6Q5iqn40o1gQAKrv5uiwH6nkf+vAG6u3P1e+
-RXdP+fC0IDOQoJFYf4i6gv1LPZ4A3uzwU9fZ8Fq4ETmCRr8UZmtRkrVTqNchfobV
-Kkkn3XlX5IlPqirBVL3/L3wVGybj7kfauhWozJuyvQuQCaF58TqNAqfV7joSZLZt
-8CwBYf1cnkuHkybLJjiur+s3nZ3nAhKa/6p1MbMJBMpeAWtAqdOWW3C/LIgvrX5n
-292hzn+0CILcsESxai6YOYpb3VwsVOilqdyBCos16Ra/qRwKUqhtUh+N+/0HdjUw
-E+wPh4n3mDVMSwiVi0yiZSMACU/mQmwI0W0lQAyGRtMjpK32R/VrwHUAZRAt/B8G
-0vOeGl5xXjuaPl46agkhBVhpUHX2ATLKmuJAwZ9jPUYkspqmT3ttzArXcfekFpeb
-xd6jlpQiqENeo8aZRSllTxE2zYJg5k6UvZ+NTMElh1AmRuUhh+kJq3SQnuEv2fqZ
-qEXuUZmdkMfLt3xF6OMDX1Uel/i6GFRfs+Lr7w6PV1HFVTiqZiOB5a1X3hn0dk8M
-cJQpwyhEfidZASQsKJADhMpUlon6i2O1jBJwyAWrMaCx38a2L6EX9jLPWyPRHze8
-v386Rk319AOWupf/G48pJt/LnYiFw1F1AtOct9cpUBDJFoopGuU8O9D3Z49Carsd
-CknX8ICVszv7uQpCvwO4
-=vlee
------END PGP SIGNATURE-----
diff --git a/input_tools/iana/tzdata2019a.tar.gz b/input_tools/iana/tzdata2019a.tar.gz
new file mode 100644
index 0000000..8d6c3f7
--- /dev/null
+++ b/input_tools/iana/tzdata2019a.tar.gz
Binary files differ
diff --git a/input_tools/iana/tzdata2019a.tar.gz.asc b/input_tools/iana/tzdata2019a.tar.gz.asc
new file mode 100644
index 0000000..c163977
--- /dev/null
+++ b/input_tools/iana/tzdata2019a.tar.gz.asc
@@ -0,0 +1,16 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQIzBAABCgAdFiEEfjeSqdis99YzvBWI7ZfpDmKqfjQFAlyZs50ACgkQ7ZfpDmKq
+fjTPrg/9HBD7RK0/e2NQc/IEg0BeZPOG/SsWOo78lQ23UVwqXdXqQz9LJXl9gTqM
+ENe8Ecknctk6fmfriAYnSydXx/MwWDbze5nmi4p7wzlogL/ctPILJvQbc/T62fDK
+NpGNwDlaUX/ht7cRG9VO+oun3Zc7efGHJB9UpZDDVZGtq6VT5+AZIryM12XvHfcR
+g0P+0pZfZu9LI4H0K/JUmNnRRXLoq6/5OsV6+hFlTzS7quVfUu+Vb+gsoUVejXld
+77hNvqdAaRBwVW69hjdUL2WJXymQtP/1ZoeOVHskti0HQBFRJsDc4Fhs3Pe5MUWd
+PXVanz/C0sHhHbTLfHs4wVQvNg4g4OP5nl9DyF+KG2SqfuqWOzfbEs5bc8dGqFCk
+HLdj7Nd4eQA8x/Xl6OSukE1yzUR8Xkb9GFgTmpHlP7uq/TH2URJdd/ZXhSgPv+u6
+bM9ghH9eirnVDPxWxsj0bwkZYHY6eJC8pgLPpXsxBY0ktJD/hqS1IMXOAyPRj9fO
+uRt7QLcsJW+wx6Q7ggsgTs7cxnq/Pk55S0lcp63mAu960+2XuBy8ffFJp4J2OwqS
+U6nBCtAZ6ZONKvsoQ4UpIcNfkYEiM3A4XNjn/rL2Jtb0cDA8e0j66/k1vcOc9p6u
+KQSXvSrhoqGTqhKy03XuQJ7LYhSgtD790sxFOXWS59cs/WcLO+M=
+=g5BY
+-----END PGP SIGNATURE-----
diff --git a/output_data/Android.bp b/output_data/Android.bp
new file mode 100644
index 0000000..b7fbda5
--- /dev/null
+++ b/output_data/Android.bp
@@ -0,0 +1,62 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+prebuilt_etc {
+    name: "apex_tz_version",
+    src: "version/tz_version",
+    filename: "tz_version",
+    sub_dir: "tz",
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "apex_tzlookup.xml",
+    src: "android/tzlookup.xml",
+    filename: "tzlookup.xml",
+    sub_dir: "tz",
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "apex_tzdata",
+    src: "iana/tzdata",
+    notice: "iana/NOTICE",
+    filename: "tzdata",
+    sub_dir: "tz",
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "apex_icu_tzdata.dat",
+    src: "icu_overlay/icu_tzdata.dat",
+    notice: "icu_overlay/LICENSE",
+    filename: "icu_tzdata.dat",
+    sub_dir: "icu",
+    installable: false,
+}
+
+// tzdata packaged into a jar for use in robolectric
+java_genrule {
+    name: "robolectric_tzdata",
+    out: ["robolectric_tzdata.jar"],
+    tools: ["soong_zip"],
+    srcs: [
+        "iana/tzdata",
+        "android/tzlookup.xml",
+    ],
+    cmd: "mkdir -p $(genDir)/usr/share/zoneinfo/ && " +
+        "cp $(location iana/tzdata) $(genDir)/usr/share/zoneinfo/ && " +
+        "cp $(location android/tzlookup.xml) $(genDir)/usr/share/zoneinfo/ && " +
+        "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)/usr/share/zoneinfo",
+}
diff --git a/output_data/Android.mk b/output_data/Android.mk
index 888404c..1711bfd 100644
--- a/output_data/Android.mk
+++ b/output_data/Android.mk
@@ -1,3 +1,18 @@
+# -*- mode: makefile -*-
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 LOCAL_PATH := $(call my-dir)
 
 include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/output_data/CleanSpec.mk b/output_data/CleanSpec.mk
new file mode 100644
index 0000000..2ceaf82
--- /dev/null
+++ b/output_data/CleanSpec.mk
@@ -0,0 +1,57 @@
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list.  These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+#     $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+#     $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list.  E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+
+$(call add-clean-step, rm -f $(TARGET_OUT)/system/usr/share/zoneinfo/tzlookup.xml)
+$(call add-clean-step, rm -f $(HOST_OUT)/usr/share/zoneinfo/tzlookup.xml)
+
+# Fixes for the steps above which seem to be broken because TARGET_OUT / HOST_OUT aren't set
+# for CleanSpec.mk.
+$(call add-clean-step, rm -f $(PRODUCT_OUT)/system/usr/share/zoneinfo/tzlookup.xml)
+$(call add-clean-step, rm -f $(OUT_DIR)/host/linux-x86/usr/share/zoneinfo/tzlookup.xml)
+
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
diff --git a/output_data/android/Android.mk b/output_data/android/Android.mk
index 10f3caa..8c44af4 100644
--- a/output_data/android/Android.mk
+++ b/output_data/android/Android.mk
@@ -1,28 +1,52 @@
-LOCAL_PATH:= $(call my-dir)
+# -*- mode: makefile -*-
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
-include $(CLEAR_VARS)
-LOCAL_MODULE := tzlookup.xml
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-LOCAL_SRC_FILES := $(LOCAL_MODULE)
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_PATH := $(TARGET_OUT)/usr/share/zoneinfo
-include $(BUILD_PREBUILT)
+LOCAL_PATH:= $(call my-dir)
 
 ifeq ($(WITH_HOST_DALVIK),true)
 
 # A host version of the tzlookup.xml module for use by
 # hostdex rules.
 
+# Simulate the runtime module.
 include $(CLEAR_VARS)
-LOCAL_MODULE := tzlookup.xml
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_MODULE := tzlookup.xml_host_runtime_apex
 LOCAL_IS_HOST_MODULE := true
 LOCAL_SRC_FILES := tzlookup.xml
 LOCAL_MODULE_CLASS := ETC
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE_STEM := $(LOCAL_SRC_FILES)
-LOCAL_MODULE_PATH := $(HOST_OUT)/usr/share/zoneinfo
+LOCAL_MODULE_PATH := $(HOST_OUT)/com.android.runtime/etc/tz
 include $(BUILD_PREBUILT)
 
 endif
+
+# Module definition producing a tzlookup.xml prebuilt file in
+# /system/etc/tz for standalone ART testing purposes. This is a
+# temporary change needed until the ART Buildbot and Golem both fully
+# support the Runtime APEX (see b/121117762). This module should never
+# be shipped by default (i.e. should never be part of
+# `PRODUCT_PACKAGE`.)
+#
+# TODO(b/121117762, b/129332183): Remove this module definition when
+# the ART Buildbot and Golem have full support for the Runtime APEX.
+include $(CLEAR_VARS)
+LOCAL_MODULE := tzlookup.xml-art-test
+LOCAL_MODULE_STEM := tzlookup.xml
+LOCAL_SRC_FILES := $(LOCAL_MODULE_STEM)
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/tz
+include $(BUILD_PREBUILT)
diff --git a/output_data/android/tzlookup.xml b/output_data/android/tzlookup.xml
index 3a553fb..7ab167b 100644
--- a/output_data/android/tzlookup.xml
+++ b/output_data/android/tzlookup.xml
@@ -2,7 +2,7 @@
 
  **** Autogenerated file - DO NOT EDIT ****
 
---><timezones ianaversion="2018i">
+--><timezones ianaversion="2019a">
  <countryzones>
   <country code="ad" default="Europe/Andorra" everutc="n">
    <id>Europe/Andorra</id>
@@ -869,7 +869,7 @@
    <id notafter="436359600000">America/Juneau</id>
    <id notafter="436356000000">America/Yakutat</id>
    <id notafter="436363200000">America/Nome</id>
-   <id notafter="1552215600000">America/Metlakatla</id>
+   <id notafter="1547978400000">America/Metlakatla</id>
    <id notafter="341402400000">America/Sitka</id>
    <id>Pacific/Honolulu</id>
    <id>America/Adak</id>
diff --git a/output_data/distro/distro.zip b/output_data/distro/distro.zip
index 485a6d4..b2ebf5c 100644
--- a/output_data/distro/distro.zip
+++ b/output_data/distro/distro.zip
Binary files differ
diff --git a/output_data/iana/Android.bp b/output_data/iana/Android.bp
new file mode 100644
index 0000000..b96ae16
--- /dev/null
+++ b/output_data/iana/Android.bp
@@ -0,0 +1,51 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+prebuilt_usr_share {
+    name: "tzdata",
+    src: "tzdata",
+    sub_dir: "zoneinfo",
+}
+
+// A host version of the tzdata module for use by
+// hostdex rules.
+
+// Simulate /system
+prebuilt_usr_share_host {
+    name: "tzdata_host",
+    src: "tzdata",
+    filename_from_src: true,
+    sub_dir: "zoneinfo",
+    target: {
+        darwin: {
+            enabled: false,
+        },
+    },
+}
+
+// Module definition producing a tzdata prebuilt file in
+// /system/etc/tz for standalone ART testing purposes. This is a
+// temporary change needed until the ART Buildbot and Golem both fully
+// support the Runtime APEX (see b/121117762). This module should never
+// be shipped by default (i.e. should never be part of
+// `PRODUCT_PACKAGE`.)
+
+// TODO(b/121117762, b/129332183): Remove this module definition when
+// the ART Buildbot and Golem have full support for the Runtime APEX.
+prebuilt_etc {
+    name: "tzdata-art-test",
+    src: "tzdata",
+    filename_from_src: true,
+    sub_dir: "tz",
+}
diff --git a/output_data/iana/Android.mk b/output_data/iana/Android.mk
index 5aafd17..150860f 100644
--- a/output_data/iana/Android.mk
+++ b/output_data/iana/Android.mk
@@ -1,28 +1,34 @@
-LOCAL_PATH:= $(call my-dir)
+# -*- mode: makefile -*-
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
-include $(CLEAR_VARS)
-LOCAL_MODULE := tzdata
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-LOCAL_SRC_FILES := $(LOCAL_MODULE)
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_PATH := $(TARGET_OUT)/usr/share/zoneinfo
-include $(BUILD_PREBUILT)
+LOCAL_PATH:= $(call my-dir)
 
 ifeq ($(WITH_HOST_DALVIK),true)
 
 # A host version of the tzdata module for use by
 # hostdex rules.
 
+# Simulate the runtime module.
 include $(CLEAR_VARS)
-LOCAL_MODULE := tzdata
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_MODULE := tzdata_host_runtime_apex
 LOCAL_IS_HOST_MODULE := true
 LOCAL_SRC_FILES := tzdata
 LOCAL_MODULE_CLASS := ETC
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE_STEM := $(LOCAL_SRC_FILES)
-LOCAL_MODULE_PATH := $(HOST_OUT)/usr/share/zoneinfo
+LOCAL_MODULE_PATH := $(HOST_OUT)/com.android.runtime/etc/tz
 include $(BUILD_PREBUILT)
 
 endif
diff --git a/output_data/iana/tzdata b/output_data/iana/tzdata
index 6c55cd8..b61bd24 100644
--- a/output_data/iana/tzdata
+++ b/output_data/iana/tzdata
Binary files differ
diff --git a/output_data/icu_overlay/LICENSE b/output_data/icu_overlay/LICENSE
new file mode 100644
index 0000000..25b6eb9
--- /dev/null
+++ b/output_data/icu_overlay/LICENSE
@@ -0,0 +1,414 @@
+COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
+
+Copyright © 1991-2018 Unicode, Inc. All rights reserved.
+Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Unicode data files and any associated documentation
+(the "Data Files") or Unicode software and any associated documentation
+(the "Software") to deal in the Data Files or Software
+without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, and/or sell copies of
+the Data Files or Software, and to permit persons to whom the Data Files
+or Software are furnished to do so, provided that either
+(a) this copyright and permission notice appear with all copies
+of the Data Files or Software, or
+(b) this copyright and permission notice appear in associated
+Documentation.
+
+THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
+DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in these Data Files or Software without prior
+written authorization of the copyright holder.
+
+---------------------
+
+Third-Party Software Licenses
+
+This section contains third-party software notices and/or additional
+terms for licensed third-party software components included within ICU
+libraries.
+
+1. ICU License - ICU 1.8.1 to ICU 57.1
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright (c) 1995-2016 International Business Machines Corporation and others
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, and/or sell copies of the Software, and to permit persons
+to whom the Software is furnished to do so, provided that the above
+copyright notice(s) and this permission notice appear in all copies of
+the Software and that both the above copyright notice(s) and this
+permission notice appear in supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
+SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
+RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+
+All trademarks and registered trademarks mentioned herein are the
+property of their respective owners.
+
+2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
+
+ #     The Google Chrome software developed by Google is licensed under
+ # the BSD license. Other software included in this distribution is
+ # provided under other licenses, as set forth below.
+ #
+ #  The BSD License
+ #  http://opensource.org/licenses/bsd-license.php
+ #  Copyright (C) 2006-2008, Google Inc.
+ #
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are met:
+ #
+ #  Redistributions of source code must retain the above copyright notice,
+ # this list of conditions and the following disclaimer.
+ #  Redistributions in binary form must reproduce the above
+ # copyright notice, this list of conditions and the following
+ # disclaimer in the documentation and/or other materials provided with
+ # the distribution.
+ #  Neither the name of  Google Inc. nor the names of its
+ # contributors may be used to endorse or promote products derived from
+ # this software without specific prior written permission.
+ #
+ #
+ #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #
+ #
+ #  The word list in cjdict.txt are generated by combining three word lists
+ # listed below with further processing for compound word breaking. The
+ # frequency is generated with an iterative training against Google web
+ # corpora.
+ #
+ #  * Libtabe (Chinese)
+ #    - https://sourceforge.net/project/?group_id=1519
+ #    - Its license terms and conditions are shown below.
+ #
+ #  * IPADIC (Japanese)
+ #    - http://chasen.aist-nara.ac.jp/chasen/distribution.html
+ #    - Its license terms and conditions are shown below.
+ #
+ #  ---------COPYING.libtabe ---- BEGIN--------------------
+ #
+ #  /*
+ #   * Copyright (c) 1999 TaBE Project.
+ #   * Copyright (c) 1999 Pai-Hsiang Hsiao.
+ #   * All rights reserved.
+ #   *
+ #   * Redistribution and use in source and binary forms, with or without
+ #   * modification, are permitted provided that the following conditions
+ #   * are met:
+ #   *
+ #   * . Redistributions of source code must retain the above copyright
+ #   *   notice, this list of conditions and the following disclaimer.
+ #   * . Redistributions in binary form must reproduce the above copyright
+ #   *   notice, this list of conditions and the following disclaimer in
+ #   *   the documentation and/or other materials provided with the
+ #   *   distribution.
+ #   * . Neither the name of the TaBE Project nor the names of its
+ #   *   contributors may be used to endorse or promote products derived
+ #   *   from this software without specific prior written permission.
+ #   *
+ #   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #   * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #   * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #   * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #   */
+ #
+ #  /*
+ #   * Copyright (c) 1999 Computer Systems and Communication Lab,
+ #   *                    Institute of Information Science, Academia
+ #       *                    Sinica. All rights reserved.
+ #   *
+ #   * Redistribution and use in source and binary forms, with or without
+ #   * modification, are permitted provided that the following conditions
+ #   * are met:
+ #   *
+ #   * . Redistributions of source code must retain the above copyright
+ #   *   notice, this list of conditions and the following disclaimer.
+ #   * . Redistributions in binary form must reproduce the above copyright
+ #   *   notice, this list of conditions and the following disclaimer in
+ #   *   the documentation and/or other materials provided with the
+ #   *   distribution.
+ #   * . Neither the name of the Computer Systems and Communication Lab
+ #   *   nor the names of its contributors may be used to endorse or
+ #   *   promote products derived from this software without specific
+ #   *   prior written permission.
+ #   *
+ #   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #   * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #   * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #   * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #   */
+ #
+ #  Copyright 1996 Chih-Hao Tsai @ Beckman Institute,
+ #      University of Illinois
+ #  c-tsai4@uiuc.edu  http://casper.beckman.uiuc.edu/~c-tsai4
+ #
+ #  ---------------COPYING.libtabe-----END--------------------------------
+ #
+ #
+ #  ---------------COPYING.ipadic-----BEGIN-------------------------------
+ #
+ #  Copyright 2000, 2001, 2002, 2003 Nara Institute of Science
+ #  and Technology.  All Rights Reserved.
+ #
+ #  Use, reproduction, and distribution of this software is permitted.
+ #  Any copy of this software, whether in its original form or modified,
+ #  must include both the above copyright notice and the following
+ #  paragraphs.
+ #
+ #  Nara Institute of Science and Technology (NAIST),
+ #  the copyright holders, disclaims all warranties with regard to this
+ #  software, including all implied warranties of merchantability and
+ #  fitness, in no event shall NAIST be liable for
+ #  any special, indirect or consequential damages or any damages
+ #  whatsoever resulting from loss of use, data or profits, whether in an
+ #  action of contract, negligence or other tortuous action, arising out
+ #  of or in connection with the use or performance of this software.
+ #
+ #  A large portion of the dictionary entries
+ #  originate from ICOT Free Software.  The following conditions for ICOT
+ #  Free Software applies to the current dictionary as well.
+ #
+ #  Each User may also freely distribute the Program, whether in its
+ #  original form or modified, to any third party or parties, PROVIDED
+ #  that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear
+ #  on, or be attached to, the Program, which is distributed substantially
+ #  in the same form as set out herein and that such intended
+ #  distribution, if actually made, will neither violate or otherwise
+ #  contravene any of the laws and regulations of the countries having
+ #  jurisdiction over the User or the intended distribution itself.
+ #
+ #  NO WARRANTY
+ #
+ #  The program was produced on an experimental basis in the course of the
+ #  research and development conducted during the project and is provided
+ #  to users as so produced on an experimental basis.  Accordingly, the
+ #  program is provided without any warranty whatsoever, whether express,
+ #  implied, statutory or otherwise.  The term "warranty" used herein
+ #  includes, but is not limited to, any warranty of the quality,
+ #  performance, merchantability and fitness for a particular purpose of
+ #  the program and the nonexistence of any infringement or violation of
+ #  any right of any third party.
+ #
+ #  Each user of the program will agree and understand, and be deemed to
+ #  have agreed and understood, that there is no warranty whatsoever for
+ #  the program and, accordingly, the entire risk arising from or
+ #  otherwise connected with the program is assumed by the user.
+ #
+ #  Therefore, neither ICOT, the copyright holder, or any other
+ #  organization that participated in or was otherwise related to the
+ #  development of the program and their respective officials, directors,
+ #  officers and other employees shall be held liable for any and all
+ #  damages, including, without limitation, general, special, incidental
+ #  and consequential damages, arising out of or otherwise in connection
+ #  with the use or inability to use the program or any product, material
+ #  or result produced or otherwise obtained by using the program,
+ #  regardless of whether they have been advised of, or otherwise had
+ #  knowledge of, the possibility of such damages at any time during the
+ #  project or thereafter.  Each user will be deemed to have agreed to the
+ #  foregoing by his or her commencement of use of the program.  The term
+ #  "use" as used herein includes, but is not limited to, the use,
+ #  modification, copying and distribution of the program and the
+ #  production of secondary products from the program.
+ #
+ #  In the case where the program, whether in its original form or
+ #  modified, was distributed or delivered to or received by a user from
+ #  any person, organization or entity other than ICOT, unless it makes or
+ #  grants independently of ICOT any specific warranty to the user in
+ #  writing, such person, organization or entity, will also be exempted
+ #  from and not be held liable to the user for any such damages as noted
+ #  above as far as the program is concerned.
+ #
+ #  ---------------COPYING.ipadic-----END----------------------------------
+
+3. Lao Word Break Dictionary Data (laodict.txt)
+
+ #  Copyright (c) 2013 International Business Machines Corporation
+ #  and others. All Rights Reserved.
+ #
+ # Project: http://code.google.com/p/lao-dictionary/
+ # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt
+ # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt
+ #              (copied below)
+ #
+ #  This file is derived from the above dictionary, with slight
+ #  modifications.
+ #  ----------------------------------------------------------------------
+ #  Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell.
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ #  modification,
+ #  are permitted provided that the following conditions are met:
+ #
+ #
+ # Redistributions of source code must retain the above copyright notice, this
+ #  list of conditions and the following disclaimer. Redistributions in
+ #  binary form must reproduce the above copyright notice, this list of
+ #  conditions and the following disclaimer in the documentation and/or
+ #  other materials provided with the distribution.
+ #
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ # OF THE POSSIBILITY OF SUCH DAMAGE.
+ #  --------------------------------------------------------------------------
+
+4. Burmese Word Break Dictionary Data (burmesedict.txt)
+
+ #  Copyright (c) 2014 International Business Machines Corporation
+ #  and others. All Rights Reserved.
+ #
+ #  This list is part of a project hosted at:
+ #    github.com/kanyawtech/myanmar-karen-word-lists
+ #
+ #  --------------------------------------------------------------------------
+ #  Copyright (c) 2013, LeRoy Benjamin Sharon
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ #  modification, are permitted provided that the following conditions
+ #  are met: Redistributions of source code must retain the above
+ #  copyright notice, this list of conditions and the following
+ #  disclaimer.  Redistributions in binary form must reproduce the
+ #  above copyright notice, this list of conditions and the following
+ #  disclaimer in the documentation and/or other materials provided
+ #  with the distribution.
+ #
+ #    Neither the name Myanmar Karen Word Lists, nor the names of its
+ #    contributors may be used to endorse or promote products derived
+ #    from this software without specific prior written permission.
+ #
+ #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ #  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ #  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ #  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
+ #  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ #  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ #  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ #  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ #  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ #  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ #  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ #  SUCH DAMAGE.
+ #  --------------------------------------------------------------------------
+
+5. Time Zone Database
+
+  ICU uses the public domain data and code derived from Time Zone
+Database for its time zone support. The ownership of the TZ database
+is explained in BCP 175: Procedure for Maintaining the Time Zone
+Database section 7.
+
+ # 7.  Database Ownership
+ #
+ #    The TZ database itself is not an IETF Contribution or an IETF
+ #    document.  Rather it is a pre-existing and regularly updated work
+ #    that is in the public domain, and is intended to remain in the
+ #    public domain.  Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do
+ #    not apply to the TZ Database or contributions that individuals make
+ #    to it.  Should any claims be made and substantiated against the TZ
+ #    Database, the organization that is providing the IANA
+ #    Considerations defined in this RFC, under the memorandum of
+ #    understanding with the IETF, currently ICANN, may act in accordance
+ #    with all competent court orders.  No ownership claims will be made
+ #    by ICANN or the IETF Trust on the database or the code.  Any person
+ #    making a contribution to the database or code waives all rights to
+ #    future claims in that contribution or in the TZ Database.
+
+6. Google double-conversion
+
+Copyright 2006-2011, the V8 project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/output_data/icu_overlay/icu_tzdata.dat b/output_data/icu_overlay/icu_tzdata.dat
index 93f3bd9..f2fc3f4 100644
--- a/output_data/icu_overlay/icu_tzdata.dat
+++ b/output_data/icu_overlay/icu_tzdata.dat
Binary files differ
diff --git a/output_data/version/Android.bp b/output_data/version/Android.bp
new file mode 100644
index 0000000..4fea9dd
--- /dev/null
+++ b/output_data/version/Android.bp
@@ -0,0 +1,50 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+prebuilt_usr_share {
+    name: "tz_version",
+    src: "tz_version",
+    sub_dir: "zoneinfo",
+}
+
+// A host version of the tz_version module for use by
+// hostdex rules.
+
+prebuilt_usr_share_host {
+    name: "tz_version_host",
+    src: "tz_version",
+    filename_from_src: true,
+    sub_dir: "zoneinfo",
+    target: {
+        darwin: {
+            enabled: false,
+        },
+    },
+}
+
+// Module definition producing a tz_version prebuilt file in
+// /system/etc/tz for standalone ART testing purposes. This is a
+// temporary change needed until the ART Buildbot and Golem both fully
+// support the Runtime APEX (see b/121117762). This module should never
+// be shipped by default (i.e. should never be part of
+// `PRODUCT_PACKAGE`.)
+
+// TODO(b/121117762, b/129332183): Remove this module definition when
+// the ART Buildbot and Golem have full support for the Runtime APEX.
+prebuilt_etc {
+    name: "tz_version-art-test",
+    src: "tz_version",
+    filename_from_src: true,
+    sub_dir: "tz",
+}
diff --git a/output_data/version/Android.mk b/output_data/version/Android.mk
new file mode 100644
index 0000000..1a0316b
--- /dev/null
+++ b/output_data/version/Android.mk
@@ -0,0 +1,34 @@
+# -*- mode: makefile -*-
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+
+ifeq ($(WITH_HOST_DALVIK),true)
+
+# A host version of the tz_version module for use by
+# hostdex rules.
+
+# Simulate the runtime module
+include $(CLEAR_VARS)
+LOCAL_MODULE := tz_version_host_runtime_apex
+LOCAL_IS_HOST_MODULE := true
+LOCAL_SRC_FILES := tz_version
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_STEM := $(LOCAL_SRC_FILES)
+LOCAL_MODULE_PATH := $(HOST_OUT)/com.android.runtime/etc/tz
+include $(BUILD_PREBUILT)
+
+endif
diff --git a/output_data/version/tz_version b/output_data/version/tz_version
new file mode 100644
index 0000000..ee2a1dd
--- /dev/null
+++ b/output_data/version/tz_version
@@ -0,0 +1 @@
+004.001|2019a|001
\ No newline at end of file
diff --git a/testing/Android.bp b/testing/Android.bp
index 108bd8d..75cc274 100644
--- a/testing/Android.bp
+++ b/testing/Android.bp
@@ -19,5 +19,5 @@
     hostdex: true,
 
     srcs: ["src/main/**/*.java"],
-    no_framework_libs: true,
+    sdk_version: "core_current",
 }
diff --git a/testing/data/create-test-data.sh b/testing/data/create-test-data.sh
index 53a5eea..2d3dce2 100755
--- a/testing/data/create-test-data.sh
+++ b/testing/data/create-test-data.sh
@@ -31,13 +31,15 @@
 
 # Create the distro .zip
 mkdir -p ${TEST_DIR}/output_data/distro
+mkdir -p ${TEST_DIR}/output_data/version
 ${DISTRO_TOOLS_DIR}/create-distro.py \
     -iana_version ${IANA_VERSION} \
     -revision 1 \
     -tzdata ${TEST_DIR}/output_data/iana/tzdata \
     -icu ${TEST_DIR}/output_data/icu_overlay/icu_tzdata.dat \
     -tzlookup ${TEST_DIR}/output_data/android/tzlookup.xml \
-    -output ${TEST_DIR}/output_data/distro
+    -output_distro_dir ${TEST_DIR}/output_data/distro \
+    -output_version_file ${TEST_DIR}/output_data/version/tz_version
 
 # Test 2: A set of data older than the system-image data from ${TIMEZONE_DIR}
 IANA_VERSION=2016a
@@ -48,12 +50,14 @@
 
 # Create the distro .zip
 mkdir -p ${TEST_DIR}/output_data/distro
+mkdir -p ${TEST_DIR}/output_data/version
 ${DISTRO_TOOLS_DIR}/create-distro.py \
     -iana_version ${IANA_VERSION} \
     -revision 1 \
     -tzdata ${TEST_DIR}/output_data/iana/tzdata \
     -icu ${TEST_DIR}/output_data/icu_overlay/icu_tzdata.dat \
     -tzlookup ${TEST_DIR}/output_data/android/tzlookup.xml \
-    -output ${TEST_DIR}/output_data/distro
+    -output_distro_dir ${TEST_DIR}/output_data/distro \
+    -output_version_file ${TEST_DIR}/output_data/version/tz_version
 
 
diff --git a/testing/data/test1/apex/Android.bp b/testing/data/test1/apex/Android.bp
new file mode 100644
index 0000000..c405f63
--- /dev/null
+++ b/testing/data/test1/apex/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// A test version of apex.tzdata that contains test1 data (2030a).
+// It has a version code that should beat a "real" APEX and enables
+// end-to-end installation testing on devices with the latests real
+// data.
+apex {
+    name: "test1_com.android.tzdata",
+    defaults: ["com.android.tzdata-defaults"],
+    manifest: "manifest.json",
+    prebuilts: [
+        "apex_tz_version_test1",
+        "apex_tzlookup.xml_test1",
+        "apex_tzdata_test1",
+        "apex_icu_tzdata.dat_test1",
+    ],
+
+    // installable: false as we do not want test APEX versions in the system
+    // image.
+    installable: false,
+}
+
diff --git a/testing/data/test1/apex/manifest.json b/testing/data/test1/apex/manifest.json
new file mode 100644
index 0000000..05d634a
--- /dev/null
+++ b/testing/data/test1/apex/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "com.android.tzdata",
+  "version": 2
+}
diff --git a/testing/data/test1/output_data/Android.bp b/testing/data/test1/output_data/Android.bp
new file mode 100644
index 0000000..054a922
--- /dev/null
+++ b/testing/data/test1/output_data/Android.bp
@@ -0,0 +1,48 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+prebuilt_etc {
+    name: "apex_tz_version_test1",
+    src: "version/tz_version",
+    filename: "tz_version",
+    sub_dir: "tz",
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "apex_tzlookup.xml_test1",
+    src: "android/tzlookup.xml",
+    filename: "tzlookup.xml",
+    sub_dir: "tz",
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "apex_tzdata_test1",
+    src: "iana/tzdata",
+    notice: "iana/NOTICE",
+    filename: "tzdata",
+    sub_dir: "tz",
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "apex_icu_tzdata.dat_test1",
+    src: "icu_overlay/icu_tzdata.dat",
+    notice: "icu_overlay/LICENSE",
+    filename: "icu_tzdata.dat",
+    sub_dir: "icu",
+    installable: false,
+}
+
diff --git a/testing/data/test1/output_data/android/tzlookup.xml b/testing/data/test1/output_data/android/tzlookup.xml
index 315a6da..dc29817 100644
--- a/testing/data/test1/output_data/android/tzlookup.xml
+++ b/testing/data/test1/output_data/android/tzlookup.xml
@@ -869,7 +869,7 @@
    <id notafter="436359600000">America/Juneau</id>
    <id notafter="436356000000">America/Yakutat</id>
    <id notafter="436363200000">America/Nome</id>
-   <id notafter="1552215600000">America/Metlakatla</id>
+   <id notafter="1547978400000">America/Metlakatla</id>
    <id notafter="341402400000">America/Sitka</id>
    <id>Pacific/Honolulu</id>
    <id>America/Adak</id>
diff --git a/testing/data/test1/output_data/distro/distro.zip b/testing/data/test1/output_data/distro/distro.zip
index b9c2221..3e63003 100644
--- a/testing/data/test1/output_data/distro/distro.zip
+++ b/testing/data/test1/output_data/distro/distro.zip
Binary files differ
diff --git a/testing/data/test1/output_data/iana/NOTICE b/testing/data/test1/output_data/iana/NOTICE
new file mode 100644
index 0000000..148eb23
--- /dev/null
+++ b/testing/data/test1/output_data/iana/NOTICE
@@ -0,0 +1,4 @@
+With a few exceptions, all files in the tz code and data (including
+this one) are in the public domain.  The exceptions are date.c,
+newstrftime.3, and strftime.c, which contain material derived from BSD
+and which use the BSD 3-clause license.
diff --git a/testing/data/test1/output_data/iana/tzdata b/testing/data/test1/output_data/iana/tzdata
index 71de696..ef81695 100644
--- a/testing/data/test1/output_data/iana/tzdata
+++ b/testing/data/test1/output_data/iana/tzdata
Binary files differ
diff --git a/testing/data/test1/output_data/icu_overlay/LICENSE b/testing/data/test1/output_data/icu_overlay/LICENSE
new file mode 100644
index 0000000..25b6eb9
--- /dev/null
+++ b/testing/data/test1/output_data/icu_overlay/LICENSE
@@ -0,0 +1,414 @@
+COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
+
+Copyright © 1991-2018 Unicode, Inc. All rights reserved.
+Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Unicode data files and any associated documentation
+(the "Data Files") or Unicode software and any associated documentation
+(the "Software") to deal in the Data Files or Software
+without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, and/or sell copies of
+the Data Files or Software, and to permit persons to whom the Data Files
+or Software are furnished to do so, provided that either
+(a) this copyright and permission notice appear with all copies
+of the Data Files or Software, or
+(b) this copyright and permission notice appear in associated
+Documentation.
+
+THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
+DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in these Data Files or Software without prior
+written authorization of the copyright holder.
+
+---------------------
+
+Third-Party Software Licenses
+
+This section contains third-party software notices and/or additional
+terms for licensed third-party software components included within ICU
+libraries.
+
+1. ICU License - ICU 1.8.1 to ICU 57.1
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright (c) 1995-2016 International Business Machines Corporation and others
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, and/or sell copies of the Software, and to permit persons
+to whom the Software is furnished to do so, provided that the above
+copyright notice(s) and this permission notice appear in all copies of
+the Software and that both the above copyright notice(s) and this
+permission notice appear in supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
+SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
+RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+
+All trademarks and registered trademarks mentioned herein are the
+property of their respective owners.
+
+2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
+
+ #     The Google Chrome software developed by Google is licensed under
+ # the BSD license. Other software included in this distribution is
+ # provided under other licenses, as set forth below.
+ #
+ #  The BSD License
+ #  http://opensource.org/licenses/bsd-license.php
+ #  Copyright (C) 2006-2008, Google Inc.
+ #
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are met:
+ #
+ #  Redistributions of source code must retain the above copyright notice,
+ # this list of conditions and the following disclaimer.
+ #  Redistributions in binary form must reproduce the above
+ # copyright notice, this list of conditions and the following
+ # disclaimer in the documentation and/or other materials provided with
+ # the distribution.
+ #  Neither the name of  Google Inc. nor the names of its
+ # contributors may be used to endorse or promote products derived from
+ # this software without specific prior written permission.
+ #
+ #
+ #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #
+ #
+ #  The word list in cjdict.txt are generated by combining three word lists
+ # listed below with further processing for compound word breaking. The
+ # frequency is generated with an iterative training against Google web
+ # corpora.
+ #
+ #  * Libtabe (Chinese)
+ #    - https://sourceforge.net/project/?group_id=1519
+ #    - Its license terms and conditions are shown below.
+ #
+ #  * IPADIC (Japanese)
+ #    - http://chasen.aist-nara.ac.jp/chasen/distribution.html
+ #    - Its license terms and conditions are shown below.
+ #
+ #  ---------COPYING.libtabe ---- BEGIN--------------------
+ #
+ #  /*
+ #   * Copyright (c) 1999 TaBE Project.
+ #   * Copyright (c) 1999 Pai-Hsiang Hsiao.
+ #   * All rights reserved.
+ #   *
+ #   * Redistribution and use in source and binary forms, with or without
+ #   * modification, are permitted provided that the following conditions
+ #   * are met:
+ #   *
+ #   * . Redistributions of source code must retain the above copyright
+ #   *   notice, this list of conditions and the following disclaimer.
+ #   * . Redistributions in binary form must reproduce the above copyright
+ #   *   notice, this list of conditions and the following disclaimer in
+ #   *   the documentation and/or other materials provided with the
+ #   *   distribution.
+ #   * . Neither the name of the TaBE Project nor the names of its
+ #   *   contributors may be used to endorse or promote products derived
+ #   *   from this software without specific prior written permission.
+ #   *
+ #   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #   * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #   * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #   * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #   */
+ #
+ #  /*
+ #   * Copyright (c) 1999 Computer Systems and Communication Lab,
+ #   *                    Institute of Information Science, Academia
+ #       *                    Sinica. All rights reserved.
+ #   *
+ #   * Redistribution and use in source and binary forms, with or without
+ #   * modification, are permitted provided that the following conditions
+ #   * are met:
+ #   *
+ #   * . Redistributions of source code must retain the above copyright
+ #   *   notice, this list of conditions and the following disclaimer.
+ #   * . Redistributions in binary form must reproduce the above copyright
+ #   *   notice, this list of conditions and the following disclaimer in
+ #   *   the documentation and/or other materials provided with the
+ #   *   distribution.
+ #   * . Neither the name of the Computer Systems and Communication Lab
+ #   *   nor the names of its contributors may be used to endorse or
+ #   *   promote products derived from this software without specific
+ #   *   prior written permission.
+ #   *
+ #   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #   * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #   * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #   * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #   */
+ #
+ #  Copyright 1996 Chih-Hao Tsai @ Beckman Institute,
+ #      University of Illinois
+ #  c-tsai4@uiuc.edu  http://casper.beckman.uiuc.edu/~c-tsai4
+ #
+ #  ---------------COPYING.libtabe-----END--------------------------------
+ #
+ #
+ #  ---------------COPYING.ipadic-----BEGIN-------------------------------
+ #
+ #  Copyright 2000, 2001, 2002, 2003 Nara Institute of Science
+ #  and Technology.  All Rights Reserved.
+ #
+ #  Use, reproduction, and distribution of this software is permitted.
+ #  Any copy of this software, whether in its original form or modified,
+ #  must include both the above copyright notice and the following
+ #  paragraphs.
+ #
+ #  Nara Institute of Science and Technology (NAIST),
+ #  the copyright holders, disclaims all warranties with regard to this
+ #  software, including all implied warranties of merchantability and
+ #  fitness, in no event shall NAIST be liable for
+ #  any special, indirect or consequential damages or any damages
+ #  whatsoever resulting from loss of use, data or profits, whether in an
+ #  action of contract, negligence or other tortuous action, arising out
+ #  of or in connection with the use or performance of this software.
+ #
+ #  A large portion of the dictionary entries
+ #  originate from ICOT Free Software.  The following conditions for ICOT
+ #  Free Software applies to the current dictionary as well.
+ #
+ #  Each User may also freely distribute the Program, whether in its
+ #  original form or modified, to any third party or parties, PROVIDED
+ #  that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear
+ #  on, or be attached to, the Program, which is distributed substantially
+ #  in the same form as set out herein and that such intended
+ #  distribution, if actually made, will neither violate or otherwise
+ #  contravene any of the laws and regulations of the countries having
+ #  jurisdiction over the User or the intended distribution itself.
+ #
+ #  NO WARRANTY
+ #
+ #  The program was produced on an experimental basis in the course of the
+ #  research and development conducted during the project and is provided
+ #  to users as so produced on an experimental basis.  Accordingly, the
+ #  program is provided without any warranty whatsoever, whether express,
+ #  implied, statutory or otherwise.  The term "warranty" used herein
+ #  includes, but is not limited to, any warranty of the quality,
+ #  performance, merchantability and fitness for a particular purpose of
+ #  the program and the nonexistence of any infringement or violation of
+ #  any right of any third party.
+ #
+ #  Each user of the program will agree and understand, and be deemed to
+ #  have agreed and understood, that there is no warranty whatsoever for
+ #  the program and, accordingly, the entire risk arising from or
+ #  otherwise connected with the program is assumed by the user.
+ #
+ #  Therefore, neither ICOT, the copyright holder, or any other
+ #  organization that participated in or was otherwise related to the
+ #  development of the program and their respective officials, directors,
+ #  officers and other employees shall be held liable for any and all
+ #  damages, including, without limitation, general, special, incidental
+ #  and consequential damages, arising out of or otherwise in connection
+ #  with the use or inability to use the program or any product, material
+ #  or result produced or otherwise obtained by using the program,
+ #  regardless of whether they have been advised of, or otherwise had
+ #  knowledge of, the possibility of such damages at any time during the
+ #  project or thereafter.  Each user will be deemed to have agreed to the
+ #  foregoing by his or her commencement of use of the program.  The term
+ #  "use" as used herein includes, but is not limited to, the use,
+ #  modification, copying and distribution of the program and the
+ #  production of secondary products from the program.
+ #
+ #  In the case where the program, whether in its original form or
+ #  modified, was distributed or delivered to or received by a user from
+ #  any person, organization or entity other than ICOT, unless it makes or
+ #  grants independently of ICOT any specific warranty to the user in
+ #  writing, such person, organization or entity, will also be exempted
+ #  from and not be held liable to the user for any such damages as noted
+ #  above as far as the program is concerned.
+ #
+ #  ---------------COPYING.ipadic-----END----------------------------------
+
+3. Lao Word Break Dictionary Data (laodict.txt)
+
+ #  Copyright (c) 2013 International Business Machines Corporation
+ #  and others. All Rights Reserved.
+ #
+ # Project: http://code.google.com/p/lao-dictionary/
+ # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt
+ # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt
+ #              (copied below)
+ #
+ #  This file is derived from the above dictionary, with slight
+ #  modifications.
+ #  ----------------------------------------------------------------------
+ #  Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell.
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ #  modification,
+ #  are permitted provided that the following conditions are met:
+ #
+ #
+ # Redistributions of source code must retain the above copyright notice, this
+ #  list of conditions and the following disclaimer. Redistributions in
+ #  binary form must reproduce the above copyright notice, this list of
+ #  conditions and the following disclaimer in the documentation and/or
+ #  other materials provided with the distribution.
+ #
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ # OF THE POSSIBILITY OF SUCH DAMAGE.
+ #  --------------------------------------------------------------------------
+
+4. Burmese Word Break Dictionary Data (burmesedict.txt)
+
+ #  Copyright (c) 2014 International Business Machines Corporation
+ #  and others. All Rights Reserved.
+ #
+ #  This list is part of a project hosted at:
+ #    github.com/kanyawtech/myanmar-karen-word-lists
+ #
+ #  --------------------------------------------------------------------------
+ #  Copyright (c) 2013, LeRoy Benjamin Sharon
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ #  modification, are permitted provided that the following conditions
+ #  are met: Redistributions of source code must retain the above
+ #  copyright notice, this list of conditions and the following
+ #  disclaimer.  Redistributions in binary form must reproduce the
+ #  above copyright notice, this list of conditions and the following
+ #  disclaimer in the documentation and/or other materials provided
+ #  with the distribution.
+ #
+ #    Neither the name Myanmar Karen Word Lists, nor the names of its
+ #    contributors may be used to endorse or promote products derived
+ #    from this software without specific prior written permission.
+ #
+ #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ #  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ #  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ #  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
+ #  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ #  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ #  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ #  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ #  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ #  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ #  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ #  SUCH DAMAGE.
+ #  --------------------------------------------------------------------------
+
+5. Time Zone Database
+
+  ICU uses the public domain data and code derived from Time Zone
+Database for its time zone support. The ownership of the TZ database
+is explained in BCP 175: Procedure for Maintaining the Time Zone
+Database section 7.
+
+ # 7.  Database Ownership
+ #
+ #    The TZ database itself is not an IETF Contribution or an IETF
+ #    document.  Rather it is a pre-existing and regularly updated work
+ #    that is in the public domain, and is intended to remain in the
+ #    public domain.  Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do
+ #    not apply to the TZ Database or contributions that individuals make
+ #    to it.  Should any claims be made and substantiated against the TZ
+ #    Database, the organization that is providing the IANA
+ #    Considerations defined in this RFC, under the memorandum of
+ #    understanding with the IETF, currently ICANN, may act in accordance
+ #    with all competent court orders.  No ownership claims will be made
+ #    by ICANN or the IETF Trust on the database or the code.  Any person
+ #    making a contribution to the database or code waives all rights to
+ #    future claims in that contribution or in the TZ Database.
+
+6. Google double-conversion
+
+Copyright 2006-2011, the V8 project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/testing/data/test1/output_data/icu_overlay/icu_tzdata.dat b/testing/data/test1/output_data/icu_overlay/icu_tzdata.dat
index 10ecdff..e5e3824 100644
--- a/testing/data/test1/output_data/icu_overlay/icu_tzdata.dat
+++ b/testing/data/test1/output_data/icu_overlay/icu_tzdata.dat
Binary files differ
diff --git a/testing/data/test1/output_data/version/tz_version b/testing/data/test1/output_data/version/tz_version
new file mode 100644
index 0000000..e1e8f45
--- /dev/null
+++ b/testing/data/test1/output_data/version/tz_version
@@ -0,0 +1 @@
+004.001|2030a|001
\ No newline at end of file
diff --git a/testing/data/test2/output_data/android/tzlookup.xml b/testing/data/test2/output_data/android/tzlookup.xml
index 8b101e2..bc9a517 100644
--- a/testing/data/test2/output_data/android/tzlookup.xml
+++ b/testing/data/test2/output_data/android/tzlookup.xml
@@ -869,7 +869,7 @@
    <id notafter="436359600000">America/Juneau</id>
    <id notafter="436356000000">America/Yakutat</id>
    <id notafter="436363200000">America/Nome</id>
-   <id notafter="1552215600000">America/Metlakatla</id>
+   <id notafter="1547978400000">America/Metlakatla</id>
    <id notafter="341402400000">America/Sitka</id>
    <id>Pacific/Honolulu</id>
    <id>America/Adak</id>
diff --git a/testing/data/test2/output_data/distro/distro.zip b/testing/data/test2/output_data/distro/distro.zip
index 248c99b..e08fce3 100644
--- a/testing/data/test2/output_data/distro/distro.zip
+++ b/testing/data/test2/output_data/distro/distro.zip
Binary files differ
diff --git a/testing/data/test2/output_data/iana/NOTICE b/testing/data/test2/output_data/iana/NOTICE
new file mode 100644
index 0000000..148eb23
--- /dev/null
+++ b/testing/data/test2/output_data/iana/NOTICE
@@ -0,0 +1,4 @@
+With a few exceptions, all files in the tz code and data (including
+this one) are in the public domain.  The exceptions are date.c,
+newstrftime.3, and strftime.c, which contain material derived from BSD
+and which use the BSD 3-clause license.
diff --git a/testing/data/test2/output_data/iana/tzdata b/testing/data/test2/output_data/iana/tzdata
index 234ee76..8f0302f 100644
--- a/testing/data/test2/output_data/iana/tzdata
+++ b/testing/data/test2/output_data/iana/tzdata
Binary files differ
diff --git a/testing/data/test2/output_data/icu_overlay/LICENSE b/testing/data/test2/output_data/icu_overlay/LICENSE
new file mode 100644
index 0000000..25b6eb9
--- /dev/null
+++ b/testing/data/test2/output_data/icu_overlay/LICENSE
@@ -0,0 +1,414 @@
+COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
+
+Copyright © 1991-2018 Unicode, Inc. All rights reserved.
+Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Unicode data files and any associated documentation
+(the "Data Files") or Unicode software and any associated documentation
+(the "Software") to deal in the Data Files or Software
+without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, and/or sell copies of
+the Data Files or Software, and to permit persons to whom the Data Files
+or Software are furnished to do so, provided that either
+(a) this copyright and permission notice appear with all copies
+of the Data Files or Software, or
+(b) this copyright and permission notice appear in associated
+Documentation.
+
+THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
+DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in these Data Files or Software without prior
+written authorization of the copyright holder.
+
+---------------------
+
+Third-Party Software Licenses
+
+This section contains third-party software notices and/or additional
+terms for licensed third-party software components included within ICU
+libraries.
+
+1. ICU License - ICU 1.8.1 to ICU 57.1
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright (c) 1995-2016 International Business Machines Corporation and others
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, and/or sell copies of the Software, and to permit persons
+to whom the Software is furnished to do so, provided that the above
+copyright notice(s) and this permission notice appear in all copies of
+the Software and that both the above copyright notice(s) and this
+permission notice appear in supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
+SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
+RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+
+All trademarks and registered trademarks mentioned herein are the
+property of their respective owners.
+
+2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
+
+ #     The Google Chrome software developed by Google is licensed under
+ # the BSD license. Other software included in this distribution is
+ # provided under other licenses, as set forth below.
+ #
+ #  The BSD License
+ #  http://opensource.org/licenses/bsd-license.php
+ #  Copyright (C) 2006-2008, Google Inc.
+ #
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are met:
+ #
+ #  Redistributions of source code must retain the above copyright notice,
+ # this list of conditions and the following disclaimer.
+ #  Redistributions in binary form must reproduce the above
+ # copyright notice, this list of conditions and the following
+ # disclaimer in the documentation and/or other materials provided with
+ # the distribution.
+ #  Neither the name of  Google Inc. nor the names of its
+ # contributors may be used to endorse or promote products derived from
+ # this software without specific prior written permission.
+ #
+ #
+ #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #
+ #
+ #  The word list in cjdict.txt are generated by combining three word lists
+ # listed below with further processing for compound word breaking. The
+ # frequency is generated with an iterative training against Google web
+ # corpora.
+ #
+ #  * Libtabe (Chinese)
+ #    - https://sourceforge.net/project/?group_id=1519
+ #    - Its license terms and conditions are shown below.
+ #
+ #  * IPADIC (Japanese)
+ #    - http://chasen.aist-nara.ac.jp/chasen/distribution.html
+ #    - Its license terms and conditions are shown below.
+ #
+ #  ---------COPYING.libtabe ---- BEGIN--------------------
+ #
+ #  /*
+ #   * Copyright (c) 1999 TaBE Project.
+ #   * Copyright (c) 1999 Pai-Hsiang Hsiao.
+ #   * All rights reserved.
+ #   *
+ #   * Redistribution and use in source and binary forms, with or without
+ #   * modification, are permitted provided that the following conditions
+ #   * are met:
+ #   *
+ #   * . Redistributions of source code must retain the above copyright
+ #   *   notice, this list of conditions and the following disclaimer.
+ #   * . Redistributions in binary form must reproduce the above copyright
+ #   *   notice, this list of conditions and the following disclaimer in
+ #   *   the documentation and/or other materials provided with the
+ #   *   distribution.
+ #   * . Neither the name of the TaBE Project nor the names of its
+ #   *   contributors may be used to endorse or promote products derived
+ #   *   from this software without specific prior written permission.
+ #   *
+ #   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #   * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #   * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #   * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #   */
+ #
+ #  /*
+ #   * Copyright (c) 1999 Computer Systems and Communication Lab,
+ #   *                    Institute of Information Science, Academia
+ #       *                    Sinica. All rights reserved.
+ #   *
+ #   * Redistribution and use in source and binary forms, with or without
+ #   * modification, are permitted provided that the following conditions
+ #   * are met:
+ #   *
+ #   * . Redistributions of source code must retain the above copyright
+ #   *   notice, this list of conditions and the following disclaimer.
+ #   * . Redistributions in binary form must reproduce the above copyright
+ #   *   notice, this list of conditions and the following disclaimer in
+ #   *   the documentation and/or other materials provided with the
+ #   *   distribution.
+ #   * . Neither the name of the Computer Systems and Communication Lab
+ #   *   nor the names of its contributors may be used to endorse or
+ #   *   promote products derived from this software without specific
+ #   *   prior written permission.
+ #   *
+ #   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #   * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #   * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #   * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #   */
+ #
+ #  Copyright 1996 Chih-Hao Tsai @ Beckman Institute,
+ #      University of Illinois
+ #  c-tsai4@uiuc.edu  http://casper.beckman.uiuc.edu/~c-tsai4
+ #
+ #  ---------------COPYING.libtabe-----END--------------------------------
+ #
+ #
+ #  ---------------COPYING.ipadic-----BEGIN-------------------------------
+ #
+ #  Copyright 2000, 2001, 2002, 2003 Nara Institute of Science
+ #  and Technology.  All Rights Reserved.
+ #
+ #  Use, reproduction, and distribution of this software is permitted.
+ #  Any copy of this software, whether in its original form or modified,
+ #  must include both the above copyright notice and the following
+ #  paragraphs.
+ #
+ #  Nara Institute of Science and Technology (NAIST),
+ #  the copyright holders, disclaims all warranties with regard to this
+ #  software, including all implied warranties of merchantability and
+ #  fitness, in no event shall NAIST be liable for
+ #  any special, indirect or consequential damages or any damages
+ #  whatsoever resulting from loss of use, data or profits, whether in an
+ #  action of contract, negligence or other tortuous action, arising out
+ #  of or in connection with the use or performance of this software.
+ #
+ #  A large portion of the dictionary entries
+ #  originate from ICOT Free Software.  The following conditions for ICOT
+ #  Free Software applies to the current dictionary as well.
+ #
+ #  Each User may also freely distribute the Program, whether in its
+ #  original form or modified, to any third party or parties, PROVIDED
+ #  that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear
+ #  on, or be attached to, the Program, which is distributed substantially
+ #  in the same form as set out herein and that such intended
+ #  distribution, if actually made, will neither violate or otherwise
+ #  contravene any of the laws and regulations of the countries having
+ #  jurisdiction over the User or the intended distribution itself.
+ #
+ #  NO WARRANTY
+ #
+ #  The program was produced on an experimental basis in the course of the
+ #  research and development conducted during the project and is provided
+ #  to users as so produced on an experimental basis.  Accordingly, the
+ #  program is provided without any warranty whatsoever, whether express,
+ #  implied, statutory or otherwise.  The term "warranty" used herein
+ #  includes, but is not limited to, any warranty of the quality,
+ #  performance, merchantability and fitness for a particular purpose of
+ #  the program and the nonexistence of any infringement or violation of
+ #  any right of any third party.
+ #
+ #  Each user of the program will agree and understand, and be deemed to
+ #  have agreed and understood, that there is no warranty whatsoever for
+ #  the program and, accordingly, the entire risk arising from or
+ #  otherwise connected with the program is assumed by the user.
+ #
+ #  Therefore, neither ICOT, the copyright holder, or any other
+ #  organization that participated in or was otherwise related to the
+ #  development of the program and their respective officials, directors,
+ #  officers and other employees shall be held liable for any and all
+ #  damages, including, without limitation, general, special, incidental
+ #  and consequential damages, arising out of or otherwise in connection
+ #  with the use or inability to use the program or any product, material
+ #  or result produced or otherwise obtained by using the program,
+ #  regardless of whether they have been advised of, or otherwise had
+ #  knowledge of, the possibility of such damages at any time during the
+ #  project or thereafter.  Each user will be deemed to have agreed to the
+ #  foregoing by his or her commencement of use of the program.  The term
+ #  "use" as used herein includes, but is not limited to, the use,
+ #  modification, copying and distribution of the program and the
+ #  production of secondary products from the program.
+ #
+ #  In the case where the program, whether in its original form or
+ #  modified, was distributed or delivered to or received by a user from
+ #  any person, organization or entity other than ICOT, unless it makes or
+ #  grants independently of ICOT any specific warranty to the user in
+ #  writing, such person, organization or entity, will also be exempted
+ #  from and not be held liable to the user for any such damages as noted
+ #  above as far as the program is concerned.
+ #
+ #  ---------------COPYING.ipadic-----END----------------------------------
+
+3. Lao Word Break Dictionary Data (laodict.txt)
+
+ #  Copyright (c) 2013 International Business Machines Corporation
+ #  and others. All Rights Reserved.
+ #
+ # Project: http://code.google.com/p/lao-dictionary/
+ # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt
+ # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt
+ #              (copied below)
+ #
+ #  This file is derived from the above dictionary, with slight
+ #  modifications.
+ #  ----------------------------------------------------------------------
+ #  Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell.
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ #  modification,
+ #  are permitted provided that the following conditions are met:
+ #
+ #
+ # Redistributions of source code must retain the above copyright notice, this
+ #  list of conditions and the following disclaimer. Redistributions in
+ #  binary form must reproduce the above copyright notice, this list of
+ #  conditions and the following disclaimer in the documentation and/or
+ #  other materials provided with the distribution.
+ #
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ # OF THE POSSIBILITY OF SUCH DAMAGE.
+ #  --------------------------------------------------------------------------
+
+4. Burmese Word Break Dictionary Data (burmesedict.txt)
+
+ #  Copyright (c) 2014 International Business Machines Corporation
+ #  and others. All Rights Reserved.
+ #
+ #  This list is part of a project hosted at:
+ #    github.com/kanyawtech/myanmar-karen-word-lists
+ #
+ #  --------------------------------------------------------------------------
+ #  Copyright (c) 2013, LeRoy Benjamin Sharon
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ #  modification, are permitted provided that the following conditions
+ #  are met: Redistributions of source code must retain the above
+ #  copyright notice, this list of conditions and the following
+ #  disclaimer.  Redistributions in binary form must reproduce the
+ #  above copyright notice, this list of conditions and the following
+ #  disclaimer in the documentation and/or other materials provided
+ #  with the distribution.
+ #
+ #    Neither the name Myanmar Karen Word Lists, nor the names of its
+ #    contributors may be used to endorse or promote products derived
+ #    from this software without specific prior written permission.
+ #
+ #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ #  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ #  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ #  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
+ #  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ #  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ #  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ #  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ #  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ #  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ #  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ #  SUCH DAMAGE.
+ #  --------------------------------------------------------------------------
+
+5. Time Zone Database
+
+  ICU uses the public domain data and code derived from Time Zone
+Database for its time zone support. The ownership of the TZ database
+is explained in BCP 175: Procedure for Maintaining the Time Zone
+Database section 7.
+
+ # 7.  Database Ownership
+ #
+ #    The TZ database itself is not an IETF Contribution or an IETF
+ #    document.  Rather it is a pre-existing and regularly updated work
+ #    that is in the public domain, and is intended to remain in the
+ #    public domain.  Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do
+ #    not apply to the TZ Database or contributions that individuals make
+ #    to it.  Should any claims be made and substantiated against the TZ
+ #    Database, the organization that is providing the IANA
+ #    Considerations defined in this RFC, under the memorandum of
+ #    understanding with the IETF, currently ICANN, may act in accordance
+ #    with all competent court orders.  No ownership claims will be made
+ #    by ICANN or the IETF Trust on the database or the code.  Any person
+ #    making a contribution to the database or code waives all rights to
+ #    future claims in that contribution or in the TZ Database.
+
+6. Google double-conversion
+
+Copyright 2006-2011, the V8 project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/testing/data/test2/output_data/icu_overlay/icu_tzdata.dat b/testing/data/test2/output_data/icu_overlay/icu_tzdata.dat
index 627a5a1..a44c3c7 100644
--- a/testing/data/test2/output_data/icu_overlay/icu_tzdata.dat
+++ b/testing/data/test2/output_data/icu_overlay/icu_tzdata.dat
Binary files differ
diff --git a/testing/data/test2/output_data/version/tz_version b/testing/data/test2/output_data/version/tz_version
new file mode 100644
index 0000000..cd062bc
--- /dev/null
+++ b/testing/data/test2/output_data/version/tz_version
@@ -0,0 +1 @@
+004.001|2016a|001
\ No newline at end of file
diff --git a/testing/data/transform-distro-files.sh b/testing/data/transform-distro-files.sh
index 8bce035..d51e554 100755
--- a/testing/data/transform-distro-files.sh
+++ b/testing/data/transform-distro-files.sh
@@ -14,18 +14,20 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-# Creates fake distro data files by taking the files in $1 and turning them into ones
+# Creates fake test data files by taking the files in $1 and turning them into ones
 # that appear to be ones from IANA release $2. The resulting files are placed beneath $3.
 
 REFERENCE_FILES_DIR=$1
 OUTPUT_IANA_RULES_VERSION=$2
-DISTRO_OUTPUT_DIR=$3
+TEST_DATA_OUTPUT_DIR=$3
 
 # Fail on error
 set -e
 
 TZDATA_FILE=iana/tzdata
+TZDATA_LICENSE_FILE=iana/NOTICE
 ICU_FILE=icu_overlay/icu_tzdata.dat
+ICU_LICENSE_FILE=icu_overlay/LICENSE
 TZLOOKUP_FILE=android/tzlookup.xml
 
 INPUT_TZDATA_FILE=${REFERENCE_FILES_DIR}/${TZDATA_FILE}
@@ -35,14 +37,14 @@
 TZHEADER=$(head -n1 ${INPUT_TZDATA_FILE} | cut -c1-11)
 INPUT_IANA_RULES_VERSION=${TZHEADER:6}
 
-OUTPUT_TZDATA_FILE=${DISTRO_OUTPUT_DIR}/${TZDATA_FILE}
-OUTPUT_ICU_FILE=${DISTRO_OUTPUT_DIR}/${ICU_FILE}
-OUTPUT_TZLOOKUP_FILE=${DISTRO_OUTPUT_DIR}/${TZLOOKUP_FILE}
+OUTPUT_TZDATA_FILE=${TEST_DATA_OUTPUT_DIR}/${TZDATA_FILE}
+OUTPUT_ICU_FILE=${TEST_DATA_OUTPUT_DIR}/${ICU_FILE}
+OUTPUT_TZLOOKUP_FILE=${TEST_DATA_OUTPUT_DIR}/${TZLOOKUP_FILE}
 
-mkdir -p ${DISTRO_OUTPUT_DIR}
-mkdir -p ${DISTRO_OUTPUT_DIR}/iana
-mkdir -p ${DISTRO_OUTPUT_DIR}/icu_overlay
-mkdir -p ${DISTRO_OUTPUT_DIR}/android
+mkdir -p ${TEST_DATA_OUTPUT_DIR}
+mkdir -p ${TEST_DATA_OUTPUT_DIR}/iana
+mkdir -p ${TEST_DATA_OUTPUT_DIR}/icu_overlay
+mkdir -p ${TEST_DATA_OUTPUT_DIR}/android
 
 # Create a new tzdata file.
 sed "1s/^tzdata${INPUT_IANA_RULES_VERSION}/tzdata${OUTPUT_IANA_RULES_VERSION}/" ${INPUT_TZDATA_FILE} > ${OUTPUT_TZDATA_FILE}
@@ -55,5 +57,9 @@
 # Copy the tzlookup.xml but update the ianaversion= attribute.
 sed "s/${INPUT_IANA_RULES_VERSION}/${OUTPUT_IANA_RULES_VERSION}/" ${INPUT_TZLOOKUP_FILE} > ${OUTPUT_TZLOOKUP_FILE}
 
-echo Transformed input files with version ${INPUT_IANA_RULES_VERSION} to ${OUTPUT_IANA_RULES_VERSION} in ${DISTRO_OUTPUT_DIR}
+# Copy license files
+cp ${REFERENCE_FILES_DIR}/${TZDATA_LICENSE_FILE} ${TEST_DATA_OUTPUT_DIR}/${TZDATA_LICENSE_FILE}
+cp ${REFERENCE_FILES_DIR}/${ICU_LICENSE_FILE} ${TEST_DATA_OUTPUT_DIR}/${ICU_LICENSE_FILE}
+
+echo Transformed input files with version ${INPUT_IANA_RULES_VERSION} to ${OUTPUT_IANA_RULES_VERSION} in ${TEST_DATA_OUTPUT_DIR}
 
diff --git a/testing/src/main/java/libcore/tzdata/testing/ZoneInfoTestHelper.java b/testing/src/main/java/libcore/timezone/testing/ZoneInfoTestHelper.java
similarity index 62%
rename from testing/src/main/java/libcore/tzdata/testing/ZoneInfoTestHelper.java
rename to testing/src/main/java/libcore/timezone/testing/ZoneInfoTestHelper.java
index 75ddc66..224b193 100644
--- a/testing/src/main/java/libcore/tzdata/testing/ZoneInfoTestHelper.java
+++ b/testing/src/main/java/libcore/timezone/testing/ZoneInfoTestHelper.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package libcore.tzdata.testing;
+package libcore.timezone.testing;
 
 import java.io.ByteArrayOutputStream;
 import java.nio.ByteBuffer;
@@ -36,10 +36,8 @@
     public static class ZicDataBuilder {
 
         private int magic = 0x545a6966; // Default, valid magic.
-        private Integer transitionCountOverride; // Used to override the correct transition count.
-        private int[] transitionTimes; // Time of each transition, one per transition.
-        private byte[] transitionTypes; // Type of each transition, one per transition.
-        private Integer typesCountOverride; // Used to override the correct type count.
+        private long[] transitionTimes64Bit; // Time of each transition, one per transition.
+        private byte[] transitionTypes64Bit; // Type of each transition, one per transition.
         private int[] isDsts; // Whether a type uses DST, one per type.
         private int[] offsetsSeconds; // The UTC offset, one per type.
 
@@ -50,42 +48,32 @@
             return this;
         }
 
-        public ZicDataBuilder setTypeCountOverride(int typesCountOverride) {
-            this.typesCountOverride = typesCountOverride;
-            return this;
-        }
-
-        public ZicDataBuilder setTransitionCountOverride(int transitionCountOverride) {
-            this.transitionCountOverride = transitionCountOverride;
-            return this;
-        }
-
         /**
-         * See {@link #setTransitions(int[][])} and {@link #setTypes(int[][])}.
+         * See {@link #setTransitions(long[][])} and {@link #setTypes(int[][])}.
          */
         public ZicDataBuilder setTransitionsAndTypes(
-                int[][] transitionPairs, int[][] typePairs) {
+                long[][] transitionPairs, int[][] typePairs) {
             setTransitions(transitionPairs);
             setTypes(typePairs);
             return this;
         }
         /**
-         * Sets transition information using an array of pairs of ints. e.g.
+         * Sets transition information using an array of pairs of longs. e.g.
          *
-         * new int[][] {
+         * new long[][] {
          *   { transitionTimeSeconds1, typeIndex1 },
          *   { transitionTimeSeconds2, typeIndex1 },
          * }
          */
-        public ZicDataBuilder setTransitions(int[][] transitionPairs) {
-            int[] transitions = new int[transitionPairs.length];
+        public ZicDataBuilder setTransitions(long[][] transitionPairs) {
+            long[] transitions = new long[transitionPairs.length];
             byte[] types = new byte[transitionPairs.length];
             for (int i = 0; i < transitionPairs.length; i++) {
                 transitions[i] = transitionPairs[i][0];
                 types[i] = (byte) transitionPairs[i][1];
             }
-            this.transitionTimes = transitions;
-            this.transitionTypes = types;
+            this.transitionTimes64Bit = transitions;
+            this.transitionTypes64Bit = types;
             return this;
         }
 
@@ -93,8 +81,8 @@
          * Sets transition information using an array of pairs of ints. e.g.
          *
          * new int[][] {
-         *   { typeIsDst1, offsetSeconds1 },
-         *   { typeIsDst2, offsetSeconds2 },
+         *   { offsetSeconds1, typeIsDst1 },
+         *   { offsetSeconds2, typeIsDst2 },
          * }
          */
         public ZicDataBuilder setTypes(int[][] typePairs) {
@@ -111,7 +99,7 @@
 
         /** Initializes to a minimum viable ZoneInfo data. */
         public ZicDataBuilder initializeToValid() {
-            setTransitions(new int[0][0]);
+            setTransitions(new long[0][0]);
             setTypes(new int[][] {
                     { 3600, 0}
             });
@@ -121,40 +109,106 @@
         public byte[] build() {
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
-            // Magic number.
-            writeInt(baos, magic);
-
-            // Some useless stuff in the header.
-            for (int i = 0; i < 28; ++i) {
-                baos.write(i);
+            // Compute the 32-bit transitions / types.
+            List<Integer> transitionTimes32Bit = new ArrayList<>();
+            List<Byte> transitionTypes32Bit = new ArrayList<>();
+            if (transitionTimes64Bit.length > 0) {
+                // Skip transitions < Integer.MIN_VALUE.
+                int i = 0;
+                while (i < transitionTimes64Bit.length
+                        && transitionTimes64Bit[i] < Integer.MIN_VALUE) {
+                    i++;
+                }
+                // If we skipped any, add a transition at Integer.MIN_VALUE like zic does.
+                if (i > 0) {
+                    transitionTimes32Bit.add(Integer.MIN_VALUE);
+                    transitionTypes32Bit.add(transitionTypes64Bit[i - 1]);
+                }
+                // Copy remaining transitions / types that fit in the 32-bit range.
+                while (i < transitionTimes64Bit.length
+                        && transitionTimes64Bit[i] <= Integer.MAX_VALUE) {
+                    transitionTimes32Bit.add((int) transitionTimes64Bit[i]);
+                    transitionTypes32Bit.add(transitionTypes64Bit[i]);
+                    i++;
+                }
             }
 
-            // Transition time count
-            int transitionsCount = transitionCountOverride != null
-                    ? transitionCountOverride : transitionTimes.length;
-            writeInt(baos, transitionsCount);
+            int tzh_timecnt_32 = transitionTimes32Bit.size();
+            int tzh_timecnt_64 = transitionTimes64Bit.length;
+            int tzh_typecnt = offsetsSeconds.length;
+            int tzh_charcnt = 0;
+            int tzh_leapcnt = 0;
+            int tzh_ttisstdcnt = 0;
+            int tzh_ttisgmtcnt = 0;
 
-            // Transition type count.
-            int typesCount = typesCountOverride != null
-                    ? typesCountOverride : offsetsSeconds.length;
-            writeInt(baos, typesCount);
-            // Useless stuff.
-            writeInt(baos, 0xdeadbeef);
+            // Write 32-bit data.
+            writeHeader(baos, magic, tzh_timecnt_32, tzh_typecnt, tzh_charcnt, tzh_leapcnt,
+                    tzh_ttisstdcnt, tzh_ttisgmtcnt);
+            writeIntList(baos, transitionTimes32Bit);
+            writeByteList(baos, transitionTypes32Bit);
+            writeTypes(baos, offsetsSeconds, isDsts);
+            writeTrailingUnusued32BitData(baos, tzh_charcnt, tzh_leapcnt, tzh_ttisstdcnt,
+                    tzh_ttisgmtcnt);
 
-            // Transition time array, as ints.
-            writeIntArray(baos, transitionTimes);
+            // 64-bit data.
+            writeHeader(baos, magic, tzh_timecnt_64, tzh_typecnt, tzh_charcnt, tzh_leapcnt,
+                    tzh_ttisstdcnt, tzh_ttisgmtcnt);
+            writeLongArray(baos, transitionTimes64Bit);
+            writeByteArray(baos, transitionTypes64Bit);
+            writeTypes(baos, offsetsSeconds, isDsts);
 
-            // Transition type array.
-            writeByteArray(baos, transitionTypes);
+            return baos.toByteArray();
+        }
 
+        private static void writeTypes(
+                ByteArrayOutputStream baos, int[] offsetsSeconds, int[] isDsts) {
             // Offset / DST
             for (int i = 0; i < offsetsSeconds.length; i++) {
                 writeInt(baos, offsetsSeconds[i]);
                 writeByte(baos, isDsts[i]);
-                // Useless stuff.
-                writeByte(baos, i);
+                // Unused data on Android (abbreviation list index).
+                writeByte(baos, 0);
             }
-            return baos.toByteArray();
+        }
+
+        /**
+         * Writes the data after types information Android doesn't currently use but is needed so
+         * that the start of the 64-bit data can be found.
+         */
+        private static void writeTrailingUnusued32BitData(
+                ByteArrayOutputStream baos, int tzh_charcnt, int tzh_leapcnt,
+                int tzh_ttisstdcnt, int tzh_ttisgmtcnt) {
+
+            // Time zone abbreviations text.
+            writeByteArray(baos, new byte[tzh_charcnt]);
+            // tzh_leapcnt repetitions of leap second transition time + correction.
+            int leapInfoSize = 4 + 4;
+            writeByteArray(baos, new byte[tzh_leapcnt * leapInfoSize]);
+            // tzh_ttisstdcnt bytes
+            writeByteArray(baos, new byte[tzh_ttisstdcnt]);
+            // tzh_ttisgmtcnt bytes
+            writeByteArray(baos, new byte[tzh_ttisgmtcnt]);
+        }
+
+        private static void writeHeader(ByteArrayOutputStream baos, int magic, int tzh_timecnt,
+                int tzh_typecnt, int tzh_charcnt, int tzh_leapcnt, int tzh_ttisstdcnt,
+                int tzh_ttisgmtcnt) {
+            // Magic number.
+            writeInt(baos, magic);
+            // tzh_version
+            writeByte(baos, '2');
+
+            // Write out the unused part of the header.
+            for (int i = 0; i < 15; ++i) {
+                baos.write(i);
+            }
+            // Write out the known header fields.
+            writeInt(baos, tzh_ttisgmtcnt);
+            writeInt(baos, tzh_ttisstdcnt);
+            writeInt(baos, tzh_leapcnt);
+            writeInt(baos, tzh_timecnt);
+            writeInt(baos, tzh_typecnt);
+            writeInt(baos, tzh_charcnt);
         }
     }
 
@@ -299,12 +353,24 @@
         baos.write(array, 0, array.length);
     }
 
+    static void writeByteList(ByteArrayOutputStream baos, List<Byte> list) {
+        for (byte value : list) {
+            baos.write(value);
+        }
+    }
+
     static void writeByte(ByteArrayOutputStream baos, int value) {
         baos.write(value);
     }
 
-    static void writeIntArray(ByteArrayOutputStream baos, int[] array) {
-        for (int value : array) {
+    static void writeLongArray(ByteArrayOutputStream baos, long[] array) {
+        for (long value : array) {
+            writeLong(baos, value);
+        }
+    }
+
+    static void writeIntList(ByteArrayOutputStream baos, List<Integer> list) {
+        for (int value : list) {
             writeInt(baos, value);
         }
     }
@@ -314,6 +380,11 @@
         writeByteArray(os, bytes);
     }
 
+    static void writeLong(ByteArrayOutputStream os, long value) {
+        byte[] bytes = ByteBuffer.allocate(8).putLong(value).array();
+        writeByteArray(os, bytes);
+    }
+
     static void setInt(byte[] bytes, int offset, int value) {
         bytes[offset] = (byte) (value >>> 24);
         bytes[offset + 1] = (byte) (value >>> 16);
diff --git a/tzdatacheck/tzdatacheck.cpp b/tzdatacheck/tzdatacheck.cpp
index c41d057..2285219 100644
--- a/tzdatacheck/tzdatacheck.cpp
+++ b/tzdatacheck/tzdatacheck.cpp
@@ -47,53 +47,48 @@
 // See also com.android.timezone.distro.TimeZoneDistro / com.android.timezone.distro.DistroVersion.
 static const char* DISTRO_VERSION_FILENAME = "/distro_version";
 
-// distro_version is an ASCII file consisting of 17 bytes in the form: AAA.BBB|CCCCC|DDD
-// AAA.BBB is the major/minor version of the distro format (e.g. 001.001),
-// CCCCC is the rules version (e.g. 2016g)
-// DDD is the android revision for this rules version to allow for distro corrections (e.g. 001)
-// We only need the first 13 to determine if it is suitable for the device.
-static const int DISTRO_VERSION_LENGTH = 13;
+// The name of the file containing the base tz data set version information.
+// See also libcore.timezone.TzDataSetVersion.
+static const char* BASE_VERSION_FILENAME = "/tz_version";
 
-// The major version of the distro format supported by this code as a null-terminated char[].
-// See also com.android.timezone.distro.TimeZoneDistro / com.android.timezone.distro.DistroVersion.
-static const char SUPPORTED_DISTRO_MAJOR_VERSION[] = "002";
+// distro_version / tz_version are ASCII files consisting of at least 17 bytes in the
+// form: AAA.BBB|CCCCC|DDD
+// AAA.BBB is the major/minor version of the format (e.g. 004.001),
+// CCCCC is the rules version (e.g. 2016g),
+// DDD is the android revision for this rules version to allow for data corrections (e.g. 001),
+// We only use the first 13 to determine suitability of format / data.
+static const int READ_DATA_LENGTH = 13;
 
-// The length of the distro format major version excluding the \0
-static const size_t SUPPORTED_DISTRO_MAJOR_VERSION_LEN = sizeof(SUPPORTED_DISTRO_MAJOR_VERSION) - 1;
+// Version bytes are: AAA.BBB|CCCCC - the format version is AAA.BBB
+// The length of the format version,  e.g. "004.001" == 7 bytes
+static const size_t FORMAT_VERSION_LEN = 7;
 
-// The minor version of the distro format supported by this code as a null-terminated char[].
-// See also com.android.timezone.distro.TimeZoneDistro / com.android.timezone.distro.DistroVersion.
-static const char SUPPORTED_DISTRO_MINOR_VERSION[] = "001";
+// Version bytes are: AAA.BBB|CCCCC - the format major version is AAA
+static const size_t FORMAT_MAJOR_VERSION_LEN = 3;
 
-// The length of the distro format minor version excluding the \0
-static const size_t SUPPORTED_DISTRO_MINOR_VERSION_LEN = sizeof(SUPPORTED_DISTRO_MINOR_VERSION) - 1;
+// Version bytes are: AAA.BBB|CCCCC - the format major version is AAA
+static const size_t FORMAT_MAJOR_VERSION_IDX = 0;
 
-// The length of the distro format version. e.g. 001.001
-static const size_t SUPPORTED_DISTRO_VERSION_LEN =
-        SUPPORTED_DISTRO_MAJOR_VERSION_LEN + SUPPORTED_DISTRO_MINOR_VERSION_LEN + 1;
+// Version bytes are: AAA.BBB|CCCCC - the format major version is AAA
+static const size_t FORMAT_MINOR_VERSION_LEN = 3;
 
-// The length of the IANA rules version bytes. e.g. 2016a
+// Version bytes are: AAA.BBB|CCCCC - the format minor version is BBB
+static const size_t FORMAT_MINOR_VERSION_IDX = 4;
+
+// Version bytes are: AAA.BBB|CCCCC - the IANA rules version is CCCCC
+// The length of the IANA rules version bytes, e.g. 2016a
 static const size_t RULES_VERSION_LEN = 5;
 
-// Distro version bytes are: AAA.BBB|CCCCC - the rules version is CCCCC
-static const size_t DISTRO_VERSION_RULES_IDX = 8;
+// Version bytes are: AAA.BBB|CCCCC - the rules version is CCCCC
+static const size_t VERSION_RULES_IDX = 8;
 
-// See also com.android.timezone.distro.TimeZoneDistro.
-static const char* TZDATA_FILENAME = "/tzdata";
-
-// tzdata file header (as much as we need for the version):
-// byte[11] tzdata_version  -- e.g. "tzdata2012f"
-static const int TZ_HEADER_LENGTH = 11;
-
-static const char TZ_DATA_HEADER_PREFIX[] = "tzdata";
-static const size_t TZ_DATA_HEADER_PREFIX_LEN = sizeof(TZ_DATA_HEADER_PREFIX) - 1; // exclude \0
 
 static void usage() {
-    std::cerr << "Usage: tzdatacheck SYSTEM_TZ_DIR DATA_TZ_DIR\n"
+    std::cerr << "Usage: tzdatacheck BASE_TZ_DIR DATA_TZ_DIR\n"
             "\n"
             "Checks whether any timezone update distro in DATA_TZ_DIR is compatible with the\n"
-            "current Android release and better than or the same as base system timezone rules in\n"
-            "SYSTEM_TZ_DIR. If the timezone rules in SYSTEM_TZ_DIR are a higher version than the\n"
+            "current Android release and better than or the same as base timezone rules in\n"
+            "BASE_TZ_DIR. If the timezone rules in BASE_TZ_DIR are a higher version than the\n"
             "one in DATA_TZ_DIR the DATA_TZ_DIR is renamed and then deleted.\n";
     exit(1);
 }
@@ -120,18 +115,6 @@
     return true;
 }
 
-/*
- * Checks the contents of headerBytes. Returns true if it is valid (starts with "tzdata"), false
- * otherwise.
- */
-static bool checkValidTzDataHeader(const std::string& fileName, const char* headerBytes) {
-    if (strncmp("tzdata", headerBytes, 6) != 0) {
-        LOG(WARNING) << fileName << " does not start with the expected bytes (tzdata)";
-        return false;
-    }
-    return true;
-}
-
 static bool checkDigits(const char* buffer, const size_t count, size_t* i) {
     for (size_t j = 0; j < count; j++) {
       char toCheck = buffer[(*i)++];
@@ -142,8 +125,8 @@
     return true;
 }
 
-static bool checkValidDistroVersion(const char* buffer) {
-    // See DISTRO_VERSION_LENGTH comments above for a description of the format.
+static bool checkValidVersionBytes(const char* buffer) {
+    // See READ_DATA_LENGTH comments above for a description of the format.
     size_t i = 0;
     if (!checkDigits(buffer, 3, &i)) {
       return false;
@@ -288,21 +271,6 @@
 }
 
 /*
- * Deletes the ConfigInstaller metadata directory.
- * TODO(nfuller). http://b/31008728 Remove this when ConfigInstaller is no longer used.
- */
-static void deleteConfigUpdaterMetadataDir(const char* dataZoneInfoDir) {
-    // Delete the update metadata
-    std::string dataUpdatesDirName(dataZoneInfoDir);
-    dataUpdatesDirName += "/updates";
-    LOG(INFO) << "Removing: " << dataUpdatesDirName;
-    if (!deleteDir(dataUpdatesDirName)) {
-        LOG(WARNING) << "Deletion of install metadata " << dataUpdatesDirName
-                << " was not successful";
-    }
-}
-
-/*
  * Deletes the timezone update distro directory.
  */
 static void deleteUpdateDistroDir(const std::string& distroDirName) {
@@ -451,7 +419,7 @@
 }
 
 /*
- * After a platform update it is likely that timezone data found on the system partition will be
+ * After a platform update it is likely that the "base" timezone data found on the device will be
  * newer than the version found in the data partition. This tool detects this case and removes the
  * version in /data.
  *
@@ -459,7 +427,7 @@
  * paths for the metadata and current timezone data must match.
  *
  * Typically on device the two args will be:
- *   /system/usr/share/zoneinfo /data/misc/zoneinfo
+ *   /apex/com.google.runtime/etc/tz /data/misc/zoneinfo
  *
  * See usage() for usage notes.
  */
@@ -469,7 +437,7 @@
         return 1;
     }
 
-    const char* systemZoneInfoDir = argv[1];
+    const char* baseZoneInfoDir = argv[1];
     const char* dataZoneInfoDir = argv[2];
 
     std::string dataStagedDirName(dataZoneInfoDir);
@@ -504,86 +472,84 @@
     std::string distroVersionFileName(dataCurrentDirName);
     distroVersionFileName += DISTRO_VERSION_FILENAME;
     std::vector<char> distroVersion;
-    distroVersion.reserve(DISTRO_VERSION_LENGTH);
+    distroVersion.reserve(READ_DATA_LENGTH);
     bool distroVersionReadOk =
-            readBytes(distroVersionFileName, distroVersion.data(), DISTRO_VERSION_LENGTH);
+            readBytes(distroVersionFileName, distroVersion.data(), READ_DATA_LENGTH);
     if (!distroVersionReadOk) {
         LOG(WARNING) << "distro version file " << distroVersionFileName
                 << " does not exist or is too short. Deleting distro dir.";
         // Implies the contents of the data partition is corrupt in some way. Try to clean up.
-        deleteConfigUpdaterMetadataDir(dataZoneInfoDir);
         deleteUpdateDistroDir(dataCurrentDirName);
         return 3;
     }
 
-    if (!checkValidDistroVersion(distroVersion.data())) {
+    if (!checkValidVersionBytes(distroVersion.data())) {
         LOG(WARNING) << "distro version file " << distroVersionFileName
                 << " is not valid. Deleting distro dir.";
         // Implies the contents of the data partition is corrupt in some way. Try to clean up.
-        deleteConfigUpdaterMetadataDir(dataZoneInfoDir);
         deleteUpdateDistroDir(dataCurrentDirName);
         return 4;
     }
 
-    std::string actualDistroVersion =
-            std::string(distroVersion.data(), SUPPORTED_DISTRO_VERSION_LEN);
-    // Check the first 3 bytes of the distro version: these are the major version (e.g. 001).
+    // Check the base tz data set version.
+    std::string baseVersionFileName(baseZoneInfoDir);
+    baseVersionFileName += BASE_VERSION_FILENAME;
+    std::vector<char> baseVersion;
+    baseVersion.reserve(READ_DATA_LENGTH);
+    bool baseVersionReadOk =
+            readBytes(baseVersionFileName, baseVersion.data(), READ_DATA_LENGTH);
+    if (!baseVersionReadOk) {
+        // Implies the contents of the system partition is corrupt in some way. Nothing we can do.
+        LOG(WARNING) << baseVersionFileName << " does not exist or could not be opened";
+        return 6;
+    }
+
+    if (!checkValidVersionBytes(baseVersion.data())) {
+        // Implies the contents of the system partition is corrupt in some way. Nothing we can do.
+        LOG(WARNING) << baseVersionFileName << " is not valid.";
+        return 7;
+    }
+
+    std::string actualDistroVersion = std::string(distroVersion.data(), FORMAT_VERSION_LEN);
+    std::string baseTzVersion = std::string(baseVersion.data(), FORMAT_VERSION_LEN);
+
+    // Check the first 3 bytes of the format version: these are the major version (e.g. 001).
     // It must match the one we support exactly to be ok.
     if (strncmp(
-            &distroVersion[0],
-            SUPPORTED_DISTRO_MAJOR_VERSION,
-            SUPPORTED_DISTRO_MAJOR_VERSION_LEN) != 0) {
+            &distroVersion[FORMAT_MAJOR_VERSION_IDX],
+            &baseTzVersion[FORMAT_MAJOR_VERSION_IDX],
+            FORMAT_MAJOR_VERSION_LEN) != 0) {
 
         LOG(INFO) << "distro version file " << distroVersionFileName
-                << " major version is not the required version " << SUPPORTED_DISTRO_MAJOR_VERSION
+                << " major version is not the required version " << baseTzVersion
                 << ", was \"" << actualDistroVersion << "\". Deleting distro dir.";
-        // This implies there has been an OTA and the installed distro is not compatible with the
+        // This implies there has been an OTA and the installed distro is not compatible with a
         // new version of Android. Remove the installed distro.
-        deleteConfigUpdaterMetadataDir(dataZoneInfoDir);
         deleteUpdateDistroDir(dataCurrentDirName);
         return 5;
     }
 
-    // Check the last 3 bytes of the distro version: these are the minor version (e.g. 001).
+    // Check the last 3 bytes of the format version: these are the minor version (e.g. 001).
     // If the version in the distro is < the minor version required by this device it cannot be
     // used.
     if (strncmp(
-            &distroVersion[4],
-            SUPPORTED_DISTRO_MINOR_VERSION,
-            SUPPORTED_DISTRO_MINOR_VERSION_LEN) < 0) {
+            &distroVersion[FORMAT_MINOR_VERSION_IDX],
+            &baseTzVersion[FORMAT_MINOR_VERSION_IDX],
+            FORMAT_MINOR_VERSION_LEN) < 0) {
 
         LOG(INFO) << "distro version file " << distroVersionFileName
-                << " minor version is not the required version " << SUPPORTED_DISTRO_MINOR_VERSION
+                << " minor version is not the required version " << baseTzVersion
                 << ", was \"" << actualDistroVersion << "\". Deleting distro dir.";
-        // This implies there has been an OTA and the installed distro is not compatible with the
+        // This implies there has been an OTA and the installed distro is not compatible with a
         // new version of Android. Remove the installed distro.
-        deleteConfigUpdaterMetadataDir(dataZoneInfoDir);
         deleteUpdateDistroDir(dataCurrentDirName);
         return 5;
     }
 
-    // Read the system rules version out of the /system tzdata file.
-    std::string systemTzDataFileName(systemZoneInfoDir);
-    systemTzDataFileName += TZDATA_FILENAME;
-    std::vector<char> systemTzDataHeader;
-    systemTzDataHeader.reserve(TZ_HEADER_LENGTH);
-    bool systemFileExists =
-            readBytes(systemTzDataFileName, systemTzDataHeader.data(), TZ_HEADER_LENGTH);
-    if (!systemFileExists) {
-        // Implies the contents of the system partition is corrupt in some way. Nothing we can do.
-        LOG(WARNING) << systemTzDataFileName << " does not exist or could not be opened";
-        return 6;
-    }
-    if (!checkValidTzDataHeader(systemTzDataFileName, systemTzDataHeader.data())) {
-        // Implies the contents of the system partition is corrupt in some way. Nothing we can do.
-        LOG(WARNING) << systemTzDataFileName << " does not have a valid header.";
-        return 7;
-    }
-
     // Compare the distro rules version against the system rules version.
     if (strncmp(
-            &systemTzDataHeader[TZ_DATA_HEADER_PREFIX_LEN],
-            &distroVersion[DISTRO_VERSION_RULES_IDX],
+            &baseVersion[VERSION_RULES_IDX],
+            &distroVersion[VERSION_RULES_IDX],
             RULES_VERSION_LEN) <= 0) {
         LOG(INFO) << "Found an installed distro but it is valid. No action taken.";
         // Implies there is an installed update, but it is good.
@@ -593,9 +559,8 @@
     // Implies there has been an OTA and the system version of the timezone rules is now newer
     // than the version installed in /data. Remove the installed distro.
     LOG(INFO) << "timezone distro in " << dataCurrentDirName << " is older than data in "
-            << systemTzDataFileName << "; fixing...";
+            << baseVersionFileName << "; fixing...";
 
-    deleteConfigUpdaterMetadataDir(dataZoneInfoDir);
     deleteUpdateDistroDir(dataCurrentDirName);
     return 0;
 }
diff --git a/tzdatautil.py b/tzdatautil.py
index 839a9f4..3f82227 100644
--- a/tzdatautil.py
+++ b/tzdatautil.py
@@ -12,15 +12,17 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from __future__ import print_function
+
 import os
 import sys
 
 """Shared functions for use in tzdata scripts."""
 
-def GetIanaTarFile(dir_name, file_type):
+def GetIanaTarFile(dir_name, file_prefix):
   matching_files = []
   for filename in os.listdir(dir_name):
-    if filename.startswith('tz%s20' % file_type) and filename.endswith('.tar.gz'):
+    if filename.startswith(file_prefix) and filename.endswith('.tar.gz'):
       matching_files.append(filename);
 
   if len(matching_files) == 0:
@@ -28,6 +30,6 @@
   elif len(matching_files) == 1:
     return '%s/%s' % (dir_name, matching_files[0])
   else:
-    print 'Multiple tz%s files found unexpectedly %s' % (file_type, matching_files)
+    print('Multiple %s files found unexpectedly %s' % (file_prefix, matching_files))
     sys.exit(1)
 
diff --git a/tzlookup_generator/Android.bp b/tzlookup_generator/Android.bp
new file mode 100644
index 0000000..a05979f
--- /dev/null
+++ b/tzlookup_generator/Android.bp
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Proto library
+java_library_host {
+    name: "countryzonesprotos",
+    proto: {
+        type: "full",
+        include_dirs: ["external/protobuf/src"],
+    },
+
+    srcs: ["src/main/proto/**/*.proto"],
+}
+
+// The tzlookup_generator host tool.
+java_binary_host {
+    name: "tzlookup_generator",
+
+    manifest: "src/main/manifest/MANIFEST.mf",
+    srcs: ["src/main/java/**/*.java"],
+    javacflags: [
+        "-encoding UTF-8",
+    ],
+    static_libs: [
+        "icu4j",
+        "countryzonesprotos",
+        "libprotobuf-java-full",
+    ],
+}
diff --git a/tzlookup_generator/Android.mk b/tzlookup_generator/Android.mk
deleted file mode 100644
index e70efb2..0000000
--- a/tzlookup_generator/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH:= $(call my-dir)
-
-# Proto library
-include $(CLEAR_VARS)
-LOCAL_MODULE := countryzonesprotos
-LOCAL_PROTOC_OPTIMIZE_TYPE := full
-LOCAL_PROTOC_FLAGS := -Iexternal/protobuf/src
-LOCAL_SOURCE_FILES_ALL_GENERATED := true
-LOCAL_SRC_FILES := $(call all-proto-files-under, src/main/proto)
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# A static library for the tzlookup_generator host tool.
-# The tool can be run with java -jar tzlookup_generator.jar
-include $(CLEAR_VARS)
-LOCAL_MODULE := tzlookup_generator
-LOCAL_MODULE_TAGS := optional
-LOCAL_JAR_MANIFEST := src/main/manifest/MANIFEST.mf
-LOCAL_SRC_FILES := $(call all-java-files-under, src/main/java)
-LOCAL_JAVACFLAGS := -encoding UTF-8
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    icu4j-host \
-    countryzonesprotos \
-    libprotobuf-java-full
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/update-tzdata.py b/update-tzdata.py
index 20986c7..71618fd 100755
--- a/update-tzdata.py
+++ b/update-tzdata.py
@@ -16,6 +16,8 @@
 
 """Generates the timezone data files used by Android."""
 
+from __future__ import print_function
+
 import glob
 import os
 import re
@@ -37,8 +39,8 @@
 
 android_host_out = i18nutil.GetAndroidHostOutOrDie()
 
-zone_compactor_dir = os.path.realpath('%s/system/timezone/zone_compactor' % android_build_top)
-i18nutil.CheckDirExists(timezone_dir, 'system/timezone/zone_zompactor')
+zone_compactor_dir = os.path.realpath('%s/system/timezone/input_tools/android' % android_build_top)
+i18nutil.CheckDirExists(zone_compactor_dir, 'system/timezone/input_tools/android')
 
 timezone_input_tools_dir = os.path.realpath('%s/input_tools' % timezone_dir)
 timezone_input_data_dir = os.path.realpath('%s/input_data' % timezone_dir)
@@ -58,7 +60,7 @@
 
   zic_input_file = '%s/%s' % (extracted_iana_data_dir, zic_input_file_name)
   if not os.path.exists(zic_input_file):
-    print 'Could not find %s' % zic_input_file
+    print('Could not find %s' % zic_input_file)
     sys.exit(1)
   return zic_input_file
 
@@ -96,10 +98,15 @@
   # Create ICU system image files.
   icuutil.MakeAndCopyIcuDataFiles(icu_build_dir)
 
+  icu_overlay_dir = '%s/icu_overlay' % timezone_output_data_dir
+
   # Create the ICU overlay time zone file.
-  icu_overlay_dat_file = '%s/icu_overlay/icu_tzdata.dat' % timezone_output_data_dir
+  icu_overlay_dat_file = '%s/icu_tzdata.dat' % icu_overlay_dir
   icuutil.MakeAndCopyOverlayTzIcuData(icu_build_dir, icu_overlay_dat_file)
 
+  # Copy ICU license file(s)
+  icuutil.CopyLicenseFiles(icu_overlay_dir)
+
 
 def GetIanaVersion(iana_tar_file):
   iana_tar_filename = os.path.basename(iana_tar_file)
@@ -108,7 +115,7 @@
 
 
 def ExtractTarFile(tar_file, dir):
-  print 'Extracting %s...' % tar_file
+  print('Extracting %s...' % tar_file)
   if not os.path.exists(dir):
     os.mkdir(dir)
   tar = tarfile.open(tar_file, 'r')
@@ -116,36 +123,36 @@
 
 
 def BuildZic(iana_tools_dir):
-  iana_zic_code_tar_file = tzdatautil.GetIanaTarFile(iana_tools_dir, 'code')
+  iana_zic_code_tar_file = tzdatautil.GetIanaTarFile(iana_tools_dir, 'tzcode')
   iana_zic_code_version = GetIanaVersion(iana_zic_code_tar_file)
-  iana_zic_data_tar_file = tzdatautil.GetIanaTarFile(iana_tools_dir, 'data')
+  iana_zic_data_tar_file = tzdatautil.GetIanaTarFile(iana_tools_dir, 'tzdata')
   iana_zic_data_version = GetIanaVersion(iana_zic_data_tar_file)
 
-  print 'Found IANA zic release %s/%s in %s/%s ...' \
-      % (iana_zic_code_version, iana_zic_data_version, iana_zic_code_tar_file, iana_zic_data_tar_file)
+  print('Found IANA zic release %s/%s in %s/%s ...' \
+      % (iana_zic_code_version, iana_zic_data_version, iana_zic_code_tar_file, iana_zic_data_tar_file))
 
   zic_build_dir = '%s/zic' % tmp_dir
   ExtractTarFile(iana_zic_code_tar_file, zic_build_dir)
   ExtractTarFile(iana_zic_data_tar_file, zic_build_dir)
 
   # zic
-  print 'Building zic...'
+  print('Building zic...')
   # VERSION_DEPS= is to stop the build process looking for files that might not
   # be present across different versions.
   subprocess.check_call(['make', '-C', zic_build_dir, 'zic'])
 
   zic_binary_file = '%s/zic' % zic_build_dir
   if not os.path.exists(zic_binary_file):
-    print 'Could not find %s' % zic_binary_file
+    print('Could not find %s' % zic_binary_file)
     sys.exit(1)
   return zic_binary_file
 
 
 def BuildTzdata(zic_binary_file, extracted_iana_data_dir, iana_data_version):
-  print 'Generating zic input file...'
+  print('Generating zic input file...')
   zic_input_file = GenerateZicInputFile(extracted_iana_data_dir)
 
-  print 'Calling zic...'
+  print('Calling zic...')
   zic_output_dir = '%s/data' % tmp_dir
   os.mkdir(zic_output_dir)
   zic_cmd = [zic_binary_file, '-d', zic_output_dir, zic_input_file]
@@ -154,7 +161,7 @@
   # ZoneCompactor
   zone_compactor_setup_file = WriteSetupFile(zic_input_file)
 
-  print 'Calling ZoneCompactor to update tzdata to %s...' % iana_data_version
+  print('Calling ZoneCompactor to update tzdata to %s...' % iana_data_version)
   subprocess.check_call(['make', '-C', android_build_top, '-j30', 'zone_compactor'])
 
   # Create args for ZoneCompactor
@@ -162,7 +169,7 @@
   jar_file = '%s/framework/zone_compactor.jar' % android_host_out
   header_string = 'tzdata%s' % iana_data_version
 
-  print 'Executing ZoneCompactor...'
+  print('Executing ZoneCompactor...')
   iana_output_data_dir = '%s/iana' % timezone_output_data_dir
   subprocess.check_call(['java', '-jar', jar_file,
                          zone_compactor_setup_file, zic_output_dir, zone_tab_file,
@@ -173,7 +180,7 @@
   countryzones_source_file = '%s/android/countryzones.txt' % timezone_input_data_dir
   tzlookup_dest_file = '%s/android/tzlookup.xml' % timezone_output_data_dir
 
-  print 'Calling TzLookupGenerator to create tzlookup.xml...'
+  print('Calling TzLookupGenerator to create tzlookup.xml...')
   subprocess.check_call(['make', '-C', android_build_top, '-j30', 'tzlookup_generator'])
 
   jar_file = '%s/framework/tzlookup_generator.jar' % android_host_out
@@ -182,21 +189,17 @@
                          countryzones_source_file, zone_tab_file, tzlookup_dest_file])
 
 
-def CreateDistroFiles(iana_data_version, output_dir):
+def CreateDistroFiles(iana_data_version, output_distro_dir, output_version_file):
   create_distro_script = '%s/distro/tools/create-distro.py' % timezone_dir
 
   tzdata_file = '%s/iana/tzdata' % timezone_output_data_dir
   icu_file = '%s/icu_overlay/icu_tzdata.dat' % timezone_output_data_dir
   tzlookup_file = '%s/android/tzlookup.xml' % timezone_output_data_dir
 
-  distro_file_pattern = '%s/*.zip' % output_dir
-  existing_distro_files = glob.glob(distro_file_pattern)
+  distro_file_pattern = '%s/*.zip' % output_distro_dir
+  existing_files = glob.glob(distro_file_pattern)
 
-  distro_file_metadata_pattern = '%s/*.txt' % output_dir
-  existing_distro_metadata_files = glob.glob(distro_file_metadata_pattern)
-  existing_files = existing_distro_files + existing_distro_metadata_files
-
-  print 'Removing %s' % existing_files
+  print('Removing %s' % existing_files)
   for existing_file in existing_files:
     os.remove(existing_file)
 
@@ -205,7 +208,8 @@
       '-tzdata', tzdata_file,
       '-icu', icu_file,
       '-tzlookup', tzlookup_file,
-      '-output', output_dir])
+      '-output_distro_dir', output_distro_dir,
+      '-output_version_file', output_version_file])
 
 def UpdateTestFiles():
   testing_data_dir = '%s/testing/data' % timezone_dir
@@ -216,17 +220,17 @@
 # Run with no arguments from any directory, with no special setup required.
 # See http://www.iana.org/time-zones/ for more about the source of this data.
 def main():
-  print 'Source data file structure: %s' % timezone_input_data_dir
-  print 'Source tools file structure: %s' % timezone_input_tools_dir
-  print 'Output data file structure: %s' % timezone_output_data_dir
+  print('Source data file structure: %s' % timezone_input_data_dir)
+  print('Source tools file structure: %s' % timezone_input_tools_dir)
+  print('Output data file structure: %s' % timezone_output_data_dir)
 
   iana_input_data_dir = '%s/iana' % timezone_input_data_dir
-  iana_data_tar_file = tzdatautil.GetIanaTarFile(iana_input_data_dir, 'data')
+  iana_data_tar_file = tzdatautil.GetIanaTarFile(iana_input_data_dir, 'tzdata')
   iana_data_version = GetIanaVersion(iana_data_tar_file)
-  print 'IANA time zone data release %s in %s ...' % (iana_data_version, iana_data_tar_file)
+  print('IANA time zone data release %s in %s ...' % (iana_data_version, iana_data_tar_file))
 
   icu_dir = icuutil.icuDir()
-  print 'Found icu in %s ...' % icu_dir
+  print('Found icu in %s ...' % icu_dir)
 
   BuildIcuData(iana_data_tar_file)
 
@@ -238,14 +242,15 @@
   BuildTzdata(zic_binary_file, iana_data_dir, iana_data_version)
   BuildTzlookup(iana_data_dir)
 
-  # Create a distro file from the output from prior stages.
-  distro_output_dir = '%s/distro' % timezone_output_data_dir
-  CreateDistroFiles(iana_data_version, distro_output_dir)
+  # Create a distro file and version file from the output from prior stages.
+  output_distro_dir = '%s/distro' % timezone_output_data_dir
+  output_version_file = '%s/version/tz_version' % timezone_output_data_dir
+  CreateDistroFiles(iana_data_version, output_distro_dir, output_version_file)
 
   # Update test versions of distro files too.
   UpdateTestFiles()
 
-  print 'Look in %s and %s for new files' % (timezone_output_data_dir, icu_dir)
+  print('Look in %s and %s for new files' % (timezone_output_data_dir, icu_dir))
   sys.exit(0)