summaryrefslogtreecommitdiff
path: root/android_icu4j
diff options
context:
space:
mode:
authorVictor Chang <vichang@google.com>2021-03-10 11:16:33 +0000
committerVictor Chang <vichang@google.com>2021-03-10 17:44:25 +0000
commit204df6e9c2eb8be3ad272bf70fb5c46b091b3703 (patch)
treeaf8262b8d110e33ebf7e84ba4542e3009f8bcb77 /android_icu4j
parent1a411df3c4236d7b10ee2757f3859fadc2f6b434 (diff)
downloadicu-204df6e9c2eb8be3ad272bf70fb5c46b091b3703.tar.gz
Replace ZoneInfoData#getLatestDstSavings with ZoneInfoData#getLatestDstSavingsMillis
Bug: 181661755 Test: m droid Change-Id: I760e3f031c80afb7f61d679b2a90517e7b24cfd8
Diffstat (limited to 'android_icu4j')
-rw-r--r--android_icu4j/api/intra/current.txt1
-rw-r--r--android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/ZoneInfoData.java14
-rw-r--r--android_icu4j/testing/src/com/android/i18n/test/timezone/ZoneInfoDataTest.java7
3 files changed, 4 insertions, 18 deletions
diff --git a/android_icu4j/api/intra/current.txt b/android_icu4j/api/intra/current.txt
index 8000f7a77..d3cc4cc87 100644
--- a/android_icu4j/api/intra/current.txt
+++ b/android_icu4j/api/intra/current.txt
@@ -19,7 +19,6 @@ package com.android.i18n.timezone {
method @NonNull public static com.android.i18n.timezone.ZoneInfoData createFromSerializationFields(@NonNull String, @NonNull java.io.ObjectInputStream.GetField) throws java.io.IOException;
method @NonNull public static com.android.i18n.timezone.ZoneInfoData createInstance(@NonNull String, @NonNull long[], @NonNull byte[], @NonNull int[], @NonNull boolean[]);
method @NonNull public String getID();
- method @Nullable public Integer getLatestDstSavings(long);
method @Nullable public Integer getLatestDstSavingsMillis(long);
method public int getOffset(long);
method public int getOffsetsByUtcTime(long, @NonNull int[]);
diff --git a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/ZoneInfoData.java b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/ZoneInfoData.java
index d1f50d9ff..92c0c437f 100644
--- a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/ZoneInfoData.java
+++ b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/ZoneInfoData.java
@@ -682,20 +682,6 @@ public final class ZoneInfoData {
* @hide
*/
@libcore.api.IntraCoreApi
- public @Nullable Integer getLatestDstSavings(long when) {
- return getLatestDstSavingsMillis(when);
- }
-
- /**
- * Returns the offset of daylight saving in milliseconds in the latest Daylight Savings Time
- * after the time {@code when}. If no known DST occurs after {@code when}, it returns
- * {@code null}.
- *
- * @param when the number of milliseconds since January 1, 1970, 00:00:00 GMT
- *
- * @hide
- */
- @libcore.api.IntraCoreApi
public @Nullable Integer getLatestDstSavingsMillis(long when) {
// Find the latest daylight and standard offsets (if any).
int lastStdTransitionIndex = -1;
diff --git a/android_icu4j/testing/src/com/android/i18n/test/timezone/ZoneInfoDataTest.java b/android_icu4j/testing/src/com/android/i18n/test/timezone/ZoneInfoDataTest.java
index 29a5d283c..179b799dc 100644
--- a/android_icu4j/testing/src/com/android/i18n/test/timezone/ZoneInfoDataTest.java
+++ b/android_icu4j/testing/src/com/android/i18n/test/timezone/ZoneInfoDataTest.java
@@ -498,7 +498,7 @@ public class ZoneInfoDataTest extends TestCase {
assertNotNull("TimeZone " + id + " was not created", zoneInfoData);
assertEquals(id, zoneInfoData.getID());
// Make sure that getLatestDstSavings() at the earliest possible time does not crash.
- zoneInfoData.getLatestDstSavings(Long.MIN_VALUE);
+ zoneInfoData.getLatestDstSavingsMillis(Long.MIN_VALUE);
}
}
@@ -663,13 +663,14 @@ public class ZoneInfoDataTest extends TestCase {
}
private static void assertNoDSTSavings(ZoneInfoData zoneInfoData, Instant time) {
- assertNull(zoneInfoData.getLatestDstSavings(time.toEpochMilli()));
+ assertNull(zoneInfoData.getLatestDstSavingsMillis(time.toEpochMilli()));
}
private static void assertDSTSavings(ZoneInfoData zoneInfoData, Duration expectedDSTSavings,
Instant time) {
Integer expectedLatestDstSavings = (int) expectedDSTSavings.toMillis();
- assertEquals(expectedLatestDstSavings, zoneInfoData.getLatestDstSavings(time.toEpochMilli()));
+ assertEquals(expectedLatestDstSavings,
+ zoneInfoData.getLatestDstSavingsMillis(time.toEpochMilli()));
}
private static void assertInDaylightTime(ZoneInfoData zoneInfoData, Instant time,