Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Incorrect message with GET_ACCOUNTS permission

Am trying to update my app with the new Android M permissions which uses Google+ login, but when I do a checkSelfPermission(Manifest.permission.GET_ACCOUNTS) the dialog that pops up says "Allow MyApp to access your contacts?" with the Deny and Allow buttons.

This seems kind of weird for the GET_ACCOUNTS permission. Shouldn't it say something related to access your accounts instead? Is this a bug? Or should I be doing something differently?

like image 331
source.rar Avatar asked Sep 25 '15 14:09

source.rar


2 Answers

The GET_ACCOUNTS permission is part of the android.permission-group.CONTACTS group, along with the

  • android.permission.READ_CONTACTS
  • android.permission.WRITE_CONTACTS
  • android.permission.GET_ACCOUNTS

This is why you get the message for CONTACTS.

So when you ask for one permission in a group, you will get all of them in that group. You can find more information about permission in Android M here

like image 100
DDsix Avatar answered Oct 19 '22 21:10

DDsix


I would recommend moving away from Google+ login and using the new Google login. It requires no special permissions to access email and can be easily integrated.

https://developers.google.com/identity/sign-in/android/start

like image 4
JustinMorris Avatar answered Oct 19 '22 22:10

JustinMorris