Search code examples
androidtelephonyspam-prevention

Android Block All Numbers Except Whitelisted


I would like to block all numbers except for a select few whitelisted numbers on my Android phone.

In the Android docs I see that there is an API for blocking specific numbers. I was wondering if there is a similar more broad API which rejects all incoming communication unless a number is whitelisted.

Or perhaps an intent I could hook an app up to which would screen each number before ringing the phone.


Solution

    1. Use a broadcast receiver to get the state when incoming call is coming.
    2. Then in that event get the number of the caller.
    3. Match the number with your list of numbers,if it equals your whitelisted one allow else disconnect the call programmatically.