In my application, I need the following permissions to create an account:
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
<uses-permission android:name="android.permission.USE_CREDENTIALS"/>
As I understand it, in M they should be provided automatically.
However, I see that only GET_ACCOUNTS is provided. I checked this with the following code:
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
logPermissionStatus(Manifest.permission.GET_ACCOUNTS);
logPermissionStatus(Manifest.permission.MANAGE_ACCOUNTS);
logPermissionStatus(Manifest.permission.AUTHENTICATE_ACCOUNTS);
logPermissionStatus(Manifest.permission.USE_CREDENTIALS);
}
private void logPermissionStatus(String permission) {
if (checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED) {
Log.d("AccountPermissions", "Granted: " + permission);
} else {
Log.d("AccountPermissions", "Denied: " + permission);
}
}
What prints:
D/AccountPermissions﹕ Granted: android.permission.GET_ACCOUNTS
D/AccountPermissions﹕ Denied: android.permission.MANAGE_ACCOUNTS
D/AccountPermissions﹕ Denied: android.permission.AUTHENTICATE_ACCOUNTS
D/AccountPermissions﹕ Denied: android.permission.USE_CREDENTIALS
If I try to request permission
requestPermissions(new String[] {
Manifest.permission.GET_ACCOUNTS,
Manifest.permission.MANAGE_ACCOUNTS,
Manifest.permission.AUTHENTICATE_ACCOUNTS,
Manifest.permission.USE_CREDENTIALS,
}, 1);
The dialog box says "Allow accounts to perform an unknown action?", Which led me to believe that they are not intended for a request from the user. In addition, the ACCOUNT permission group is displayed according to deprecated permissions on the application details page.
- , Android , ?