数据访问审核
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
为了让应用及其依赖项访问用户私密数据的过程更加透明,Android 11 引入了数据访问审核功能。借助此流程得出的见解,您可以更好地识别可能出现的意外数据访问。
您的应用可以注册 AppOpsManager.OnOpNotedCallback
实例,该实例可在每次发生以下任一事件时执行相应操作:
- 应用的代码访问私密数据。为了帮助您确定应用的哪个逻辑部分调用了事件,您可以按归因标记审核数据访问。
- 依赖库或 SDK 中的代码访问私密数据。
其他资源
如需详细了解数据访问审核,请查看以下资料:
博文
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-21。
[null,null,["最后更新时间 (UTC):2025-08-21。"],[],[],null,["# Data access auditing\n\nTo provide more transparency into how your app and its dependencies access\nprivate data from users, Android 11 introduces [data access\nauditing](/guide/topics/data/audit-access). By having insights from this\nprocess, you can better identify potentially unexpected data access.\n\nYour app can register an instance of\n[`AppOpsManager.OnOpNotedCallback`](/reference/android/app/AppOpsManager.OnOpNotedCallback), which can perform\nactions each time one of the following events occurs:\n\n- Your app's code accesses private data. To help you determine which logical part of your app invoked the event, you can audit data access by attribution tag.\n- Code in a dependent library or SDK accesses private data.\n\nAdditional resources\n--------------------\n\nFor more information about data access auditing, view the following materials:\n\n### Blog posts\n\n- [New Android 11 tools to make apps more private and\n stable](https://medium.com/androiddevelopers/new-android-11-tools-to-make-apps-more-private-and-stable-c9dcea0af415)"]]