请告诉我什么是身份权限?如何从代码中实现这种权限?
II已经实现了联系人读取和其他运行时权限,但无法找到有关身份权限的任何内容。
答案 0 :(得分:0)
GET_ACCOUNTS以前在身份权限组中。
它已移至Android 6中的“联系人”权限组。
https://developer.android.com/reference/android/Manifest.permission.html#GET_ACCOUNTS
答案 1 :(得分:0)
Identity – With this permission the app can find accounts on the device, see and modify the owner’s contact card and add or remove contacts from the device. The permission **group CONTACTS deals with the user’s contacts while ACCOUNT_MANAGER deals with the user’s accounts.**
<uses-permission android:name="android.permission-group.CONTACTS"/>
<uses-permission android:name="android.permission.ACCOUNT_MANAGER"/>
At code level one can set permission by using **https://developer.android.com/training/permissions/requesting.html**
First check
// Assume thisActivity is the current activity
int permissionCheck = ContextCompat.checkSelfPermission(thisActivity,
Manifest.permission.group.CONTACTS);