हमारा सुझाव है कि 27 मार्च, 2025 से AOSP को बनाने और उसमें योगदान देने के लिए, aosp-main
के बजाय android-latest-release
का इस्तेमाल करें. ज़्यादा जानकारी के लिए, AOSP में हुए बदलाव लेख पढ़ें.
बाहरी समय का पता लगाने की सुविधा
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Android 12 से, Android के पास समय के बाहरी सोर्स का इस्तेमाल करने का विकल्प होता है. इससे वह time_detector
सेवा को Unix epoch समय का सुझाव दे सकता है.
AOSP में यह सुविधा डिफ़ॉल्ट रूप से चालू नहीं होती.
बाहरी टाइम ओरिजिन की मदद से, डिवाइस बनाने वाली कंपनियां Android को पूरी तरह से
कस्टम टाइम के सुझाव दे सकती हैं. बाहरी टाइम सोर्स से सुझाव मिलने के बाद, time_detector
सेवा यह तय करती है कि कॉन्फ़िगर किए गए प्राथमिकता के नियमों का इस्तेमाल करके सिस्टम क्लॉक को अपडेट करना है या नहीं.
लागू करना
बाहरी समय का पता लगाने की सुविधा को सपोर्ट करने के लिए, डिवाइस बनाने वाली कंपनियों को एक ऐसा कॉम्पोनेंट लागू करना होगा जो सिस्टम एपीआई कॉल के ज़रिए, time_detector
सेवा को बाहरी समय के सुझाव सबमिट करता हो.
बाहरी ऑरिजिन को कॉन्फ़िगर करने के लिए, core/res/res/values/config.xml
सिस्टम सर्वर कॉन्फ़िगरेशन फ़ाइल का इस्तेमाल करें. external
वैल्यू को config_autoTimeSourcesPriority
में जोड़ें.
इस उदाहरण में, Android को सिस्टम क्लॉक सेट करते समय, बाहरी समय के सुझावों को सबसे ज़्यादा प्राथमिकता देने के लिए कहा गया है. अगर समय के बारे में कोई मान्य बाहरी सुझाव उपलब्ध नहीं है, तो अगले ऑरिजिन, इस मामले में gnss
का इस्तेमाल किया जाता है.
<string-array name="config_autoTimeSourcesPriority">
<item>external</item>
<item>gnss</item>
</string-array>
सिस्टम को समय का कोई बाहरी सुझाव देने के लिए, TimeManager
में suggestExternalTime()
तरीके का इस्तेमाल करें. अगर कॉन्फ़िगरेशन फ़ाइल में config_autoTimeSourcesPriority
का इस्तेमाल करके बाहरी ऑरिजिन को कॉन्फ़िगर किया गया है और ज़्यादा प्राथमिकता वाले समय के सुझाव उपलब्ध नहीं हैं, तो Android, इस तरीके को पास किए गए टाइमस्टैंप का इस्तेमाल करके मौजूदा Unix epoch टाइम सेट करता है.
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-08-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-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."]]