自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
背景位置資訊存取權提醒
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Android 10 提供背景位置資訊存取提醒功能,可讓使用者瞭解應用程式存取裝置位置資訊的程度,並協助使用者控管這類存取權。在 Android 9 以下版本中,應用程式可以在背景執行時追蹤裝置位置,而使用者不會知道。使用者可以選取「僅在使用應用程式時允許」或「拒絕」位置存取權,在 Android 10 中抑制這項行為。
圖 1. 背景位置資訊存取權提醒。
當應用程式在背景執行時,存取受精確位置存取權方法 ACCESS_FINE_LOCATION
保護的資料時,系統會觸發提醒。為避免不必要的干擾,提醒事項不會在單一通知中顯示所有應用程式的所有背景活動。使用者最多會看到一則提醒,當存取要求觸發背景位置資訊存取提醒時,提醒會在當天稍晚、隔天或更晚顯示,具體取決於需要推送的提醒總數。舉例來說,共 3 則通知需要 72 小時才會顯示。
系統不會針對下列情況觸發通知:
- 預設授予權限的應用程式,例如系統服務。
- 已授予「一律允許」位置資訊存取權的應用程式,且已在背景首次存取裝置位置資訊。
- 僅在前景接收位置更新的應用程式。
- 僅接收概略位置更新的應用程式。
根據預設,大多數預先安裝的應用程式都會獲得權限。您不需要採取任何行動即可實作背景位置資訊存取提醒功能,也無法自訂這項功能。這項功能已通過 CTS 測試。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。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,["# Background location access reminder\n\nAndroid 10 features a background access location reminder, which\nincreases transparency into how much access apps have to a device's location and helps users\nmaintain control over such access. In Android 9 and lower, an app can track a device's location\nwhile running in the background without the user's knowledge. Users can suppress this behavior in\nAndroid 10 by\nselecting either the **Allow only while using the App** or **Deny**\nlocation access permission.\n\n**Figure 1.** Background location access reminder.\n\nA reminder gets triggered when an app accesses data protected by the fine-location permission\nmethod [`ACCESS_FINE_LOCATION`](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)\nwhile in the background. To prevent unnecessary interruptions to the user, the reminder doesn't\nshow all background activity for all apps in a single notification. The user sees one reminder\nper day, maximum. When an access request triggers the background location access reminder, it\nshows either later in the same day, the next day, or days later, depending on\nhow many total reminders needed to be pushed. For example, a total of 3\nnotifications takes 72 hours to show.\n\nNotifications aren't triggered for the following:\n\n- Apps that have permission granted by default, such as system services.\n- Apps that are granted **Allow all the time** location access permission, that have already accessed the device location in the background for the first time.\n- Apps that receive location updates in the foreground only.\n- Apps that receive coarse-location updates only.\n\nMost preinstalled apps have their permissions granted by default. You don't\nneed to take any action to implement the background location access reminder\nfeature, and you can't customize it. This feature is tested by CTS."]]