commit | 50a6cc106160d04358d445fc446e1bac7d02d206 | [log] [tgz] |
---|---|---|
author | Victor Chang <vichang@google.com> | Thu Nov 12 16:37:03 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Nov 12 16:37:03 2020 +0000 |
tree | 581768733796694d0ce049eac3bcbbc17b84b4aa | |
parent | bf3146315bdf8d773e910a8592d3237521e891a0 [diff] | |
parent | dcbbd246269f0bf917977f187f83ef46d58f9b48 [diff] |
Replace 3 @CorePlatformApi usages into single API validateTzData() am: dcbbd24626 Original change: https://android-review.googlesource.com/c/platform/system/timezone/+/1494437 Change-Id: I3f44f077deaf4365bddb92d7f314f29561d90bec
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.