Merge "Track changes to CountryTimeZones API"
am: 28b12c347c
Change-Id: I77e9c737ca92493942aa3d96a663251b954e7c07
This commit is contained in:
@@ -67,20 +67,19 @@ public class TimeUtils {
|
|||||||
* found.
|
* found.
|
||||||
*/
|
*/
|
||||||
private static android.icu.util.TimeZone getIcuTimeZone(
|
private static android.icu.util.TimeZone getIcuTimeZone(
|
||||||
int offset, boolean dst, long when, String country) {
|
int offsetMillis, boolean isDst, long whenMillis, String countryIso) {
|
||||||
if (country == null) {
|
if (countryIso == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
android.icu.util.TimeZone bias = android.icu.util.TimeZone.getDefault();
|
android.icu.util.TimeZone bias = android.icu.util.TimeZone.getDefault();
|
||||||
CountryTimeZones countryTimeZones =
|
CountryTimeZones countryTimeZones =
|
||||||
TimeZoneFinder.getInstance().lookupCountryTimeZones(country);
|
TimeZoneFinder.getInstance().lookupCountryTimeZones(countryIso);
|
||||||
if (countryTimeZones == null) {
|
if (countryTimeZones == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
CountryTimeZones.OffsetResult offsetResult = countryTimeZones.lookupByOffsetWithBias(
|
||||||
CountryTimeZones.OffsetResult offsetResult =
|
offsetMillis, isDst, null /* dstOffsetMillis */, whenMillis, bias);
|
||||||
countryTimeZones.lookupByOffsetWithBias(offset, dst, when, bias);
|
|
||||||
return offsetResult != null ? offsetResult.mTimeZone : null;
|
return offsetResult != null ? offsetResult.mTimeZone : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user