android_packages_modules_Co.../thread/framework
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Kangping Dong 160b4d38f9 [Thread] fix OperationalDatasetTimestamp#toTlvValue is not loss-less
OperationalDatasetTimestamp is saving the timestamp as an Instant
object, and this has the problem that when the dataset timestamp is
written to a TLV, it's going to loss precision as the nanoseconds
of the Instant is converted to "Ticks". This results in bug that
the dataset timestamp doesn't equal to the same value when it's
converted back from a TLV:

```
var timestamp1 = OperationalDatasetTimestamp.fromInstant(Instant.ofEpochSecond(100, 999938900));
byte[] tlv = timestamp1.toTlvValue();
timestamp2 = OperationalDatasetTimestamp.fromTlvValue(tlv);

assertThat(timestamp2).isEqualTo(timestamp1); // This fails!!!
```

Bug: 308408536
Test: atest ThreadNetworkUnitTests CtsThreadNetworkTestCases
Change-Id: I81b482a05337b6d1150edaa28b860034592a4347
2023-11-07 13:13:06 +08:00
..
java/android/net/thread [Thread] fix OperationalDatasetTimestamp#toTlvValue is not loss-less 2023-11-07 13:13:06 +08:00
Android.bp [Thread] move Thread into com.android.tethering 2023-08-23 14:28:50 +08:00