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:
It's hard to get a clear answer because in 2012, Android 2.3 (Gingerbread) removed some vital API related to modifying the phone state, see here. However, Android 7 ("Nougat") seems to support call-blocking (see here), so I'm hopeful that the current API supports intercepting calls.
I don't want to forward calls to some server as suggested here.
I would prefer to write the software myself, and not install an app like Hiya.
I have a regular phone number assigned by my carrier (no fancy Google Voice or VOIP stuff), and I use the standard "Phone" app.
My phone is not rooted.
This is inspired by the Jolly Roger Telephone Company anti-telemarketer bot.
I previously asked a similar question for iPhones here.
Thanks.