<!-- 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>network</item>
<item>telephony</item>
<item>gnss</item>
</string-array>
<!-- Enables the GnssTimeUpdate service. This is the global switch for enabling Gnss time based
suggestions to TimeDetector service. See also config_autoTimeSourcesPriority. -->
<bool name="config_enableGnssTimeUpdateService">true</bool>
#EnableMasterLocationSwitchintheforegrounduser(usuallyuser10onautomotive).Ifyoujustflashed,thiscanbedonethroughsetupwizard.adbshellcmdlocationset-location-enabledtrue--user10#AddGPStestprovider(Thisusuallyfailsthefirsttime.ThrowsaSecurityExceptionwith"android from <SOME_UID> not allowed to perform MOCK_LOCATION".)adbshellcmdlocationprovidersadd-test-providergps#EnablemocklocationpermissionsforpreviousUIDadbshellappopssetUID_PRINTED_IN_PREVIOUS_ERRORandroid:mock_locationallow#AddGPStestprovider(Shouldworkwithnoerrors.)adbshellcmdlocationprovidersadd-test-providergps#EnableGPStestprovideradbshellcmdlocationprovidersset-test-provider-enabledgpstrue#Setlocationwithtime(Timecan'tbelowerthanthelimitsetbythelowerbound.)adbshellcmdlocationprovidersset-test-provider-locationgps--locationLATITUDE,LONGITUDE--timeTIME
[[["เข้าใจง่าย","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,["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"]]