diff options
| author | 2024-10-04 18:41:18 +0000 | |
|---|---|---|
| committer | 2024-10-04 18:41:18 +0000 | |
| commit | e015b71c8889f4ec4b99da5b0c2ad9e863665f04 (patch) | |
| tree | c17d90ca272014f9f0a015457bdb33f701885b3c | |
| parent | 11fef3f646c2e679322706320b672f5de80c5a60 (diff) | |
| parent | aa381d3b4800b5e004afb3d7dfbb5819ca175d6c (diff) | |
Merge "Correct an ApplicationSharedMemory unit test" into main
| -rw-r--r-- | tests/Internal/src/com/android/internal/os/ApplicationSharedMemoryTest.java | 9 |
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. */ |