自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
后台位置信息访问权限提醒
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Android 10 具有后台位置信息访问权限提醒功能,该功能有助于用户更好地了解应用对设备的位置信息有多大的访问权限,并且有助于用户保持对此类访问权限的控制。在 Android 9 及更低版本中,应用在后台运行时,可以在用户不知情的情况下跟踪设备的位置。在 Android 10 中,用户可以选择仅在使用该应用时允许或拒绝位置信息访问权限,从而抑制此行为。
图 1. 后台位置信息访问权限提醒。
当应用在后台访问由精确位置信息权限方法 ACCESS_FINE_LOCATION
保护的数据时,会触发提醒。为了防止对用户造成不必要的干扰,该提醒不会在一个通知中显示所有应用的所有后台活动。用户每天最多只能看到一个提醒。当访问权限请求触发后台位置信息访问权限提醒时,提醒会在同一天晚些时候、第二天或者几天后显示,具体取决于需要推送的提醒总数。例如,3 个通知需要 72 小时才能完成显示。
以下应用不会触发通知:
- 默认获得权限的应用,例如系统服务。
- 已获得始终允许位置信息访问权限的应用,这些应用已完成首次在后台访问设备位置信息。
- 仅在前台接收位置信息更新的应用。
- 仅接收粗略位置信息更新的应用。
大多数预安装应用已默认获得权限。您无需采取任何操作来实现后台位置信息访问权限提醒功能,也无法对其进行自定义。此功能由 CTS 进行测试。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):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"]],["最后更新时间 (UTC):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."]]