ConvexMartian
ConvexMartian

Reputation: 331

Intercepting incoming calls on Android

I would like to write software for my Android phone that intercepts incoming calls and plays a short audio clip instructing the caller to press "1" to proceed with the call. This is for fighting telemarketers.

Is this possible with the current (Android 7 "Nougat") API?

Notes:

Thanks.

Upvotes: 2

Views: 3876

Answers (1)

Morrison Chang
Morrison Chang

Reputation: 12121

The specific documentation link is Android 7.0 - Number Blocking feature

Android 7.0 now supports number blocking in the platform and provides a framework API to let service providers maintain a blocked-number list. The default SMS app, the default phone app, and carrier apps can read from and write to the blocked-number list. The list is not accessible to other apps.

The last line highlights that this isn't a general access feature.

Drilling down in to BlockedNumberContract

Only the system, the default SMS application, and the default phone app (See getDefaultDialerPackage()), and carrier apps (See CarrierService) can read, and write to the blockednumber provider. However, canCurrentUserBlockNumbers(Context) can be accessed by any application.

So if you are the default dialer or default SMS app you should have access. If you aren't either of those then all any app can do is find out if the feature is available.

Additionally I'm not aware of a general way to inject audio into a call, see: Call Stream Modification on Android

Upvotes: 2

Related Questions