Skip to content
Commit 845146b0 authored by Neil Fuller's avatar Neil Fuller
Browse files

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)
parent e57a8f33
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment