27 মার্চ, 2025 থেকে, আমরা AOSP তৈরি করতে এবং অবদান রাখতে aosp-main এর পরিবর্তে android-latest-release ব্যবহার করার পরামর্শ দিচ্ছি। আরও তথ্যের জন্য, AOSP-তে পরিবর্তনগুলি দেখুন।
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
অ্যান্ড্রয়েড 12 এবং উচ্চতর সংস্করণে, অ্যান্ড্রয়েড ঐচ্ছিকভাবে একটি গ্লোবাল নেভিগেশন স্যাটেলাইট সিস্টেম (জিএনএসএস) ব্যবহার করতে পারে যাতে time_detector পরিষেবাতে ইউনিক্স যুগের সময় প্রস্তাব করা যায়। এটি AOSP-এ ডিফল্টরূপে সক্ষম নয়।
যখন GNSS সময় সনাক্তকরণ সক্ষম করা হয়, gnss_time_update_service নিষ্ক্রিয়ভাবে GNSS উত্স থেকে অবস্থানের আপডেটগুলি শোনে এবং time_detector পরিষেবাতে GNSS পরামর্শ জমা দেয়৷ time_detector পরিষেবা তারপর নির্ধারণ করে যে পরামর্শের সাথে মেলে সিস্টেম ঘড়ি আপডেট করা হবে কিনা।
শক্তি ব্যবহারের উপর প্রভাব
AOSP gnss_time_update_service নিষ্ক্রিয়ভাবে অবস্থানের আপডেট শোনে। এর মানে হল যে পরিষেবাটি সক্রিয়ভাবে GPS চালু করে না বা অতিরিক্ত শক্তি খরচ করে না। এর মানে হল যে সিস্টেমে অন্য অ্যাপ বা পরিষেবা সক্রিয়ভাবে অবস্থান আপডেটের অনুরোধ না করলে, gnss_time_update_service একটি অবস্থান আপডেট পাবে না এবং একটি GNSS সময় প্রস্তাব করবে।
বাস্তবায়ন
GNSS সময় সনাক্তকরণ সক্ষম করতে, ডিভাইস নির্মাতাদের অবশ্যই সিস্টেম সার্ভারে স্পষ্টভাবে gnss_time_update_service সক্ষম করতে হবে।
এই বৈশিষ্ট্যটি সক্ষম করতে core/res/res/values/config.xml ফাইলের config_enableGnssTimeUpdateService এবং config_autoTimeSourcesPriority মান উভয়ই আপডেট করতে হবে। config_enableGnssTimeUpdateService এর মান true সেট করুন এবং config_autoTimeSourcesPriority এর জন্য আইটেম তালিকায় gnss যোগ করুন। অগ্রাধিকার তালিকায় gnss এর অবস্থান অন্যান্য উত্স থেকে GNSS পরামর্শের ক্ষেত্রে অগ্রাধিকার নির্ধারণ করে।
নিচের একটি উদাহরণ core/res/res/values/config.xml ফাইল যেখানে GNSS সময় সনাক্তকরণ সক্ষম করা হয়েছে এবং gnssnetwork এবং telephony পরে অগ্রাধিকার তালিকায় তৃতীয় স্থানে রয়েছে:
GNSS সময় সনাক্তকরণ পরীক্ষা করতে, adb shell cmd location কমান্ড ব্যবহার করুন। পরীক্ষা অবস্থান প্রদানকারী যোগ করতে এই কমান্ডগুলি ব্যবহার করুন যেখানে আপনি একটি অবস্থান এবং সংশ্লিষ্ট GNSS সময় নির্দিষ্ট করতে পারেন। gnss_time_update_service এই অবস্থানের আপডেটগুলি শোনে এবং পর্যায়ক্রমে পরামর্শ দেয়।
ফোরগ্রাউন্ড ব্যবহারকারীর জন্য মাস্টার অবস্থান সুইচ সক্ষম করুন (সাধারণত স্বয়ংচালিত ব্যবহারকারী 10 )। আপনি যদি এইমাত্র ফ্ল্যাশ করেন তবে এটি সেটআপ উইজার্ডের মাধ্যমে করা যেতে পারে।
GPS পরীক্ষা প্রদানকারী যোগ করুন (সাধারণত প্রথমবার ব্যর্থ হয় এবং android from <SOME_UID> not allowed to perform MOCK_LOCATION এর সাথে একটি নিরাপত্তা ব্যতিক্রম ছুড়ে দেয়)
adbshellcmdlocationprovidersadd-test-providergps
পূর্ববর্তী UID-এর জন্য মক অবস্থান অনুমতি সক্ষম করুন
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-09-03 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-09-03 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["In Android 12 and higher, Android can optionally use a\nGlobal Navigation Satellite System (GNSS) to suggest Unix epoch times to the\n[`time_detector`](/docs/core/connect/time#time_detector-service) service.\nThis isn't enabled by default in AOSP.\n\nWhen GNSS time detection is enabled, the `gnss_time_update_service` passively\nlistens to location updates from GNSS sources and submits GNSS suggestions to\nthe `time_detector` service. The `time_detector` service then determines whether\nto update the system clock to match the suggestion.\n\nImpact on power usage\n\nThe AOSP `gnss_time_update_service` passively listens to location updates. This\nmeans that it never actively turns on the GPS or consumes additional power. This\nalso means that unless another app or service in the system is actively\nrequesting location updates, the `gnss_time_update_service` won't get a location\nupdate and suggest a GNSS time.\n\nImplementation\n\nTo enable GNSS time detection, device manufacturers must explicitly enable the\n`gnss_time_update_service` in the system server.\n\nBoth the `config_enableGnssTimeUpdateService` and\n`config_autoTimeSourcesPriority` values in the `core/res/res/values/config.xml`\nfile must be updated to enable this feature. Set the value for\n`config_enableGnssTimeUpdateService` to `true` and add `gnss` to the item list\nfor `config_autoTimeSourcesPriority`. The position of `gnss` in the priority\nlist determines the priority given to GNSS suggestions with respect to those\nfrom other sources.\n\nThe following is an example `core/res/res/values/config.xml` file where GNSS\ntime detection is enabled and `gnss` is third in the priority list after\n`network` and `telephony`. \n\n \u003c!-- Specifies priority of automatic time sources. Suggestions from higher entries in the list\n 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\u003enetwork\u003c/item\u003e\n \u003citem\u003etelephony\u003c/item\u003e\n \u003citem\u003egnss\u003c/item\u003e\n \u003c/string-array\u003e\n\n \u003c!-- Enables the GnssTimeUpdate service. This is the global switch for enabling Gnss time based\n suggestions to TimeDetector service. See also config_autoTimeSourcesPriority. --\u003e\n \u003cbool name=\"config_enableGnssTimeUpdateService\"\u003etrue\u003c/bool\u003e\n\nDebugging and testing **Note:** The interface for these commands might change between releases. Use the `help` flag to see a list of command options.\n\nTo test GNSS time detection, you can use `adb shell cmd location` commands.\nUse these commands to add test location providers where you can specify a\nlocation and the associated GNSS time. The `gnss_time_update_service` listens to\nthese location updates, and makes suggestions periodically.\n\nThe following shows examples of `adb shell cmd location` commands: \n\n # Enable Master Location Switch in the foreground user (usually user 10 on automotive). If you just flashed, this can be done through setup wizard.\n adb shell cmd location set-location-enabled true --user 10\n\n # Add GPS test provider (This usually fails the first time. Throws a SecurityException with \"android from \u003cSOME_UID\u003e not allowed to perform MOCK_LOCATION\".)\n adb shell cmd location providers add-test-provider gps\n\n # Enable mock location permissions for previous UID\n adb shell appops set \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eUID_PRINTED_IN_PREVIOUS_ERROR\u003c/span\u003e\u003c/var\u003e android:mock_location allow\n\n # Add GPS test provider (Should work with no errors.)\n adb shell cmd location providers add-test-provider gps\n\n # Enable GPS test provider\n adb shell cmd location providers set-test-provider-enabled gps true\n\n # Set location with time (Time can't be lower than the limit set by the lower bound.)\n adb shell cmd location providers set-test-provider-location gps --location \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eLATITUDE\u003c/span\u003e\u003c/var\u003e,\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eLONGITUDE\u003c/span\u003e\u003c/var\u003e --time \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eTIME\u003c/span\u003e\u003c/var\u003e"]]