summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lee Shombert <shombert@google.com> 2024-10-04 18:41:18 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-10-04 18:41:18 +0000
commite015b71c8889f4ec4b99da5b0c2ad9e863665f04 (patch)
treec17d90ca272014f9f0a015457bdb33f701885b3c
parent11fef3f646c2e679322706320b672f5de80c5a60 (diff)
parentaa381d3b4800b5e004afb3d7dfbb5819ca175d6c (diff)
Merge "Correct an ApplicationSharedMemory unit test" into main
-rw-r--r--tests/Internal/src/com/android/internal/os/ApplicationSharedMemoryTest.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/Internal/src/com/android/internal/os/ApplicationSharedMemoryTest.java b/tests/Internal/src/com/android/internal/os/ApplicationSharedMemoryTest.java
index e3a129fb1059..d03ad5cb2877 100644
--- a/tests/Internal/src/com/android/internal/os/ApplicationSharedMemoryTest.java
+++ b/tests/Internal/src/com/android/internal/os/ApplicationSharedMemoryTest.java
@@ -61,8 +61,13 @@ public class ApplicationSharedMemoryTest {
@Test
public void canRead() {
ApplicationSharedMemory instance = ApplicationSharedMemory.getInstance();
- instance.getLatestNetworkTimeUnixEpochMillisAtZeroElapsedRealtimeMillis();
- // Don't actually care about the value of the above.
+ try {
+ instance.getLatestNetworkTimeUnixEpochMillisAtZeroElapsedRealtimeMillis();
+ // Don't actually care about the value of the above.
+ } catch (java.time.DateTimeException e) {
+ // This exception is okay during testing. It means there was no time source, which
+ // could be because of network problems or a feature being flagged off.
+ }
}
/** Application processes should not have mutable access. */