Track changes to CountryTimeZones API
Track changes to CountryTimeZones.lookupByOffsetWithBias()
API: the method now takes an extra argument: dstOffsetMillis,
which is unused in this case.
This commit also improves the parameter names to be more descriptive.
Bug: 139091367
Test: treehugger
Change-Id: I2090965640bb389ea41bde460f380f9ea8a6b176
diff --git a/core/java/android/util/TimeUtils.java b/core/java/android/util/TimeUtils.java
index 07cecd3..74cff20 100644
--- a/core/java/android/util/TimeUtils.java
+++ b/core/java/android/util/TimeUtils.java
@@ -67,20 +67,19 @@
* 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;
}