头图

Android is committed to helping users make the most of the latest innovations, while always putting user safety and privacy as the top priority. In Android 12, the introduction of the Privacy Dashboard improves the transparency of the platform. The Privacy Information Center provides users with a simple and clear timeline, showing the location, microphone, and camera of each application in the past 24 hours. Visits. The user can accurately learn the time when the permission access occurs, and can choose to revoke the application's access permission for a specific function.

Privacy Information Center on Developers

Now users can more easily check which permissions are used by the applications on their devices. All developers should review their code, clarify the data access requirements, including the data required by the third-party SDK, and ensure all data access All have corresponding verifiable application scenarios . You can use the data access audit API track the data used by the application, or you can use the new permission intent API Android 12 to explain to the user the context of the application when accessing the data in more detail.

Data Access Audit API

Android provides data access audit API can make it easier for you to track data access scenarios in your application. Through this API, you can associate private data access with specific application scenarios, such as "order coffee" or "share with friends". You can use it to track data access within and beyond expectations. You can also use AppOpsManager.OnOpNotedCallback in your application. Whenever your application or dependent library code accesses private data, you can use the callback in it to do some processing.

For more information about the data access audit API, please refer to:

permission Intent

When you really need to request a certain permission, you can use the permission Intent API to explain to the user a reasonable reason why you need to access location, camera, or microphone information. You can display the reason for data access in the privacy information center or application permission request page . For example, your application has two functions that need to access the camera, such as scanning barcodes and taking photos of food. After using the permission Intent API, you can declare the usage scenarios for each request for camera permission in the privacy information center.

To display this intent in the privacy information center, you need to define an activity in the application. The activity needs to be configured with android.intent.action.VIEW_PERMISSION_USAGE_FOR_PERIOD . In addition, you need to configure android.permission.START_VIEW_PERmissionSION_VIEW_PERIOD permissions.

To display this Intent in the permission settings, you need to define an activity in the application. The activity needs to be configured with android.intent.action.VIEW_PERMISSION_USAGE , in addition to the android.permission.START_VIEW_PERMISSION_USAGE permission.

If your application uses Android 12 or higher as the target platform, for any of the above situations, you must explicitly define the value of the android:exported attribute .

summary

The Privacy Information Center protects user privacy by improving transparency. Developers can use the data access audit API to track data access in their applications, and use the permission intention API to explain the rationality of permission usage to users.

Welcome to continue to follow us to learn more about the latest content. You are also welcome to click here to submit feedback to us, or share your favorite content or problems found. Your feedback is very important to us, thank you for your support!


Android开发者
404 声望2k 粉丝

Android 最新开发技术更新,包括 Kotlin、Android Studio、Jetpack 和 Android 最新系统技术特性分享。更多内容,请关注 官方 Android 开发者文档。