Up to Android 2.2 I know I can use reflection and terminate the call through getITelephony.
However, as of 2.3 this no longer works because even if you grant the MODIFY_PHONE_STATE permission to your app, it's now a system app only permission: https://stackoverflow.com/a/5095956/821423
That said, it's possible still because a myriad of applications on the google play market are doing it just fine on ICS, for example, this one:
https://play.google.com/store/apps/details?id=com.androminigsm.fscifree&hl=en
So the question is, how do they do it? I know I can pick up the call using simulating a headset hook, but I can't figure out how to end the call.
Thank you.
Well after much soul-searching I realize something really, really, really dumb. On the plus side no one on StackOverflow seems to have noticed it either. MODIFY_PHONE_STATE is no longer working on silenceRinger() since 2.3+, but endCall is just fine.
So the solution is to comment out the call to silenceRinger().
Can't believe I've just spent a week on this! I'll try to update the other questions as there seem to be tons of dupe on SO along the lines of 'it's not possible to use reflection to terminate the calls anymore'.
The call() , endcall() functions work fine for me as well. But there is also another way tha works without using iTelephony.aidl. Its published in this post. BTW I think google already knows but for some reason they havent done anything with the rest of functions, wich is good!!!
http://androidbridge.blogspot.com/2011/05/how-to-answer-incoming-call-in-android.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With