이 기능을 사용하면 Android Automotive 운영체제(AAOS) 또는 차량 시스템 중 어느 곳에서 Android로 시간을 동기화할 지 파트너가 선택할 수 있습니다.
고품질 구현을 위해 아래 설명된 새로운 VHAL 속성 2가지 중 하나를 사용하도록 AAOS를 구성하여 값을 효과적으로 전파할 수 있습니다. 다음 2가지를 사용합니다.
ANDROID_EPOCH_TIME은 Android를 시간 정보 소스로 사용합니다. VHAL은 Android에서 다른 차량 시스템(예: 전자 제어 장치(ECU), 차체 제어 모듈(BCM))으로 시간 변경사항을 전달하는 이 쓰기 전용 속성을 지원합니다.
EXTERNAL_CAR_TIME은 Android를 시간 정보 소스로 사용하지 않습니다. 이런 경우 VHAL은 다른 차량 시스템(예: ECU, BCM)에서 Android로 시간 변경사항을 전달하는 읽기 전용EXTERNAL_CAR_TIME 속성을 지원합니다.
AAOS는 Android 내에서 다양한 시간 소스의 우선순위를 지정할 수 있는 구성 가능한 TimeDetectorStrategy도 제공합니다.
시간 정보 소스인 Android
Android가 시간 소스로 사용될 때 OEM은 다른 자동차 시스템(ECU, BCM 등)을 Android 시간과 동기화할 수 있습니다.
이렇게 하려면 VHAL 구현이 쓰기 전용 속성 ANDROID_EPOCH_TIME 속성을 지원해야 합니다. Android는 부팅할 때와 Android의 시간 소스가 변경될 때마다 시스템 시간을 읽어 속성 업데이트를 게시합니다.
시간 정보 소스가 아닌 Android
Android가 시간 소스로 사용되지 않을 때는 Android 시간이 시간 정보 소스가 되도록 동기화할 수 있습니다(예: ECU나 BCM 사용). 이런 경우 VHAL 구현은 읽기 전용 속성 EXTERNAL_CAR_TIME을 지원하고 시간 소스가 시계를 변경하거나 재보정할 때마다 이 속성 업데이트를 게시해야 합니다.
또한 OEM은 다음을 확인해야 합니다.
config_autoTimeSourcesPriority 값이 core/res/res/values/config.xml에 포함됩니다.
CarServices 오버레이 구성 packages/services/Car/service/res/values/config.xml의 config_enableExternalCarTimeToExternalTimeSuggestion 속성이 true로 설정됩니다.
external 시간이 TimeDetectorStrategy 구성에서 적절한 우선순위를 가집니다. 자세한 내용은 GNSS 시간 감지를 참고하세요.
예를 들면 다음과 같습니다.
<!-- 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>
Android 내부 구현 세부정보
다음 흐름은 ANDROID_EPOCH_TIME VHAL 속성이 지원될 때 실행됩니다.
CarServices의 TimeHalService가 Android 시스템에서 Intent.ACTION_TIME_CHANGED의 브로드캐스트를 수신합니다.
TimeHalService는 ExternalTimeSuggestion을 만들어 TimeManager로 전송합니다.
TimeManager는 이 추천을 TimeDetectorService로 전달합니다.
TimeDetectorService는 TimeDetectorStrategy를 사용하여 새로운 시스템 시간을 선택합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-27(UTC)"],[],[],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."]]