27 Mart 2025'ten itibaren AOSP'yi derlemek ve AOSP'ye katkıda bulunmak için aosp-main
yerine android-latest-release
kullanmanızı öneririz. Daha fazla bilgi için AOSP'de yapılan değişiklikler başlıklı makaleyi inceleyin.
Harici zaman algılama
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Android 12'den itibaren Android, time_detector
hizmetine Unix epoch zamanlarını önermek için isteğe bağlı olarak harici bir zaman kaynağı kullanabilir.
Bu özellik, AOSP'de varsayılan olarak etkin değildir.
Harici zaman kaynağı, cihaz üreticilerinin Android'e tamamen özel zaman önerileri sunmasına olanak tanır. time_detector
hizmeti, harici zaman kaynağına ait önerileri aldıktan sonra yapılandırılmış önceliklendirme kurallarını kullanarak sistem saatini güncelleyip güncellemeyeceğine karar verir.
Uygulama
Harici zaman algılamayı desteklemek için cihaz üreticileri, sistem API çağrısı aracılığıyla time_detector
hizmetine harici zaman önerileri gönderen bir bileşen uygulamalıdır.
Harici kaynağı yapılandırmak için core/res/res/values/config.xml
sistem sunucusu yapılandırma dosyasını kullanın. external
değerini config_autoTimeSourcesPriority
öğesine ekleyin.
Aşağıdaki örnekte, Android'e sistem saatini ayarlarken harici saat önerilerine en yüksek önceliği vermesi söyleniyor. Geçerli bir harici zaman önerisi yoksa bir sonraki kaynak (bu örnekte gnss
) kullanılır.
<string-array name="config_autoTimeSourcesPriority">
<item>external</item>
<item>gnss</item>
</string-array>
Sisteme harici bir zaman önerisi sunmak için TimeManager
içinde suggestExternalTime()
yöntemini kullanın. Harici kaynak, yapılandırma dosyasında config_autoTimeSourcesPriority
kullanılarak yapılandırılmışsa ve daha yüksek öncelikli zaman önerileri yoksa Android, geçerli Unix dönemi zamanını ayarlamak için bu yönteme iletilen zaman damgasını kullanır.
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-08-27 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-08-27 UTC."],[],[],null,["From Android 12, Android can optionally use an external\nsource of time to suggest Unix epoch times to the [`time_detector`](/docs/core/connect/time#time_detector-service) service.\nThis isn't enabled by default in AOSP.\n\nThe *external* time origin allows device manufacturers to provide completely\ncustom time suggestions to Android. After receiving suggestions from the\nexternal time origin, the `time_detector` service determines whether to update\nthe system clock using the configured [prioritization rules](/docs/core/connect/time#automatic-time).\n\nImplementation\n\nTo support external time detection, device manufacturers must implement a\ncomponent that submits external time suggestions to the `time_detector` service\nthrough a system API call.\n\nTo configure the external origin, use the `core/res/res/values/config.xml`\nsystem server configuration file. Add the value `external` to\n`config_autoTimeSourcesPriority`.\n\nThe following example tells Android to give external time suggestions the\nhighest priority when setting the system clock. If there is no valid external\ntime suggestion available then the next origin, `gnss` in this case, is used. \n\n \u003cstring-array name=\"config_autoTimeSourcesPriority\"\u003e\n \u003citem\u003eexternal\u003c/item\u003e\n \u003citem\u003egnss\u003c/item\u003e\n \u003c/string-array\u003e\n\nTo provide the system with an external time suggestion, use the\n[`suggestExternalTime()`](https://cs.android.com/android/platform/superproject/+/android-latest-release:frameworks/base/core/java/android/app/time/TimeManager.java?q=%22void%20suggestExternalTime%22) method in `TimeManager`. If the external origin is\nconfigured using `config_autoTimeSourcesPriority` in the configuration file and\nno higher priority time suggestions are available, Android uses the timestamp\npassed to this method to set the current Unix epoch time."]]