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

Commit f51bea51 authored by Fan Zhang's avatar Fan Zhang
Browse files

Fix robolectric test failure in settings

Bug: 36971201
Test: rerun robolectric tests
Change-Id: Ib5b9ab3f0d5e4f7099accf03d8c52ab7c744144d
parent 9c232319
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);
        }
    }
}