Merge "Change tzdatacheck to avoid hardcoding"
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 9c2c231..bc7f87e 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
@@ -32,7 +32,7 @@
 import libcore.timezone.TzDataSetVersion;
 import libcore.timezone.TzDataSetVersion.TzDataSetException;
 import libcore.timezone.TimeZoneFinder;
-import libcore.util.ZoneInfoDB;
+import libcore.timezone.ZoneInfoDB;
 
 /**
  * A distro-validation / extraction class. Separate from the services code that uses it for easier
@@ -197,7 +197,7 @@
                 return INSTALL_FAIL_BAD_DISTRO_STRUCTURE;
             }
 
-            if (!checkDistroRulesNewerThanSystem(systemTzDataFile, distroTzDataSetVersion)) {
+            if (!checkDistroRulesNewerThanSystem(systemTzDataFile, distroVersion)) {
                 Slog.i(logTag, "Update not applied: Distro rules version check failed");
                 return INSTALL_FAIL_RULES_TOO_OLD;
             }
@@ -398,7 +398,7 @@
      * Returns true if the the distro IANA rules version is >= system IANA rules version.
      */
     private boolean checkDistroRulesNewerThanSystem(
-            File systemTzDataFile, TzDataSetVersion distroVersion) throws IOException {
+            File systemTzDataFile, 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.
diff --git a/output_data/version/Android.mk b/output_data/version/Android.mk
new file mode 100644
index 0000000..cd0659b
--- /dev/null
+++ b/output_data/version/Android.mk
@@ -0,0 +1,41 @@
+# -*- 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 $(CLEAR_VARS)
+LOCAL_MODULE := tz_version
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_PATH := $(TARGET_OUT)/usr/share/zoneinfo
+include $(BUILD_PREBUILT)
+
+ifeq ($(WITH_HOST_DALVIK),true)
+
+# A host version of the tz_version module for use by
+# hostdex rules.
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := tz_version
+LOCAL_IS_HOST_MODULE := true
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_STEM := $(LOCAL_SRC_FILES)
+LOCAL_MODULE_PATH := $(HOST_OUT)/usr/share/zoneinfo
+include $(BUILD_PREBUILT)
+
+endif