Searched refs:Timestamp64 (Results 1 – 6 of 6) sorted by relevance
/frameworks/base/core/tests/coretests/src/android/net/sntp/ |
D | Timestamp64Test.java | 18 import static android.net.sntp.Timestamp64.NANOS_PER_SECOND; 45 expectIllegalArgumentException(() -> Timestamp64.fromComponents(minNtpEraSeconds - 1, 0)); in testFromComponents() 46 expectIllegalArgumentException(() -> Timestamp64.fromComponents(maxNtpEraSeconds + 1, 0)); in testFromComponents() 55 Timestamp64 value = Timestamp64.fromComponents(ntpEraSeconds, fractionBits); in assertComponentCreation() 68 Timestamp64 one = Timestamp64.fromComponents(eraSeconds, fractionBits); in assertEqualsAndHashcode() 69 Timestamp64 two = Timestamp64.fromComponents(eraSeconds, fractionBits); in assertEqualsAndHashcode() 76 expectIllegalArgumentException(() -> Timestamp64.fromString("")); in testStringForm() 77 expectIllegalArgumentException(() -> Timestamp64.fromString(".")); in testStringForm() 78 expectIllegalArgumentException(() -> Timestamp64.fromString("1234567812345678")); in testStringForm() 79 expectIllegalArgumentException(() -> Timestamp64.fromString("12345678?12345678")); in testStringForm() [all …]
|
D | Duration64Test.java | 18 import static android.net.sntp.Timestamp64.NANOS_PER_SECOND; 42 long maxDuration64Seconds = Timestamp64.MAX_SECONDS_IN_ERA / 2; in testBetween_rangeChecks() 44 Timestamp64 zeroNoFrac = Timestamp64.fromComponents(0, 0); in testBetween_rangeChecks() 48 Timestamp64 ceilNoFrac = Timestamp64.fromComponents(maxDuration64Seconds, 0); in testBetween_rangeChecks() 62 Timestamp64 ceilWithFrac = Timestamp64 in testBetween_rangeChecks() 82 Duration64.between(Timestamp64.fromComponents(5, 0), in testBetween_smallSecondsOnly() 83 Timestamp64.fromComponents(10, 0)) in testBetween_smallSecondsOnly() 86 Duration64.between(Timestamp64.fromComponents(10, 0), in testBetween_smallSecondsOnly() 87 Timestamp64.fromComponents(5, 0)) in testBetween_smallSecondsOnly() 100 Timestamp64.fromComponents(5, 0), in testBetween_smallSecondsAndFraction() [all …]
|
/frameworks/base/core/java/android/net/sntp/ |
D | Timestamp64.java | 39 public final class Timestamp64 { class 41 public static final Timestamp64 ZERO = fromComponents(0, 0); 53 public static Timestamp64 fromComponents(long eraSeconds, int fractionBits) { in fromComponents() 54 return new Timestamp64(eraSeconds, fractionBits); in fromComponents() 58 public static Timestamp64 fromString(String string) { in fromString() 73 return new Timestamp64(eraSeconds, (int) fractionBitsAsLong); in fromString() 81 public static Timestamp64 fromInstant(Instant instant) { in fromInstant() 91 return new Timestamp64(ntpEraSeconds, fractionBits); in fromInstant() 97 private Timestamp64(long eraSeconds, int fractionBits) { in Timestamp64() method in Timestamp64 138 Timestamp64 that = (Timestamp64) o; in equals() [all …]
|
D | Duration64.java | 44 public static Duration64 between(Timestamp64 startInclusive, Timestamp64 endExclusive) { in between() 89 | (Timestamp64.nanosToFractionBits(duration.getNano()) & 0xFFFF_FFFFL); in fromDuration() 139 return Timestamp64.fractionBitsToNanos((int) (mBits & 0xFFFF_FFFFL)); in getNanos()
|
/frameworks/base/core/java/android/net/ |
D | SntpClient.java | 22 import android.net.sntp.Timestamp64; 161 final Timestamp64 requestTimestamp = Timestamp64.fromInstant(requestTime); in requestTime() 163 final Timestamp64 randomizedRequestTimestamp = in requestTime() 175 final Timestamp64 responseTimestamp = Timestamp64.fromInstant(responseTime); in requestTime() 181 final Timestamp64 referenceTimestamp = readTimeStamp(buffer, REFERENCE_TIME_OFFSET); in requestTime() 182 final Timestamp64 originateTimestamp = readTimeStamp(buffer, ORIGINATE_TIME_OFFSET); in requestTime() 183 final Timestamp64 receiveTimestamp = readTimeStamp(buffer, RECEIVE_TIME_OFFSET); in requestTime() 184 final Timestamp64 transmitTimestamp = readTimeStamp(buffer, TRANSMIT_TIME_OFFSET); in requestTime() 229 public static Duration calculateClockOffset(Timestamp64 clientRequestTimestamp, in calculateClockOffset() 230 Timestamp64 serverReceiveTimestamp, Timestamp64 serverTransmitTimestamp, in calculateClockOffset() [all …]
|
/frameworks/base/core/tests/coretests/src/android/net/ |
D | SntpClientTest.java | 28 import android.net.sntp.Timestamp64; 98 Timestamp64.fromString("d9ca9451.938a3771").toInstant(0); 134 Timestamp64.fromString("1db2d251.938a3771").toInstant(1); 269 Timestamp64 clientRequestTimestamp = Timestamp64.fromInstant( in checkCalculateClockOffset() 271 Timestamp64 clientResponseTimestamp = Timestamp64.fromInstant( in checkCalculateClockOffset() 273 Timestamp64 serverReceiveTimestamp = Timestamp64.fromInstant( in checkCalculateClockOffset() 275 Timestamp64 serverTransmitTimestamp = Timestamp64.fromInstant( in checkCalculateClockOffset() 503 Timestamp64 receiveTimestamp = Timestamp64.fromString(receiveTimestampString); in calculateIdealServerTime() 504 Timestamp64 transmitTimestamp = Timestamp64.fromString(transmitTimestampString); in calculateIdealServerTime()
|