Tuesday, 14 March 2023

Writing an Android App to answer phone calls programatically (i.e. without the user's mic/speaker)

My goal is to write an app that (with the users consent earlier):

  1. 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.
  2. 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:

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