اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release بدلاً من aosp-main لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تتيح هذه الميزة للشركاء اختيار كيفية مزامنة الوقت، سواء من نظام التشغيل Android
Automotive (AAOS) أو من أنظمة المركبات إلى Android.
لضمان جودة عمليات التنفيذ، يمكنك ضبط AAOS لاستخدام أحد سمتَي VHAL الجديدتَين описанتين أدناه لنشر القيم بفعالية. الاستخدام:
ANDROID_EPOCH_TIMEاستخدام Android كمصدر المعلومات الصحيحة
للوقت يتيح VHAL هذه السمة للكتابة فقط، والتي تنقل التغييرات الزمنية
من Android إلى أنظمة المركبات الأخرى، مثل وحدات التحكّم الإلكتروني
(ECU) ووحدة التحكّم في الجسم (BCM).
EXTERNAL_CAR_TIMEعدم استخدام نظام Android كمصدر
للحقيقة المتعلّقة بالوقت في هذه الحالة، يتيح VHAL السمة للقراءة فقطEXTERNAL_CAR_TIME، التي تنقل التغييرات في الوقت من أنظمة
المركبات الأخرى (مثل وحدات التحكّم الإلكتروني بالمحرك وBCM) إلى Android.
توفّر AAOS أيضًا TimeDetectorStrategy قابل للضبط لمساعدتك في إعطاء الأولوية
لمصادر الوقت المختلفة داخل Android.
Android هو مصدر المعلومات الصحيحة عن الوقت
عند استخدام Android كمصدر للوقت، يمكن لمصنّعي السيارات الأصليين مزامنة أنظمة السيارة الأخرى (بما في ذلك
وحدات التحكّم الإلكتروني بالمحرك ووحدة التحكّم في شبكة الوسائط) مع وقت Android.
لإجراء ذلك، يجب أن يتيح تنفيذ VHAL سمة الكتابة فقطANDROID_EPOCH_TIME. ينشر Android تعديلاً على السمة من خلال قراءة
وقت النظام، سواء في وقت التشغيل أو عند تغيير مصدر الوقت في Android.
Android ليس مصدرًا موثوقًا للوقت
عندما لا يتم استخدام Android كمصدر للوقت، يمكنك مزامنة وقت Android
ليكون مصدرًا دقيقًا للوقت (على سبيل المثال، باستخدام وحدة التحكّم الإلكترونية أو وحدة التحكّم في الجسم). في هذه الحالة، يجب أن يتوافق تنفيذ VHAL مع الموقع للقراءة فقط EXTERNAL_CAR_TIME وأن ينشر تعديلات على هذا الموقع كلما تغيّر مصدر الوقت أو تمت إعادة ضبط الساعة.
على المصنّعين الأصليين للأجهزة أيضًا التأكّد مما يلي:
يتم تضمين قيم config_autoTimeSourcesPriority في
core/res/res/values/config.xml.
تم ضبط السمة config_enableExternalCarTimeToExternalTimeSuggestion في
إعدادات التراكب في CarServices packages/services/Car/service/res/values/config.xml
على true.
<!-- 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
تحدث العملية التالية عند توفّر سمة VHAL في ANDROID_EPOCH_TIME:
يتلقّى TimeHalService (في CarServices) بثًا من نظام Android لأجل
Intent.ACTION_TIME_CHANGED.
تنشر شركة TimeHalService تعديلاً على موقع VHAL
ANDROID_EPOCH_TIME.
يمكن لوحدة التحكّم في الإضاءة (VHAL) نشر قيمة الوقت التي تمّ تلقّيها إلى وحدات التحكّم في الإشعال (ECU) و/أو وحدات التحكّم في شبكة الأنظمة (BCM) المختلفة.
تحدث العملية التالية عند توفّر سمة VHAL في EXTERNAL_CAR_TIME:
يعدّل VHAL السمة EXTERNAL_CAR_TIME.
يقرأ TimeHalService (في CarServices) السمة من خلال اشتراك.
أنشأ TimeHalServiceExternalTimeSuggestion وأرسله إلى
TimeManager.
يعيد TimeManager توجيه الاقتراح إلى TimeDetectorService.
يستخدم TimeDetectorServiceTimeDetectorStrategy لاختيار
وقت نظام جديد.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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."]]