Merge "Use ICU APIs not impl types"
This commit is contained in:
@@ -17,10 +17,10 @@
|
||||
package com.android.settings.datetime.timezone;
|
||||
|
||||
import android.content.Context;
|
||||
import android.icu.impl.OlsonTimeZone;
|
||||
import android.icu.text.DateFormat;
|
||||
import android.icu.text.DisplayContext;
|
||||
import android.icu.text.SimpleDateFormat;
|
||||
import android.icu.util.BasicTimeZone;
|
||||
import android.icu.util.Calendar;
|
||||
import android.icu.util.TimeZone;
|
||||
import android.icu.util.TimeZoneTransition;
|
||||
@@ -115,17 +115,17 @@ public class TimeZoneInfoPreferenceController extends BaseTimeZonePreferenceCont
|
||||
}
|
||||
|
||||
private TimeZoneTransition findNextDstTransition(TimeZone timeZone) {
|
||||
if (!(timeZone instanceof OlsonTimeZone)) {
|
||||
if (!(timeZone instanceof BasicTimeZone)) {
|
||||
return null;
|
||||
}
|
||||
final OlsonTimeZone olsonTimeZone = (OlsonTimeZone) timeZone;
|
||||
TimeZoneTransition transition = olsonTimeZone.getNextTransition(
|
||||
final BasicTimeZone basicTimeZone = (BasicTimeZone) timeZone;
|
||||
TimeZoneTransition transition = basicTimeZone.getNextTransition(
|
||||
mDate.getTime(), /* inclusive */ false);
|
||||
do {
|
||||
if (transition.getTo().getDSTSavings() != transition.getFrom().getDSTSavings()) {
|
||||
break;
|
||||
}
|
||||
transition = olsonTimeZone.getNextTransition(
|
||||
transition = basicTimeZone.getNextTransition(
|
||||
transition.getTime(), /*inclusive */ false);
|
||||
} while (transition != null);
|
||||
return transition;
|
||||
|
Reference in New Issue
Block a user