AndroidCallBlockingTestDemo
AndroidCallBlockingTestDemo copied to clipboard
Block both calls when my first caller is taking with first caller.
Scenario: When the first call is ongoing(user talking with the first caller) in between second caller call to same user & that new caller is in my Blocklist when my call blocking logic runs both calls ended immediately.
In the above case, I want to end call of second caller only. How to achieve this?
Is there any way to identify & block the particular call?
TelephonyManager telephony = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
String s = telephony.getClass().getName();
Class c = Class.forName(telephony.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
ITelephony telephonyService = (ITelephony) m.invoke(telephony);
telephonyService.endCall();