| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the ability to configure NTP port for tests via the command line and
the associated plumbing / knock-ons.
In-progress CTS tests will run a fake NTP server on the device itself.
Binding to NTP's default port of 123 is restricted. Therefore, we need
to be able to override the port for tests.
adb shell cmd network_time_update_service set_server_config --port 9999
adb shell dumpsys network_time_update_service
<observe port value>
adb shell cmd network_time_update_service force_refresh
<observe false>
adb shell cmd network_time_update_service set_server_config
adb shell dumpsys network_time_update_service
<observe port value>
adb shell cmd network_time_update_service force_refresh
<observe true>
Bug: 213393821
Test: See above
Change-Id: I21e8b735fab268df0d617848b8a562f86560ad16
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix issue with SntpClient after the end of NTP era 0 (2036).
This is the second of two commits. This commit makes the actual fixes
and makes tests pass.
Before this change SntpClient converted to Unix epoch times too eagerly.
NTP 64-bit timestamps are lossy: they only hold the number of seconds /
factions of seconds in the NTP era and the era is not transmitted. The
existing code assumed the era was always era 0, which ends in 2036.
As explained at https://www.eecis.udel.edu/~mills/y2k.html,
the lossiness of the type is not an issue providing that the maths is
implemented carefully: the NTP timestamps are only ever subtracted from
each other, are always assumed to be in the same or adjacent NTP eras,
and are used to calculate offsets that are applied to client Unix epoch
times.
This commit:
+ Switches to use a dedicated Timestamp64 type, avoiding the use
of the Unix epoch.
+ Switches to use a dedicated Duration64 type for holding the
32-bit signed difference between two Timestamp64 instances.
+ Simplifies the readTimeStamp() and writeTimeStamp() methods.
+ Adds missing validation covered by a TODO. The code was randomizing
the lower bits of the client transmit timestamp, but then not checking
the result as it should, presumably because it was difficult to know
what value was sent. Easily fixed with a dedicated type.
+ Stops randomizing the lower bits of various other timestamps
unnecessarily.
+ Fixes some naming to add clarity.
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
Merged-In: I6d3584f318b0ef6ceab42bb88f20c73b0ad006cb
Change-Id: I6d3584f318b0ef6ceab42bb88f20c73b0ad006cb
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Merged-In: Ifdaada39298b05c48a3207fe6c0fad71c8a0a252
Change-Id: Ifdaada39298b05c48a3207fe6c0fad71c8a0a252
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Changed to refer multiple addresses as a fail-safe and added to check
reference timestamp of ntp packet.
Bug: 139905217
Test: sync time by NTP after AC off/on.
Change-Id: I5ae5eca85ca679eded9d7878fb07a7b7617b2596
|
| |/
|
|
|
|
|
|
|
| |
See https://source.android.com/setup/contribute/respectful-code
for reference.
Bug: 161896447
Test: m
Change-Id: I6c3c03c0c2d1302af6d5245486823c13a3432900
|
| |
|
|
|
|
|
|
|
| |
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.
Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I0c336de56bc4a041dc97ff9b7927f62f0b44b457
Merged-In: I0c336de56bc4a041dc97ff9b7927f62f0b44b457
|
| |
|
|
|
|
|
|
|
|
|
|
| |
go/cleanup-greylist-txt
These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code.
Bug: 137350495
Test: m
Change-Id: Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09
Merged-In: Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09
|
| |
|
|
|
|
|
|
|
|
|
|
| |
As per API council feedback, these constants should live in
a place that is private to the network stack, only with a
range defined in system API.
Bug: 129433383
Test: m
Change-Id: I84a90f84a9af6fef4667ee4d512ebd0413222086
Merged-In: I4882686a86e7c6d42f4b0619b921d02619ed6d4c
Merged-In: I9b648ed6c687d56db61a54570c7880c51c1bae51
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the Private DNS bypass logic that was moved into Network.
Once all callers of ResolvUtil are updated to use this interface
ResolvUtil can be deleted.
Test: as follows
- built, flashed, booted
- runtest frameworks-net passes
- connection to captive portal network detects portal correctly
and the login activity functions as expected
Bug: 64133961
Bug: 72345192
Bug: 73872000
Bug: 78548486
Change-Id: If11ef2b5ffdc729f8449cf18dccd5f1eccbc51e6
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For packages:
android.net.wimax
android.net.wifi.p2p.nsd
android.net.wifi.p2p
android.net.wifi.hotspot2.pps
android.net.wifi.hotspot2.omadm
android.net.wifi.hotspot2
android.net.wifi.aware
android.net.wifi
android.net.util
android.net.sip
android.net.rtp
android.net.nsd
android.net.metrics
android.net.lowpan
android.net.http
android.net.captiveportal
android.net
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: Ie25423113ee1a8071cd5039382c00de6ce0af7fd
Merged-In: I520be7a4c79e68310c12e4f55bf66acaa94145a1
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NTP may be necessary in order to validate Private DNS certificates,
so it should be allowed to bypass Private DNS.
Test: as follows
- built, flashed, booted
- tcpdump for port 53; adb shell am restart
queries for the NTP hostname appear in the clear
- runtest frameworks-net passes
Bug: 64133961
Bug: 80118648
Merged-In: I4655e3ce5691098c73bf070b8a9e4759485bb17a
Merged-In: I327b816a9f472e94328232157a3b8887d17b0baf
Change-Id: Id9ceb3fcaaffb48cbbd4cd381d48cae991572c9e
(cherry picked from commit 7eccfeb9ca60aa6e09afbdf3a4435cb2f0d12987)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Permits syncing over a specific network instead of the default for
the process. This was causing an issue with Android Wear devices
paired with iOS where the default network is bluetooth
(see b/32663274).
This CL is in support of ag/3776564
Bug: 32663274
Test: adb shell am instrument -e class android.net.SntpClientTest -w \
com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
(cherry-pick of pi-dev Ic9fc169cf75457810d4992121d85d7642e350b90)
Merged-In: I339c77063c72a9d76a5c4cb17052e20fb6e045a6
Merged-In: I8dfd1cad99c63efdc14c174c19f094a61cdfc44f
Change-Id: I44df66688292b144ec7dfcdd9ae5d82489f82774
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Network usage is tracked by the kernel at the UID level, which is
granular enough for normal apps, but large components (such as the
system server) are impossible to debug without adding additional
socket tagging to help identify subsystems within a UID.
To help ensure that system components tag all their network traffic,
this change offers a new StrictMode option to detect and report
untagged sockets.
Test: builds, boots, all common traffic tagged
Bug: 30943431, 30414041
Change-Id: I825c7941076054732264690247de2863342638e2
|
| |
|
|
|
|
|
|
| |
Also add logging to measure success/failure details.
Test: builds, boots, and NTP fix obtained
Bug: 32969463
Change-Id: I66a8a78480e087acdcf8a11e79f80b7a7a4969c9
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per RFC 4330, a NTP server response should be discarded when:
- the stratum is 0 (unspecified), or
- the leap indicator is 3 (unsync'ed), or
- the mode is not 4 (server) / 5 (broadcast), or
- the transmitted time is 0.
Update SntpClient so that such responses would be discarded.
Additionally:
- make some variables suitably "final"
- enable logging
- add alternate requestTime() for testing
- add some miniscule test coverage
Cherry-picked from Jerry Wong's
https://partner-android-review.googlesource.com/#/c/460074
Bug: 24719581
Change-Id: Id11a79a6e53ce95500ed4b4d691a29c260666f6c
|
| |
|
|
| |
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
|
| |
|
|
|
|
| |
since before 1.0.
Change-Id: Ic2e8fa68797ea9d486f4117f3d82c98233cdab1e
|
| |
|
|
|
|
|
|
|
|
|
| |
When a DNS lookup fails, we end up creating a datagram socket
but never properly close it. This wastes limited valuable file
descriptors and causes CTS test failures. Generally, we should
ensure that sockets or files are opened in a try block, and closed
in a finally block.
Bug: 3276283
Change-Id: I3432f3bc061268c7367948230f6edbdfcec55892
|
| |
|
|
|
|
|
| |
Removing unwanted sntp logging and throttle logging.
bug:2614927
Change-Id: Ic0b1c3502ebbc1f04130d09d715591af6513f439
|
| |
|
|
|
|
|
|
|
| |
Old calc was off by 2x and was affected by the user-settable system clock. The error
came because it was calculating the offset between our clock and the NTP clock and the algebra
had two factors of the offset instead of the desired 1.
bug:2600010
Change-Id: I0856091d32b50e6909e4889fb98df819e0aeabbe
|
| | |
|
| | |
|
| |
|