My goal is to write an app that (with the users consent earlier):
- In specific situations, have the software answer the calls, and manage the stream of audio input / audio output as desired (i.e. the users' microphone and speakers/headsets are not used). It may show the user this is going on, and have a way to 'jump in' to the call.
- For other incoming calls or any outgoing dialing, the app will just let the device go to the system / default dialer for normal handling.
I've explored a few things, and find things a bit unclear. For instance, there is:
- The deprecated AcceptRingingCall, but I believe that is just to connect the call to mic/speaker of the phone.
- The only way to intercept the phone call is to be the default phone app. And if you don't want to handle it, manually redirect to the system phone app.
- There are some functions on Call to answer a call, but again seems to be for mic/speaker of the phone.
- For accessing the audio stream there are
VOICE_CALL,VOICE_UPLINKandVOICE_DOWNLINK, but their access is restricted to the system components. - There is a CallingScreeningService API, but it can only decline the call (or show call display), it can not answer the call itself.
At some level, I'm trying to understand which Android APIs the Google phone app uses to allow for automatic call screening - where, IIUC, it decides to answer the call and start screening by itself.
And separate from automatically answering the call, it's not obvious to me, given the restrictions the audio streams, how to get access to the audio streams if you do write your own phone app.
The answer may just be 'The built-in phone apps are system apps, and thus have more power - i.e. private APIs', but would be unfortunate.
Thanks!
Kyle
from Writing an Android App to answer phone calls programatically (i.e. without the user's mic/speaker)
No comments:
Post a Comment