From 9d0ac275054eff58794dc15aeb3ca5fe85324b4e Mon Sep 17 00:00:00 2001 From: Priyanka Advani Date: Tue, 4 Jun 2024 18:35:34 +0000 Subject: [PATCH] Revert "Override versioned tzdata file path." Revert submission 3113499-no-more-tzdatas-reland Reason for revert: Droidmonitor created revert due to b/344921228. Reverted changes: /q/submissionid:3113499-no-more-tzdatas-reland Change-Id: I5e2a77106a02861d2ce5be5aff3ffa74324a2fb5 --- .../org/robolectric/shadows/ShadowMemoryMappedFileS.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowMemoryMappedFileS.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowMemoryMappedFileS.java index 35eed1a57f..f7929a55ce 100644 --- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowMemoryMappedFileS.java +++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowMemoryMappedFileS.java @@ -10,7 +10,6 @@ import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import java.util.regex.Pattern; import libcore.io.Streams; import org.robolectric.annotation.Implementation; import org.robolectric.annotation.Implements; @@ -24,15 +23,13 @@ public class ShadowMemoryMappedFileS { private static final String TZ_DATA_2 = "/usr/share/zoneinfo/tzdata"; private static final String TZ_DATA_3 = "/misc/zoneinfo/current/tzdata"; private static final String TZ_DATA_4 = "/etc/tz/tzdata"; - private static final Pattern VERSIONED_TZDATA = Pattern.compile(".*/tz/versioned/\\d+/tzdata"); @Implementation public static MemoryMappedFile mmapRO(String path) throws Throwable { if (path.endsWith(TZ_DATA_1) || path.endsWith(TZ_DATA_2) || path.endsWith(TZ_DATA_3) - || path.endsWith(TZ_DATA_4) - || VERSIONED_TZDATA.matcher(path).matches()) { + || path.endsWith(TZ_DATA_4)) { InputStream is = MemoryMappedFile.class.getResourceAsStream(TZ_DATA_2); if (is == null) { throw new ErrnoException("open", -1);