<!-- Specifies priority of automatic time sources. Suggestions from higher entries in the list take precedence over lower ones.
See com.android.server.timedetector.TimeDetectorStrategy for available sources. -->
<string-array name="config_autoTimeSourcesPriority">
<item>external</item>
<item>gnss</item>
<item>network</item>
<item>telephony</item>
</string-array>
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Configure AAOS time sources\n\nThis feature enables partners to choose how to synchronize time, whether from the Android\nAutomotive Operating System (AAOS) **or** from vehicular systems to Android.\nTo ensure quality implementations, you can configure AAOS to use one of the two new VHAL properties\ndescribed below to propagate the values effectively. Use:\n\n- `ANDROID_EPOCH_TIME` to **use** Android as the source of truth for time. The VHAL supports this *write-only* property, which communicates time changes from Android to other vehicular systems, such as the Electronic Control Units (ECU) and the Body Control Module (BCM).\n- `EXTERNAL_CAR_TIME` to **not use** Android as the source of truth for time. In this case, the VHAL supports the *read-only* `EXTERNAL_CAR_TIME` property, which communicates time changes from other vehicular systems (such as ECUs and BCM) to Android.\n\n| **Warning:** If you opt to support both properties (not recommended), the VHAL must **never** publish values to `EXTERNAL_CAR_TIME` that are dependent on `ANDROID_EPOCH_TIME`.\n\nAAOS also provides a configurable `TimeDetectorStrategy` to help you prioritize\ndifferent time sources within Android.\n\n### Android is the source of truth for time\n\nWhen Android is used as the source of time, OEMs can synchronize other car systems (including\nECUs and a BCM) with Android time.\n\nTo do so, the VHAL implementation must support the *write-only* property\n`ANDROID_EPOCH_TIME` property. Android publishes an update to the property by reading\nsystem time, both at boot time and whenever the time source in Android is changed.\n\n### Android is not the source of truth for time\n\nWhen Android is **not** used as the source of time, you can synchronize Android time\nto be the source of truth for time (for example, with an ECU or the BCM). In this case, the\nVHAL implementation must support the read-only property `EXTERNAL_CAR_TIME` and publish\nupdates to this property whenever the source of time changes or recalibrates the clock.\n\nOEMs must also ensure that:\n\n- The `config_autoTimeSourcesPriority` values are contained in `core/res/res/values/config.xml`.\n- The `config_enableExternalCarTimeToExternalTimeSuggestion` property in the CarServices overlay configs `packages/services/Car/service/res/values/config.xml` is set to `true`.\n- `external` time has the appropriate priority in the `TimeDetectorStrategy` configuration. To learn more, see [GNSS Time Detection](/devices/tech/connect/time/gnss-time-detection#implement). For example: \n\n ```scdoc\n \u003c!-- Specifies priority of automatic time sources. Suggestions from higher entries in the list take precedence over lower ones.\n See com.android.server.timedetector.TimeDetectorStrategy for available sources. --\u003e\n \u003cstring-array name=\"config_autoTimeSourcesPriority\"\u003e\n \u003citem\u003eexternal\u003c/item\u003e\n \u003citem\u003egnss\u003c/item\u003e\n \u003citem\u003enetwork\u003c/item\u003e\n \u003citem\u003etelephony\u003c/item\u003e\n \u003c/string-array\u003e\n ```\n\n| The VHAL implementation must **not** publish updates for the natural progression of time.\n\nAndroid internal implementation details\n---------------------------------------\n\nThe following flow takes place when the `ANDROID_EPOCH_TIME` VHAL property is\nsupported:\n\n1. `TimeHalService` (in CarServices) receives a broadcast from the Android system for `Intent.ACTION_TIME_CHANGED`.\n2. `TimeHalService` publishes an update to the VHAL Property `ANDROID_EPOCH_TIME`.\n3. The VHAL can propagate the time value received to various ECUs and/or BCM units.\n\nThe following flow takes place when the `EXTERNAL_CAR_TIME` VHAL property is\nsupported:\n\n1. VHAL updates the `EXTERNAL_CAR_TIME` property.\n2. `TimeHalService` (in CarServices) reads the property through a subscription.\n3. `TimeHalService` creates and sends an `ExternalTimeSuggestion` to `TimeManager`.\n4. `TimeManager` forwards the suggestion to `TimeDetectorService`.\n5. `TimeDetectorService` uses `TimeDetectorStrategy` to choose a new system time."]]