Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 843f07e2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix robolectric test failure in settings"

parents bf313091 f51bea51
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.content.res.XmlResourceParser;
import android.icu.text.TimeZoneFormat;
import android.icu.text.TimeZoneNames;
import android.support.annotation.VisibleForTesting;
import android.support.v4.text.BidiFormatter;
import android.support.v4.text.TextDirectionHeuristicsCompat;
import android.text.SpannableString;
@@ -32,6 +33,8 @@ import android.view.View;

import com.android.settingslib.R;

import libcore.util.TimeZoneFinder;

import org.xmlpull.v1.XmlPullParserException;

import java.util.ArrayList;
@@ -43,7 +46,6 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import libcore.util.TimeZoneFinder;

/**
 * ZoneGetter is the utility class to get time zone and zone list, and both of them have display
@@ -350,7 +352,8 @@ public class ZoneGetter {
        return gmtText;
    }

    private static final class ZoneGetterData {
    @VisibleForTesting
    public static final class ZoneGetterData {
        public final String[] olsonIdsToDisplay;
        public final CharSequence[] gmtOffsetTexts;
        public final TimeZone[] timeZones;
@@ -377,9 +380,13 @@ public class ZoneGetter {
            }

            // Create a lookup of local zone IDs.
            List<String> zoneIds =
                    TimeZoneFinder.getInstance().lookupTimeZoneIdsByCountry(locale.getCountry());
            final List<String> zoneIds = lookupTimeZoneIdsByCountry(locale.getCountry());
            localZoneIds = new HashSet<>(zoneIds);
        }

        @VisibleForTesting
        public List<String> lookupTimeZoneIdsByCountry(String country) {
            return TimeZoneFinder.getInstance().lookupTimeZoneIdsByCountry(country);
        }
    }
}