summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/AbstractInputMethodService.java
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2021-09-28 11:45:37 +0100
committerNeil Fuller <nfuller@google.com>2021-10-12 13:23:55 +0100
commite811aa358d03646a6964dc71e6642e5b1787e346 (patch)
tree84b9a0b8077e29f16da5d944d9448ffcc71db530 /core/java/android/inputmethodservice/AbstractInputMethodService.java
parent251fa87f308e0fa3332f5f82e3daeabc73bb184c (diff)
Fix SntpClient 2036 issue (1/2)
Fix issue with SntpClient after the end of NTP era 0 (2036). This commit is 1/2. It makes some refactoring changes, lint fixes, adds tests and introduces types that will be used in 2/2. Some of the added tests fail and demonstrate the issue being fixed with the current implementation. ----- Failures that demonstrate the bug: android.net.SntpClientTest#testRequestTime_era1ClientEra1Server STACKTRACE: junit.framework.AssertionFailedError: expected=5, actual=-4294967295995, allowedSlop=1 at junit.framework.Assert.fail(Assert.java:50) at junit.framework.Assert.assertTrue(Assert.java:20) at android.net.SntpClientTest.assertNearlyEquals(SntpClientTest.java:502) at android.net.SntpClientTest.checkRequestTimeCalcs(SntpClientTest.java:215) at android.net.SntpClientTest.testRequestTime_era1ClientEra1Server(SntpClientTest.java:201) android.net.SntpClientTest#testRequestTime_era0ClientEra1Server: FAILED (145ms) STACKTRACE: junit.framework.AssertionFailedError: expected=1139293696005, actual=-3155673599995, allowedSlop=1 at junit.framework.Assert.fail(Assert.java:50) at junit.framework.Assert.assertTrue(Assert.java:20) at android.net.SntpClientTest.assertNearlyEquals(SntpClientTest.java:502) at android.net.SntpClientTest.checkRequestTimeCalcs(SntpClientTest.java:215) at android.net.SntpClientTest.testRequestTime_era0ClientEra1Server(SntpClientTest.java:174) android.net.SntpClientTest#testNonMatchingOriginateTime: FAILED (116ms) STACKTRACE: junit.framework.AssertionFailedError at junit.framework.Assert.fail(Assert.java:48) at junit.framework.Assert.assertTrue(Assert.java:20) at junit.framework.Assert.assertFalse(Assert.java:34) at junit.framework.Assert.assertFalse(Assert.java:41) at android.net.SntpClientTest.testNonMatchingOriginateTime(SntpClientTest.java:384) ------ This commit: + Introduces a dedicated Timestamp64 type + test for holding NTP timestamps. + Introduces a dedicated Duration64 type + test for holding the 32-bit signed difference between two Timestamp64 instances. + Fixes some naming to add clarity / addresses lint issues. + Adjusts tests Tests are NOT expected to pass with just this commit. See 2/2. Bug: 199481251 Test: atest core/tests/coretests/src/android/net/sntp/Timestamp64Test.java Test: atest core/tests/coretests/src/android/net/sntp/Duration64Test.java Test: atest core/tests/coretests/src/android/net/SntpClientTest.java Change-Id: Ifdaada39298b05c48a3207fe6c0fad71c8a0a252
Diffstat (limited to 'core/java/android/inputmethodservice/AbstractInputMethodService.java')
0 files changed, 0 insertions, 0 deletions