How to block calls in android

Anurag Uniyal picture Anurag Uniyal · Jul 5, 2009 · Viewed 100.4k times · Source

I want to block calls from few numbers, for that I want to write a app of my own. So what are the APIs which I should be using?

Basically I want to get notified when a call comes, i want to compare numbers if it is what i want to block, i want to cut the call or mute it or if possible mute it and record it.

Answer

foryou picture foryou · Jun 18, 2010

OMG!!! YES, WE CAN DO THAT!!! I was going to kill myself after severe 24 hours of investigating and discovering... But I've found "fresh" solution!

// "cheat" with Java reflection to gain access to TelephonyManager's
// ITelephony getter
Class c = Class.forName(tm.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
telephonyService = (ITelephony)m.invoke(tm);

all all all of hundreds of people who wants to develop their call-control software visit this start point

there is a project. and there are important comments (and credits)

briefly: copy aidl file, add permissions to manifest, copy-paste source for telephony management )))

Some more info for you. AT commands you can send only if you are rooted. Than you can kill system process and send commands but you will need a reboot to allow your phone to receive and send calls =)))

I'm very hapy =) Now my Shake2MuteCall will get an update !