0

In my app I am trying to intercept all outgoing calls starting with 00 string. I used Telephony Manager for the same to get outgoing number and then intercept it. All code was working properly before Android 9.0. But in Android Pie once i made call then my app crashed because i am not getting User Dialed number in Receiver.

Serenity
  • 35,289
  • 20
  • 120
  • 115

1 Answers1

0

"Without the READ_CALL_LOG permission, however, the phone number field that's provided in PHONE_STATE_CHANGED broadcasts and through PhoneStateListener is empty."

So you have to ensure the user grants permission for reading phone number before you try to access any dialed number. Also you have to keep a check and a backup plan in case user refuses permission. Your app should handle such case well so as to avoid any null pointers.

Nishita
  • 870
  • 1
  • 9
  • 33
  • I am already using all these permissions in Manifest file also checked them at run time for requesting permission. Please check my code for Runtime permission. Manifest Declarations:- Applied Runtime permission as well. Everything working in all versions except 9.0. – Sudhanshu Shukla Apr 25 '19 at 17:54