summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Chang <vichang@google.com>2020-06-24 13:03:39 +0100
committerVictor Chang <vichang@google.com>2020-06-30 14:36:05 +0100
commit7e54f90fee6470a04c60df0721d0e9513187fd24 (patch)
tree725a4e20a0c26a6308760de362f186edb6feeead
parent6792d05ec1ec6ec1659a28daf13bc1d6ea69d53e (diff)
downloadicu-7e54f90fee6470a04c60df0721d0e9513187fd24.tar.gz
Move libcore.timezone to the i18n module - Final part
Bug: 141747409 Test: atest CtsLibcoreTestCases CtsLibcoreTestCases Change-Id: I5ab17c5d06561ba19e64291ad128131aa3d6a257
-rw-r--r--android_icu4j/api/legacy_platform/current.txt58
-rw-r--r--android_icu4j/libcore_bridge/src/java/com/android/i18n/TEST_MAPPING12
-rw-r--r--android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/CountryTimeZones.java9
-rw-r--r--android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/CountryZonesFinder.java7
-rw-r--r--android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyLookup.java22
-rw-r--r--android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyNetwork.java4
-rw-r--r--android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyNetworkFinder.java11
-rw-r--r--android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TimeZoneFinder.java39
-rw-r--r--android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/XmlUtils.java2
-rw-r--r--android_icu4j/libcore_bridge/src/java/com/android/i18n/util/Log.java7
-rw-r--r--android_icu4j/testing/src/com/android/i18n/test/timezone/CountryTimeZonesTest.java10
-rw-r--r--android_icu4j/testing/src/com/android/i18n/test/timezone/CountryZonesFinderTest.java11
-rw-r--r--android_icu4j/testing/src/com/android/i18n/test/timezone/TelephonyLookupTest.java11
-rw-r--r--android_icu4j/testing/src/com/android/i18n/test/timezone/TelephonyNetworkFinderTest.java9
-rw-r--r--android_icu4j/testing/src/com/android/i18n/test/timezone/TimeZoneFinderTest.java15
-rw-r--r--android_icu4j/testing/src/com/android/i18n/test/timezone/TimeZoneIntegrationTest.java2
16 files changed, 159 insertions, 70 deletions
diff --git a/android_icu4j/api/legacy_platform/current.txt b/android_icu4j/api/legacy_platform/current.txt
index 25f801e0c..c76cccb88 100644
--- a/android_icu4j/api/legacy_platform/current.txt
+++ b/android_icu4j/api/legacy_platform/current.txt
@@ -52,6 +52,38 @@ package android.icu.util {
package com.android.i18n.timezone {
+ public final class CountryTimeZones {
+ method public String getCountryIso();
+ method public android.icu.util.TimeZone getDefaultTimeZone();
+ method public String getDefaultTimeZoneId();
+ method public java.util.List<com.android.i18n.timezone.CountryTimeZones.TimeZoneMapping> getEffectiveTimeZoneMappingsAt(long);
+ method public java.util.List<com.android.i18n.timezone.CountryTimeZones.TimeZoneMapping> getTimeZoneMappings();
+ method public boolean hasUtcZone(long);
+ method public boolean isDefaultTimeZoneBoosted();
+ method public com.android.i18n.timezone.CountryTimeZones.OffsetResult lookupByOffsetWithBias(long, android.icu.util.TimeZone, int, boolean);
+ method public com.android.i18n.timezone.CountryTimeZones.OffsetResult lookupByOffsetWithBias(long, android.icu.util.TimeZone, int);
+ method public boolean matchesCountryCode(String);
+ }
+
+ public static final class CountryTimeZones.OffsetResult {
+ method public android.icu.util.TimeZone getTimeZone();
+ method public boolean isOnlyMatch();
+ }
+
+ public static final class CountryTimeZones.TimeZoneMapping {
+ method public static com.android.i18n.timezone.CountryTimeZones.TimeZoneMapping createForTests(String, boolean, Long);
+ method public Long getNotUsedAfter();
+ method public android.icu.util.TimeZone getTimeZone();
+ method public String getTimeZoneId();
+ method public boolean isShownInPicker();
+ }
+
+ public final class CountryZonesFinder {
+ method public java.util.List<java.lang.String> lookupAllCountryIsoCodes();
+ method public com.android.i18n.timezone.CountryTimeZones lookupCountryTimeZones(String);
+ method public java.util.List<com.android.i18n.timezone.CountryTimeZones> lookupCountryTimeZonesForZoneId(String);
+ }
+
public class DebugInfo {
ctor public DebugInfo();
method public com.android.i18n.timezone.DebugInfo addStringEntry(String, String);
@@ -69,12 +101,38 @@ package com.android.i18n.timezone {
method public static com.android.i18n.timezone.DebugInfo getDebugInfo();
}
+ public final class TelephonyLookup {
+ method public static com.android.i18n.timezone.TelephonyLookup createInstance(String) throws java.io.IOException;
+ method public static com.android.i18n.timezone.TelephonyLookup getInstance();
+ method public com.android.i18n.timezone.TelephonyNetworkFinder getTelephonyNetworkFinder();
+ method public void validate() throws java.io.IOException;
+ }
+
+ public final class TelephonyNetwork {
+ method public String getCountryIsoCode();
+ method public String getMcc();
+ method public String getMnc();
+ }
+
+ public final class TelephonyNetworkFinder {
+ method public com.android.i18n.timezone.TelephonyNetwork findNetworkByMccMnc(String, String);
+ }
+
public final class TimeZoneDataFiles {
method public static String getDataTimeZoneFile(String);
method public static String getDataTimeZoneRootDir();
method public static String getTimeZoneModuleTzVersionFile();
}
+ public final class TimeZoneFinder {
+ method public static com.android.i18n.timezone.TimeZoneFinder createInstance(String) throws java.io.IOException;
+ method public com.android.i18n.timezone.CountryZonesFinder getCountryZonesFinder();
+ method public String getIanaVersion();
+ method public static com.android.i18n.timezone.TimeZoneFinder getInstance();
+ method public com.android.i18n.timezone.CountryTimeZones lookupCountryTimeZones(String);
+ method public void validate() throws java.io.IOException;
+ }
+
public final class TzDataSetVersion {
ctor public TzDataSetVersion(int, int, String, int) throws com.android.i18n.timezone.TzDataSetVersion.TzDataSetException;
method public static int currentFormatMajorVersion();
diff --git a/android_icu4j/libcore_bridge/src/java/com/android/i18n/TEST_MAPPING b/android_icu4j/libcore_bridge/src/java/com/android/i18n/TEST_MAPPING
new file mode 100644
index 000000000..a3e400e3b
--- /dev/null
+++ b/android_icu4j/libcore_bridge/src/java/com/android/i18n/TEST_MAPPING
@@ -0,0 +1,12 @@
+{
+ "presubmit": [
+ {
+ "name": "CtsIcuTestCases",
+ "options": [
+ {
+ "include-filter": "com.android.i18n"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/CountryTimeZones.java b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/CountryTimeZones.java
index 4b00143ad..e89b577b9 100644
--- a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/CountryTimeZones.java
+++ b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/CountryTimeZones.java
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package libcore.timezone;
+package com.android.i18n.timezone;
import android.icu.util.TimeZone;
-import com.android.i18n.timezone.ZoneInfoDb;
+import com.android.i18n.util.Log;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -232,7 +233,7 @@ public final class CountryTimeZones {
for (TimeZoneMapping timeZoneMapping : timeZoneMappings) {
String timeZoneId = timeZoneMapping.timeZoneId;
if (!validTimeZoneIdsSet.contains(timeZoneId)) {
- System.logW("Skipping invalid zone: " + timeZoneId + " at " + debugInfo);
+ Log.w("Skipping invalid zone: " + timeZoneId + " at " + debugInfo);
} else {
validCountryTimeZoneMappings.add(timeZoneMapping);
}
@@ -243,7 +244,7 @@ public final class CountryTimeZones {
// assume the data was validated by earlier steps). The default time zone ID must just
// be a recognized zone ID: if it's not valid we leave it null.
if (!validTimeZoneIdsSet.contains(defaultTimeZoneId)) {
- System.logW("Invalid default time zone ID: " + defaultTimeZoneId
+ Log.w("Invalid default time zone ID: " + defaultTimeZoneId
+ " at " + debugInfo);
defaultTimeZoneId = null;
}
diff --git a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/CountryZonesFinder.java b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/CountryZonesFinder.java
index 1a9d6a65f..2f3b9c819 100644
--- a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/CountryZonesFinder.java
+++ b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/CountryZonesFinder.java
@@ -14,14 +14,15 @@
* limitations under the License.
*/
-package libcore.timezone;
+package com.android.i18n.timezone;
-import static libcore.timezone.XmlUtils.normalizeCountryIso;
+import static com.android.i18n.timezone.XmlUtils.normalizeCountryIso;
+
+import com.android.i18n.timezone.CountryTimeZones.TimeZoneMapping;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import libcore.timezone.CountryTimeZones.TimeZoneMapping;
/**
* An in-memory representation of country &lt;-&gt; time zone mapping data.
diff --git a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyLookup.java b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyLookup.java
index 1811b5809..826ee67aa 100644
--- a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyLookup.java
+++ b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyLookup.java
@@ -14,17 +14,17 @@
* limitations under the License.
*/
-package libcore.timezone;
+package com.android.i18n.timezone;
-import static libcore.timezone.XmlUtils.checkOnEndTag;
-import static libcore.timezone.XmlUtils.consumeUntilEndTag;
-import static libcore.timezone.XmlUtils.findNextStartTagOrEndTagNoRecurse;
-import static libcore.timezone.XmlUtils.findNextStartTagOrThrowNoRecurse;
-import static libcore.timezone.XmlUtils.normalizeCountryIso;
+import static com.android.i18n.timezone.XmlUtils.checkOnEndTag;
+import static com.android.i18n.timezone.XmlUtils.consumeUntilEndTag;
+import static com.android.i18n.timezone.XmlUtils.findNextStartTagOrEndTagNoRecurse;
+import static com.android.i18n.timezone.XmlUtils.findNextStartTagOrThrowNoRecurse;
+import static com.android.i18n.timezone.XmlUtils.normalizeCountryIso;
-import com.android.i18n.timezone.TimeZoneDataFiles;
-import libcore.timezone.TelephonyNetwork.MccMnc;
-import libcore.timezone.XmlUtils.ReaderSupplier;
+import com.android.i18n.timezone.TelephonyNetwork.MccMnc;
+import com.android.i18n.timezone.XmlUtils.ReaderSupplier;
+import com.android.i18n.util.Log;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -110,7 +110,7 @@ public final class TelephonyLookup {
}
}
- System.logE("No valid file found in set: " + Arrays.toString(telephonyLookupFilePaths)
+ Log.e("No valid file found in set: " + Arrays.toString(telephonyLookupFilePaths)
+ " Printing exceptions and falling back to empty map.", lastException);
return createInstanceForTests("<telephony_lookup><networks /></telephony_lookup>");
}
@@ -156,7 +156,7 @@ public final class TelephonyLookup {
return extractor.getTelephonyNetworkFinder();
} catch (XmlPullParserException | IOException e) {
- System.logW("Error reading telephony networks", e);
+ Log.w("Error reading telephony networks", e);
return null;
}
}
diff --git a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyNetwork.java b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyNetwork.java
index 3bd1be871..10b6f2e18 100644
--- a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyNetwork.java
+++ b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyNetwork.java
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package libcore.timezone;
+package com.android.i18n.timezone;
-import static libcore.timezone.XmlUtils.normalizeCountryIso;
+import static com.android.i18n.timezone.XmlUtils.normalizeCountryIso;
import java.util.Objects;
diff --git a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyNetworkFinder.java b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyNetworkFinder.java
index 825c06eb3..c6e5a892b 100644
--- a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyNetworkFinder.java
+++ b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TelephonyNetworkFinder.java
@@ -14,11 +14,12 @@
* limitations under the License.
*/
-package libcore.timezone;
+package com.android.i18n.timezone;
-import static libcore.timezone.XmlUtils.normalizeCountryIso;
+import static com.android.i18n.timezone.XmlUtils.normalizeCountryIso;
-import libcore.timezone.TelephonyNetwork.MccMnc;
+import com.android.i18n.timezone.TelephonyNetwork.MccMnc;
+import com.android.i18n.util.Log;
import java.util.ArrayList;
import java.util.Collections;
@@ -49,14 +50,14 @@ public final class TelephonyNetworkFinder {
Map<MccMnc, TelephonyNetwork> networksMap = new HashMap<>();
for (TelephonyNetwork network : networksList) {
if (!validCountryIsoCodes.contains(network.getCountryIsoCode())) {
- System.logW("Unrecognized country code: " + network.getCountryIsoCode()
+ Log.w("Unrecognized country code: " + network.getCountryIsoCode()
+ " for telephony network=" + network);
}
MccMnc mccMnc = network.getMccMnc();
TelephonyNetwork existingEntry = networksMap.put(mccMnc, network);
if (existingEntry != null) {
- System.logW("Duplicate MccMnc detected for " + mccMnc
+ Log.w("Duplicate MccMnc detected for " + mccMnc
+ ". New entry=" + network + " replacing previous entry.");
}
}
diff --git a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TimeZoneFinder.java b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TimeZoneFinder.java
index ab8180f7b..e0621a65f 100644
--- a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TimeZoneFinder.java
+++ b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/TimeZoneFinder.java
@@ -14,18 +14,17 @@
* limitations under the License.
*/
-package libcore.timezone;
-
-import static libcore.timezone.XmlUtils.checkOnEndTag;
-import static libcore.timezone.XmlUtils.consumeText;
-import static libcore.timezone.XmlUtils.consumeUntilEndTag;
-import static libcore.timezone.XmlUtils.findNextStartTagOrEndTagNoRecurse;
-import static libcore.timezone.XmlUtils.findNextStartTagOrThrowNoRecurse;
-import static libcore.timezone.XmlUtils.normalizeCountryIso;
-import static libcore.timezone.XmlUtils.parseBooleanAttribute;
-import static libcore.timezone.XmlUtils.parseLongAttribute;
-
-import com.android.i18n.timezone.TimeZoneDataFiles;
+package com.android.i18n.timezone;
+
+import static com.android.i18n.timezone.XmlUtils.checkOnEndTag;
+import static com.android.i18n.timezone.XmlUtils.consumeText;
+import static com.android.i18n.timezone.XmlUtils.consumeUntilEndTag;
+import static com.android.i18n.timezone.XmlUtils.findNextStartTagOrEndTagNoRecurse;
+import static com.android.i18n.timezone.XmlUtils.findNextStartTagOrThrowNoRecurse;
+import static com.android.i18n.timezone.XmlUtils.normalizeCountryIso;
+import static com.android.i18n.timezone.XmlUtils.parseBooleanAttribute;
+import static com.android.i18n.timezone.XmlUtils.parseLongAttribute;
+
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
@@ -40,19 +39,17 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import libcore.timezone.CountryTimeZones.TimeZoneMapping;
-import libcore.timezone.XmlUtils.ReaderSupplier;
+import com.android.i18n.timezone.CountryTimeZones.TimeZoneMapping;
+import com.android.i18n.timezone.XmlUtils.ReaderSupplier;
+import com.android.i18n.util.Log;
/**
* A class that can find matching time zones by loading data from the tzlookup.xml file.
* @hide
*/
@libcore.api.CorePlatformApi
-@libcore.api.IntraCoreApi
public final class TimeZoneFinder {
- // VisibleForTesting
- @libcore.api.IntraCoreApi
public static final String TZLOOKUP_FILE_NAME = "tzlookup.xml";
// Root element. e.g. <timezones ianaversion="2017b">
@@ -97,7 +94,6 @@ public final class TimeZoneFinder {
* in-depth validation is performed on the file content, see {@link #validate()}.
*/
@libcore.api.CorePlatformApi
- @libcore.api.IntraCoreApi
public static TimeZoneFinder getInstance() {
synchronized(TimeZoneFinder.class) {
if (instance == null) {
@@ -129,7 +125,7 @@ public final class TimeZoneFinder {
}
}
- System.logE("No valid file found in set: " + Arrays.toString(tzLookupFilePaths)
+ Log.e("No valid file found in set: " + Arrays.toString(tzLookupFilePaths)
+ " Printing exceptions and falling back to empty map.", lastException);
return createInstanceForTests("<timezones><countryzones /></timezones>");
}
@@ -168,7 +164,6 @@ public final class TimeZoneFinder {
* or there is a problem reading the file then {@code null} is returned.
*/
@libcore.api.CorePlatformApi
- @libcore.api.IntraCoreApi
public String getIanaVersion() {
IanaVersionExtractor ianaVersionExtractor = new IanaVersionExtractor();
try {
@@ -191,7 +186,7 @@ public final class TimeZoneFinder {
return extractor.getCountryZonesLookup();
} catch (XmlPullParserException | IOException e) {
- System.logW("Error reading country zones ", e);
+ Log.w("Error reading country zones ", e);
return null;
}
}
@@ -227,7 +222,7 @@ public final class TimeZoneFinder {
}
return countryTimeZones;
} catch (XmlPullParserException | IOException e) {
- System.logW("Error reading country zones ", e);
+ Log.w("Error reading country zones ", e);
// Error - don't change the cached value.
return null;
diff --git a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/XmlUtils.java b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/XmlUtils.java
index a9616f96e..9ff0a681a 100644
--- a/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/XmlUtils.java
+++ b/android_icu4j/libcore_bridge/src/java/com/android/i18n/timezone/XmlUtils.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package libcore.timezone;
+package com.android.i18n.timezone;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
diff --git a/android_icu4j/libcore_bridge/src/java/com/android/i18n/util/Log.java b/android_icu4j/libcore_bridge/src/java/com/android/i18n/util/Log.java
index 6d960b9f7..ae368dcd1 100644
--- a/android_icu4j/libcore_bridge/src/java/com/android/i18n/util/Log.java
+++ b/android_icu4j/libcore_bridge/src/java/com/android/i18n/util/Log.java
@@ -33,6 +33,13 @@ public class Log {
public static void e(String msg, Throwable e) {
log(ERROR, msg, e);
}
+ public static void w(String msg) {
+ w(msg, null);
+ }
+
+ public static void w(String msg, Throwable e) {
+ log(WARN, msg, e);
+ }
private static native void log(int priority, String msg, Throwable th);
}
diff --git a/android_icu4j/testing/src/com/android/i18n/test/timezone/CountryTimeZonesTest.java b/android_icu4j/testing/src/com/android/i18n/test/timezone/CountryTimeZonesTest.java
index 3fbd0fe8b..71f10742b 100644
--- a/android_icu4j/testing/src/com/android/i18n/test/timezone/CountryTimeZonesTest.java
+++ b/android_icu4j/testing/src/com/android/i18n/test/timezone/CountryTimeZonesTest.java
@@ -14,10 +14,11 @@
* limitations under the License.
*/
-package libcore.libcore.timezone;
+package com.android.i18n.test.timezone;
import org.junit.Test;
+import android.icu.testsharding.MainTestShard;
import android.icu.util.TimeZone;
import java.util.ArrayList;
@@ -26,9 +27,9 @@ import java.util.List;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
-import libcore.timezone.CountryTimeZones;
-import libcore.timezone.CountryTimeZones.OffsetResult;
-import libcore.timezone.CountryTimeZones.TimeZoneMapping;
+import com.android.i18n.timezone.CountryTimeZones;
+import com.android.i18n.timezone.CountryTimeZones.OffsetResult;
+import com.android.i18n.timezone.CountryTimeZones.TimeZoneMapping;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -36,6 +37,7 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+@MainTestShard
public class CountryTimeZonesTest {
private static final int HOUR_MILLIS = 60 * 60 * 1000;
diff --git a/android_icu4j/testing/src/com/android/i18n/test/timezone/CountryZonesFinderTest.java b/android_icu4j/testing/src/com/android/i18n/test/timezone/CountryZonesFinderTest.java
index ecd52013e..62a8624ac 100644
--- a/android_icu4j/testing/src/com/android/i18n/test/timezone/CountryZonesFinderTest.java
+++ b/android_icu4j/testing/src/com/android/i18n/test/timezone/CountryZonesFinderTest.java
@@ -14,22 +14,25 @@
* limitations under the License.
*/
-package libcore.libcore.timezone;
+package com.android.i18n.test.timezone;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
-import libcore.timezone.CountryTimeZones;
-import libcore.timezone.CountryTimeZones.TimeZoneMapping;
-import libcore.timezone.CountryZonesFinder;
+import com.android.i18n.timezone.CountryTimeZones;
+import com.android.i18n.timezone.CountryTimeZones.TimeZoneMapping;
+import com.android.i18n.timezone.CountryZonesFinder;
+
+import android.icu.testsharding.MainTestShard;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
+@MainTestShard
public class CountryZonesFinderTest {
private static final CountryTimeZones GB_ZONES = CountryTimeZones.createValidated(
diff --git a/android_icu4j/testing/src/com/android/i18n/test/timezone/TelephonyLookupTest.java b/android_icu4j/testing/src/com/android/i18n/test/timezone/TelephonyLookupTest.java
index 8b4d8677a..08d5db991 100644
--- a/android_icu4j/testing/src/com/android/i18n/test/timezone/TelephonyLookupTest.java
+++ b/android_icu4j/testing/src/com/android/i18n/test/timezone/TelephonyLookupTest.java
@@ -14,21 +14,23 @@
* limitations under the License.
*/
-package libcore.libcore.timezone;
+package com.android.i18n.test.timezone;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import libcore.timezone.TelephonyLookup;
-import libcore.timezone.TelephonyNetwork;
-import libcore.timezone.TelephonyNetworkFinder;
+import com.android.i18n.timezone.TelephonyLookup;
+import com.android.i18n.timezone.TelephonyNetwork;
+import com.android.i18n.timezone.TelephonyNetworkFinder;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import android.icu.testsharding.MainTestShard;
+
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileVisitResult;
@@ -40,6 +42,7 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.List;
+@MainTestShard
public class TelephonyLookupTest {
private Path testDir;
diff --git a/android_icu4j/testing/src/com/android/i18n/test/timezone/TelephonyNetworkFinderTest.java b/android_icu4j/testing/src/com/android/i18n/test/timezone/TelephonyNetworkFinderTest.java
index 44dfc8178..6b638cf37 100644
--- a/android_icu4j/testing/src/com/android/i18n/test/timezone/TelephonyNetworkFinderTest.java
+++ b/android_icu4j/testing/src/com/android/i18n/test/timezone/TelephonyNetworkFinderTest.java
@@ -14,19 +14,22 @@
* limitations under the License.
*/
-package libcore.libcore.timezone;
+package com.android.i18n.test.timezone;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import libcore.timezone.TelephonyNetwork;
-import libcore.timezone.TelephonyNetworkFinder;
+import com.android.i18n.timezone.TelephonyNetwork;
+import com.android.i18n.timezone.TelephonyNetworkFinder;
import org.junit.Test;
+import android.icu.testsharding.MainTestShard;
+
import java.util.Arrays;
import java.util.List;
+@MainTestShard
public class TelephonyNetworkFinderTest {
@Test
diff --git a/android_icu4j/testing/src/com/android/i18n/test/timezone/TimeZoneFinderTest.java b/android_icu4j/testing/src/com/android/i18n/test/timezone/TimeZoneFinderTest.java
index ef0737142..a85041906 100644
--- a/android_icu4j/testing/src/com/android/i18n/test/timezone/TimeZoneFinderTest.java
+++ b/android_icu4j/testing/src/com/android/i18n/test/timezone/TimeZoneFinderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package libcore.libcore.timezone;
+package com.android.i18n.test.timezone;
import org.junit.After;
import org.junit.Before;
@@ -30,10 +30,12 @@ import java.nio.file.attribute.BasicFileAttributes;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
-import libcore.timezone.CountryTimeZones;
-import libcore.timezone.CountryTimeZones.TimeZoneMapping;
-import libcore.timezone.CountryZonesFinder;
-import libcore.timezone.TimeZoneFinder;
+import com.android.i18n.timezone.CountryTimeZones;
+import com.android.i18n.timezone.CountryTimeZones.TimeZoneMapping;
+import com.android.i18n.timezone.CountryZonesFinder;
+import com.android.i18n.timezone.TimeZoneFinder;
+
+import android.icu.testsharding.MainTestShard;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -41,6 +43,7 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+@MainTestShard
public class TimeZoneFinderTest {
private Path testDir;
diff --git a/android_icu4j/testing/src/com/android/i18n/test/timezone/TimeZoneIntegrationTest.java b/android_icu4j/testing/src/com/android/i18n/test/timezone/TimeZoneIntegrationTest.java
index 57f0c6b18..119c381a1 100644
--- a/android_icu4j/testing/src/com/android/i18n/test/timezone/TimeZoneIntegrationTest.java
+++ b/android_icu4j/testing/src/com/android/i18n/test/timezone/TimeZoneIntegrationTest.java
@@ -45,7 +45,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
-import libcore.timezone.TimeZoneFinder;
+import com.android.i18n.timezone.TimeZoneFinder;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;