0

I am trying to write an app to make and end call. Making call was a breeze. However, ending call has been a pain. I read some SO posts about ending call (example) which have worked but none specifically known to work on android version 4.3 and 4.4 , which is why I ask this question. My function to end call is given below. It is called from a timer.

    private void ignoreCallPackageRestart() {
        ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
        am.killBackgroundProcesses ("com.android.providers.telephony");
        am.killBackgroundProcesses ("com.android.phone");
    }

The application has required permission:

uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"

In case it is relevant, I am running my app on Samsung Galaxy Nexus I9250 .

Community
  • 1
  • 1
FlowRaja
  • 677
  • 3
  • 6
  • 15
  • 1
    Basically, Google doesn't want you to be able to do this, because it would allow malicious programs to break the phone too easily. That's why they keep killing loopholes that allow it. So anything you do, expect it to break next update. – Gabe Sechan Mar 02 '14 at 03:08
  • So they allow you to make call but not end call? Isn't that a mismatch? I think it is stupid. An app starts a call but can not end it. So the user gets a huge bill. In comparison, BlackBerry provides a much cleaner API: http://developer.blackberry.com/native/reference/cascades/bb__system__phone__phone.html#function-endcall-callid – FlowRaja Mar 02 '14 at 04:06
  • I didn't say Google always makes sense. But they've broken a half dozen work arounds so far, I'd expect them to continue. – Gabe Sechan Mar 02 '14 at 04:08
  • Based on the other posts I have seen on SO, they have gone great lengths to block this API. Thanks anyway! – FlowRaja Mar 02 '14 at 04:16
  • Have you gotten this to work? I am looking to do the same thing. – Calin Aug 01 '14 at 12:46

0 Answers0