commit | b53e638293b276d17d7c5fd0d9f62a5681a48231 | [log] [tgz] |
---|---|---|
author | Yan Yan <evitayan@google.com> | Thu Nov 30 02:52:08 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Nov 30 02:52:08 2023 +0000 |
tree | d45599687bb178f6871a73fade456984e71430e6 | |
parent | 202ea17a51ec01321514672ded6beef5a4e98c78 [diff] | |
parent | 384150823741b321b08d5ab701e2e61710685c1e [diff] |
Merge "Fix StructXfrmLifetimeCurTest failure when default timezone is not GMT" into main am: 3841508237 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2850828 Change-Id: I0bf83daef7e65edca3afccbc4b3f43e39434d498 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/staticlibs/tests/unit/src/com/android/net/module/util/netlink/xfrm/StructXfrmLifetimeCurTest.java b/staticlibs/tests/unit/src/com/android/net/module/util/netlink/xfrm/StructXfrmLifetimeCurTest.java index 38ef7ad..008c922 100644 --- a/staticlibs/tests/unit/src/com/android/net/module/util/netlink/xfrm/StructXfrmLifetimeCurTest.java +++ b/staticlibs/tests/unit/src/com/android/net/module/util/netlink/xfrm/StructXfrmLifetimeCurTest.java
@@ -31,6 +31,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Calendar; +import java.util.TimeZone; import java.util.concurrent.TimeUnit; @RunWith(AndroidJUnit4.class) @@ -42,7 +43,7 @@ private static final BigInteger ADD_TIME; static { - final Calendar cal = Calendar.getInstance(); + final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); cal.set(2023, Calendar.NOVEMBER, 2, 1, 42, 36); final long timestampSeconds = TimeUnit.MILLISECONDS.toSeconds(cal.getTimeInMillis()); ADD_TIME = BigInteger.valueOf(timestampSeconds);