4

Is it possible for an Android App to interrupt a phone Call, or take the Foreground? I would be interested in this whether or not the device was rooted.

I understand this is an unusual request, although it is for a specialty project.

Victor Ronin
  • 22,758
  • 18
  • 92
  • 184
TMB
  • 4,683
  • 4
  • 25
  • 44

2 Answers2

4

Surprisingly yes. There is a endCall method in com.android.internal.telephony.ITelephony (you need to either compile with the right classes in your compile path or use reflexion to get to it)

njzk2
  • 38,969
  • 7
  • 69
  • 107
2

Your service (running in the background) can send an Intent which will be processed by system and will bring an application (which handles this intent) to the foreground. I am not sure whether it will end a call or not.

Victor Ronin
  • 22,758
  • 18
  • 92
  • 184
  • 1
    It won't. The telephone app simply caries on in the background. Doing this has the same effect as pressing the home button and using other apps during a call.. – Raghav Sood Sep 13 '12 at 15:49
  • This is the minimum functionality I need. – TMB Sep 13 '12 at 15:49
  • I think you want to specify in your question that you want to hang up a call (not just take the foreground). – Victor Ronin Sep 13 '12 at 15:52
  • 1
    Check following questions: http://stackoverflow.com/questions/2758408/how-to-hang-up-disconnect-terminate-incomings-call http://stackoverflow.com/questions/599443/hang-up-outgoing-call-in-android http://prasanta-paul.blogspot.in/2010/09/call-control-in-android.html – Victor Ronin Sep 13 '12 at 15:54