Merge "Track changes to CountryTimeZones API" am: 28b12c347c am: c30eabfadb

am: f19b9eecde

Change-Id: I96fdbd696a037fb34d0ea92dce9934c69107ad64
This commit is contained in:
Neil Fuller
2019-09-11 04:39:56 -07:00
committed by android-build-merger

View File

@@ -67,20 +67,19 @@ public class TimeUtils {
* found.
*/
private static android.icu.util.TimeZone getIcuTimeZone(
int offset, boolean dst, long when, String country) {
if (country == null) {
int offsetMillis, boolean isDst, long whenMillis, String countryIso) {
if (countryIso == null) {
return null;
}
android.icu.util.TimeZone bias = android.icu.util.TimeZone.getDefault();
CountryTimeZones countryTimeZones =
TimeZoneFinder.getInstance().lookupCountryTimeZones(country);
TimeZoneFinder.getInstance().lookupCountryTimeZones(countryIso);
if (countryTimeZones == null) {
return null;
}
CountryTimeZones.OffsetResult offsetResult =
countryTimeZones.lookupByOffsetWithBias(offset, dst, when, bias);
CountryTimeZones.OffsetResult offsetResult = countryTimeZones.lookupByOffsetWithBias(
offsetMillis, isDst, null /* dstOffsetMillis */, whenMillis, bias);
return offsetResult != null ? offsetResult.mTimeZone : null;
}