1

I just discovered that, during app initialization my registerContentObserver for Contacts requires READ_CONTACTS permission. Obviously, for a new user on Android 6 and later, this permission won't yet be granted.

It seems to me it would be sufficient to ignore the permission during registration and check permission when the app listener tries to access contacts - which I'm sure it already does.

Same for Calendar.

Should I make an Android change request - why is this coding "penalty" being imposed?

Peri Hartman
  • 19,314
  • 18
  • 55
  • 101
  • 1
    There is no reason that you have to request permission during registration. There is nothing preventing you from asking for permission only when its needed (which is the recommended way to use permissions BTW). This isnt going to change so I would get use to it – tyczj Jul 13 '17 at 19:37
  • IOW, move your `registerContentObserver()` calls until such time as you are comfortable asking for permission. – CommonsWare Jul 13 '17 at 19:43
  • Yes, to both comments. However, this is a lot of work. Even encapsulating it is tricky. Further, Google neglected to document this behavior which, in my opinion, is unintuitive. I would like google to fix this unless there is a good reason for what they did. At least document it ! – Peri Hartman Jul 13 '17 at 22:42

0 Answers0