I hope to block some crank call, so I need to hang up some call programmatically in android.
The following fragment is from How to hang up outgoing call in Android?<
If you are in JUnit test then this is how;
mInstrumentation = InstrumentationRegistry.getInstrumentation(); mInstrumentation.getUiAutomation().executeShellCommand( "input keyevent " + KeyEvent.KEYCODE_ENDCALL );
It may work also from outside the test but I haven't tried it.