commit | 2fbef589f783b9f57fb18fccd188ab68472836cb | [log] [tgz] |
---|---|---|
author | Victor Chang <vichang@google.com> | Thu Nov 12 17:05:23 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Nov 12 17:05:23 2020 +0000 |
tree | 841856ef48f4cda70785ec28f7ee62038f55982c | |
parent | 324e3e42eacde9769dbd4074ff4651fdcc0e28c4 [diff] | |
parent | 50a6cc106160d04358d445fc446e1bac7d02d206 [diff] |
Replace 3 @CorePlatformApi usages into single API validateTzData() am: dcbbd24626 am: 50a6cc1061 Original change: https://android-review.googlesource.com/c/platform/system/timezone/+/1494437 Change-Id: Idf98a667f60be8d338f3268372094f2af653d42e
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 b97015d..dbeeb07 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
@@ -209,18 +209,11 @@ // Validate the tzdata file. File zoneInfoFile = new File(workingDir, TimeZoneDistro.TZDATA_FILE_NAME); - ZoneInfoDb tzData = ZoneInfoDb.loadTzData(zoneInfoFile.getPath()); - if (tzData == null) { - Slog.i(logTag, "Update not applied: " + zoneInfoFile + " could not be loaded"); - return INSTALL_FAIL_VALIDATION_ERROR; - } try { - tzData.validate(); + ZoneInfoDb.validateTzData(zoneInfoFile.getPath()); } catch (IOException e) { Slog.i(logTag, "Update not applied: " + zoneInfoFile + " failed validation", e); return INSTALL_FAIL_VALIDATION_ERROR; - } finally { - tzData.close(); } // Validate the tzlookup.xml file.