Replace 3 @CorePlatformApi usages into single API validateTzData()
Bug: 139480281
Test: CtsLibcoreTestCases
Change-Id: I721d24ed9a55b00e34c9fd62c244405c0ae02954
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.