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 .