3

The App is reading the call log. On most devices that is fine, some others get SecurityException for READ_CONTACTS (which I don't have and don't want in my AndroidManifest.xml.

Why is that and can I do something about that? Perhaps through a projection, which does not fetch the CACHED_NAME?

Paul Ratazzi
  • 6,289
  • 3
  • 38
  • 50
Michael Schmidt
  • 1,199
  • 4
  • 14
  • 18

1 Answers1

5

android.permission.READ_CALL_LOG was introduced in API Level 16. Before that, it was implicit in android.permission.READ_CONTACTS and didn't exist as a separate permission. I suspect your trouble is with API 15 and lower devices since they will ignore your manifest's uses-permission line for READ_CALL_LOG and thus have no permission for reading the logs. For those devices, READ_CONTACTS is the correct permission.

Paul Ratazzi
  • 6,289
  • 3
  • 38
  • 50
  • 2
    So, I used `` to avoid the need to ask for this permission in newer API's. – Michael Schmidt Aug 03 '14 at 09:41
  • Just tried uploading my APK with this permission and maxSdkVersion="15", the console tells me the minimum maxSdkVersion should be 18!? – 3c71 Jul 19 '15 at 13:40
  • Setting a maxSdkVersion is a bad practice. Someone updates their phone and your app doesn't work anymore, just because you didn't implement stuff the way it should. – Zelphir Kaltstahl Jan 28 '16 at 12:16
  • @Paul Ratazzi If I want read phone book but don't want read call logs, what should I do? – dragonfly May 13 '19 at 03:50
  • @dragonfly If you are on API 16 or later (I would hope so at this point), just declare `READ_CONTACTS` permission in your manifest. `READ_CALL_LOGS` is a separate permission. – Paul Ratazzi May 21 '19 at 15:02