summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvichang <vichang@google.com>2020-11-06 18:01:08 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-11-06 18:01:08 +0000
commit65d1fda8f68a38a85e89081c362bdea685170df0 (patch)
tree82c50b66047fde6aeb71c7bd5e89a6bd1ca110b9
parente40aa2d11808d8b1e301411836ec2d53b4ec4bea (diff)
parent1925c89f8fc0eb18dc722337d876965e55bff0ae (diff)
Merge "Move WallTime out of ZoneInfoData"
-rw-r--r--core/java/android/text/format/Time.java5
-rw-r--r--core/java/android/text/format/TimeFormatter.java7
2 files changed, 7 insertions, 5 deletions
diff --git a/core/java/android/text/format/Time.java b/core/java/android/text/format/Time.java
index f19e7d2724d9..bac7c6cf87d3 100644
--- a/core/java/android/text/format/Time.java
+++ b/core/java/android/text/format/Time.java
@@ -18,6 +18,7 @@ package android.text.format;
import android.util.TimeFormatException;
+import com.android.i18n.timezone.WallTime;
import com.android.i18n.timezone.ZoneInfoData;
import com.android.i18n.timezone.ZoneInfoDb;
@@ -1070,7 +1071,7 @@ public class Time {
* to the enclosing object, but others do not: thus separate state is retained.
*/
private static class TimeCalculator {
- public final ZoneInfoData.WallTime wallTime;
+ public final WallTime wallTime;
public String timezone;
// Information about the current timezone.
@@ -1078,7 +1079,7 @@ public class Time {
public TimeCalculator(String timezoneId) {
this.mZoneInfoData = lookupZoneInfoData(timezoneId);
- this.wallTime = new ZoneInfoData.WallTime();
+ this.wallTime = new WallTime();
}
public long toMillis(boolean ignoreDst) {
diff --git a/core/java/android/text/format/TimeFormatter.java b/core/java/android/text/format/TimeFormatter.java
index c71dfbbafd40..e42ad6334649 100644
--- a/core/java/android/text/format/TimeFormatter.java
+++ b/core/java/android/text/format/TimeFormatter.java
@@ -24,6 +24,7 @@ import android.content.res.Resources;
import android.icu.text.DateFormatSymbols;
import android.icu.text.DecimalFormatSymbols;
+import com.android.i18n.timezone.WallTime;
import com.android.i18n.timezone.ZoneInfoData;
import java.nio.CharBuffer;
@@ -149,7 +150,7 @@ class TimeFormatter {
/**
* Format the specified {@code wallTime} using {@code pattern}. The output is returned.
*/
- public String format(String pattern, ZoneInfoData.WallTime wallTime,
+ public String format(String pattern, WallTime wallTime,
ZoneInfoData zoneInfoData) {
try {
StringBuilder stringBuilder = new StringBuilder();
@@ -192,7 +193,7 @@ class TimeFormatter {
* Format the specified {@code wallTime} using {@code pattern}. The output is written to
* {@link #outputBuilder}.
*/
- private void formatInternal(String pattern, ZoneInfoData.WallTime wallTime,
+ private void formatInternal(String pattern, WallTime wallTime,
ZoneInfoData zoneInfoData) {
CharBuffer formatBuffer = CharBuffer.wrap(pattern);
while (formatBuffer.remaining() > 0) {
@@ -208,7 +209,7 @@ class TimeFormatter {
}
}
- private boolean handleToken(CharBuffer formatBuffer, ZoneInfoData.WallTime wallTime,
+ private boolean handleToken(CharBuffer formatBuffer, WallTime wallTime,
ZoneInfoData zoneInfoData) {
// The char at formatBuffer.position() is expected to be '%' at this point.