-
- Downloads
Make NtpTrustedTime safer / expand docs
This commit makes a number of changes: 1) Documents / enforces thread safety, removes or deprecates unsafe check-then-do methods / adds a way to get the NTP query result atomically. 2) Delays configuration lookup until point of use: the config can change due to various possible config overlays, e.g. MCC-based config. (1) is because the threading model is currently unclear / possibly unsafe - it looks like NtpTrustedTime is supposed to be single threaded but it's also a singleton so could be accessed from multiple threads. If NtpTrustedTime were not a singleton things might be easier but the @UnsupportedAppUsage makes it difficult to change now. (2) is to address the same issue as https://r.android.com/1182530, contributed by Luca Stefani. Bug: 140712361 Test: build only Merged-In: Ie09da9db5d853b59829886a020de21a88da5dd51 Change-Id: Ie09da9db5d853b59829886a020de21a88da5dd51 (cherry picked from commit 65f0f31b)
Showing
- core/java/android/util/NtpTrustedTime.java 198 additions, 98 deletionscore/java/android/util/NtpTrustedTime.java
- core/java/android/util/TrustedTime.java 16 additions, 10 deletionscore/java/android/util/TrustedTime.java
- services/core/java/com/android/server/AlarmManagerService.java 3 additions, 2 deletions...ces/core/java/com/android/server/AlarmManagerService.java
- services/core/java/com/android/server/NetworkTimeUpdateServiceImpl.java 11 additions, 5 deletions...java/com/android/server/NetworkTimeUpdateServiceImpl.java
- services/core/java/com/android/server/location/NtpTimeHelper.java 9 additions, 8 deletions.../core/java/com/android/server/location/NtpTimeHelper.java
- services/robotests/src/com/android/server/location/NtpTimeHelperTest.java 12 additions, 5 deletions...ts/src/com/android/server/location/NtpTimeHelperTest.java
Loading
Please register or sign in to comment