With Android P - Api Level 28: You need to get READ_CALL_LOG permission
Restricted access to call logs
Android P moves the CALL_LOG
, READ_CALL_LOG
, WRITE_CALL_LOG
, and PROCESS_OUTGOING_CALLS
permissions from the PHONE
permission group to the new CALL_LOG
permission group. This group gives users better control and visibility to apps that need access to sensitive information about phone calls, such as reading phone call records and identifying phone numbers.
To read numbers from the PHONE_STATE intent action, you need both the READ_CALL_LOG
permission and the READ_PHONE_STATE
permission.
To read numbers from onCallStateChanged()
, you now need the READ_CALL_LOG
permission only. You no longer need the READ_PHONE_STATE
permission.