From Android 12, Android can optionally use an external
source of time to suggest Unix epoch times to the
time_detector service. This isn't
enabled by default in AOSP.
The external time origin allows device manufacturers to provide completely
custom time suggestions to Android. After
receiving suggestions from the external time origin, the
determines whether to update the system clock using the configured
To support external time detection, device manufacturers must implement a
component that submits external time suggestions to the
service through a system API call.
To configure the external origin, use the
system server configuration file. Add the value
The following example tells Android to give external time suggestions the
highest priority when setting the system clock. If there is no valid external
time suggestion available then the next origin,
gnss in this case, is used.
<string-array name="config_autoTimeSourcesPriority"> <item>external</item> <item>gnss</item> </string-array>
To provide the system with an external time suggestion, use the
TimeManager. If the external origin is configured using
config_autoTimeSourcesPriority in the configuration file and no higher
priority time suggestions are available, Android uses the
timestamp passed to this method to set the current Unix epoch time.