My favorites | Sign in
Project Home Issues
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 54: Add API for call filtering
296 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----

  • Only users with Commit permission may comment.

Sign in to add a comment
Reported by, Jan 20, 2008
The API should support to reject a call.

Jan 23, 2008
The calling app can reject a call. But what I mean is that reject a call in my own
application by with the SDK.
Jan 25, 2008
This Issue has been reviewed and accepted.
An engineer will be assigned to work on it according to its priority.
Status: Reviewed
Feb 14, 2008
The SDK should support below functions:
1. reject an incoming call before the incoming call dialog pops up
2. replace the incoming call dialog
3. prevent the incoming call dialog
Apr 10, 2008
Is this issue solved or not ? How can we reject a call through an application ?
Jun 18, 2008
There should also be a blocked contact feature. When a certain pre-set phone number
calls, Android Calling app does not respond. It should though, make a notification of
when that person calls. Much needed. Please consider
Jun 26, 2008
Would definitely be great to have the ability to catch a new incoming call event and
prevent / replace the dialog to offer the recipient options regarding the incoming
call.  My entire application depends on this ability.
Aug 8, 2008
+1 vote to extend the api too allow injecting custom handlers for incoming call events.
Oct 6, 2008
High priority please
Oct 18, 2008
plz tell me Is this issue solved or not?? 
Oct 30, 2008
See Issue 1137 for a related idea that might be combined with this.
Nov 12, 2008
If any API is Developed we can easily build Call Firewall Software, The API should
pass on Incoming Caller Number, Matched Name etc. to the Application Registered to
this function.

Which Can Reject any Call and Send Predefined SMS
Reject a Call from Spammer.
Just Accept and Hangup a Spammer call this will Charge him a lot.

I am using MagiCall 2.0 Software and Call Firewall Software in Windows which is very
good for Business Person and High Profile Users who have Plenty of call which is want
to Reject Automatically
Feb 2, 2009
May I know the status of this issue?

Feb 2, 2009

Given that it doesn't currently have an Owner, I assume that it isn't being worked on
at the moment.
Feb 3, 2009
Hello Anyone knows the status of this issue.Pls let us where we can find the status 
of any issue.

Feb 6, 2009
(No comment was entered for this change.)
Labels: -Type-Defect Type-Enhancement
Feb 20, 2009
Lol well since the last update I inadvertently reject incoming calls just by operating the volume control.
Mar 11, 2009
Related bug/ RFE: calls to AudioManager.setVolume() with the Ringer as the stream,
and the FLAG_REMOVE_SOUND_AND_VIBRATE flag will not turn off the Vibrator, but will
turn off the ringer
Apr 7, 2009
I really hope it to be released in next release.
May 11, 2009
Yes to all the above. Long overdue.
Jun 12, 2009
Does Anyone knows the status of call reject issue.
Pls let us where we can find the status of this issue.

Jun 27, 2009
Asking if something is done yet and asking for status will achieve nothing, if you
care that much modify the source code yourself and submit a patch. The Android
developers are working very hard and cannot handle every request simultaneously.
Aug 7, 2009
Just bought my hero today, i must say it's nice phone, but i was really hoping for
the feature to block an incoming call in the api. It was infact the only reason for
buying the phone. I surly hope this will be a feature for the next release. Cheers 
Aug 24, 2009
(No comment was entered for this change.)
Labels: Component-Framework
Aug 27, 2009
(No comment was entered for this change.)
Labels: -Component-Framework Component-Device
Oct 16, 2009
Do the last two comments from google mean this issue has been resolved ? If so, in
what version of Android ?
Nov 9, 2009
I'd like to have Android support the following programatically:

- Accept an incomming call
- Decline an incomming call
- Start an outgoing call
Nov 10, 2009
I'd like to have support for these cases too :)

so is there a possibility using the NDK or not?
Dec 1, 2009
hello sir,

please make this enhancement quickly.
because every application alternatively deal with call & sms. All clients needs this
king of applications.

Jan 2, 2010
Jan 3, 2010
i am looking to intrruppt incoming call in my application.
Jan 4, 2010
#33 phaze3131
yea we really need api support to handle call events, this is way overdue
Jan 4, 2010
Just a friendly reminder... if you're about to post a comment that says "me too!" or "you've got 
my vote" or "+1" or similar... please just star this issue and leave the comments-space clean.  
When you star the issue, your vote counts.  Issues with a larger number of people starring the 
issue are likely going to get more attention. More comments, however, are just going to clutter 
the system and annoy those who have already starred the issue, possibly encouraging them to 
unstar the issue, lowering its perceived importance.  Again, comments should be used to update 
progress on the issue itself, not for voting... please leave this to the star.  Thanks.
Jan 13, 2010
The major platforms: Symbian, iPhone, Windows Mobile DO have API for this
functionality (don't have to check the docs, it is enough to look at the software

What's more, this functionality was planned (mentioned in beta release of Android
SDK), nevertheless, someone decided not to include this in official API due to
"security reasons".

Personally, I see no "security problem" in just rejecting a call. F.e. access to
address list could be regarded as the same "security problem". Reasoning that way, if
a customer is looking for "secure" phone, he / she should buy the simplest/cheapest
phone possible.
Jan 13, 2010
#37 phaze3131
But noone is updating anything about this issue at all...

Yea there is no security risk if the app that uses the code does not misuse it, but
that is in the users choice to get the app or not, so it is our call.  I just want to
be in control of my device ya know?  Thats what Android is, open source giving the
power back to the users.  So lets keep this going and not let companies like Apple
outdo us like this eh?
Jan 16, 2010
I just stumbled upon a tool named "Little Black Book" in the market. Description:
"Maintains a list of people you are dating and allows you to enjoy privacy with just
a single member of that list by sending everybody else in the book directly to

So there is a way to reject calls already?
Jan 18, 2010
#39 phaze3131
To clarify, rejecting a call and forwarding it to voicemail are completely different.
 Forwarding to voicemail is well, forwarding to voicemail.  Rejecting a call is tell
your phone once it receives a call signal from a certain number, to do nothing,
literally, do nothing at all.  No voicemail, no call log, no vibrate, no ringing, no
silent, no anything.
Apr 3, 2010
I am running 2.1 and use the Black List function found in SYSTEM / CALL SETTINGS.  
Incoming calls in black list will be rejected.
Apr 14, 2010
It's great if we can programatically handle incoming call in our application
May 19, 2010
hai plz inform me also i get same problem
Jun 1, 2010
We can handle incoming call, but we can't accept or reject a call programatically, yet
Jun 9, 2010
Are we looking for call/sms reject applications which can reject calls from a Blacklisted numbers without letting the incoming call dialog to pop up ?
If thats the case then this will be a great feature for Android platform to support
Jun 9, 2010
Capability of sending any AT command to GSM/CDMA modem will be a great feature of next API release
Aug 19, 2010
Just to weigh in on this - I really don't buy the excuse for not including this in the API due to "security reasons". Android is built around the concept of the user granting permissions to applications they trust. If this a permissionable action and they grant it, it's their own fault. 

This is long overdue from the API.
Sep 9, 2010
Can you ppl please tell me how much time it would take to fix this problem? I am stuck with since 2 weeks to accept and reject incoming call, Please give me some solution otherwise It would be very difficult to continue my current project..
Android ppl should think about this. It is a big deal and they can't take this as minor problem.About in 80% projects it is required to do something with incomign call and outgoing call....plz fix it as soon as possible .. 
Thanks in advance ...   
Sep 9, 2010
There wont be an API update till Gingerbread, around December.
So stop whining.
(I'm NOT a google employee)

Oct 4, 2010
+1 vote to extend the api too allow injecting custom handlers for incoming and outgoing call.
Oct 18, 2010
I have found a way to do this by reflection you can get a reference to ITelephony interface from TelephonyManager, and after call on it endCall().
Oct 18, 2010
@mr85mr Can you write in an article/site how to do that?

Oct 18, 2010
Yeah, a howto would be rather welcome :)
Oct 18, 2010
Search the net for ITelephony.aidl. The program myLock is a good example for
use. It's not a howto, though..

Comment #53 on issue 54 by timonoj: Can't reject a call
Yeah, a howto would be rather welcome :)
Oct 18, 2010
A word of caution, there is nothing preventing Google or Manufactures from
changing method signatures on you so there is still a possibility this
approach won't work on all phones.  But then again, that kind of goes with
the territory of using reflection to open up private objects : )

For info on using existing AIDL services in general, check out this blog
write up:

I'd suggest reading that blog first to get your head around the approach of
tapping into the existing services via AIDL if it is something you are new
to like I was.

The myLock, auto-answer and teddsdroidtools (my project) open source
projects all utilize this technique.  These can be used for
research/inspiration on how to answer/reject calls this way and they're all
on Google code:

Here's a direct link to the source of the activity in my project that
actually does the answering and rejecting:

- Tedd
Oct 18, 2010
Thank you very much
Oct 18, 2010
The only thing I could not do, is to understand when an outgoing call is answered, and capture time of a conversation during a call, because to do this we have need of Phone object accessible by getDefaultPhone(), but this function must be called from Looper thread...
This is a little testcase:
String phoneFactoryName = "";
String phoneName = "";
Class phoneFactoryClass = Class.forName(phoneFactoryName);
Class phoneClass = Class.forName(phoneName);
Method getDefaultPhone = phoneFactoryClass.getMethod("getDefaultPhone");
Object phoneObject = getDefaultPhone.invoke(null);

Anyone knows how to do ?
Dec 22, 2010
Print Messages to a Log File

To write log messages from your application:

   1. Import android.util.Log.
   2. Use Log.v(), Log.d(), Log.i(), Log.w(), or Log.e() to log messages. (See the Log class.)
      E.g., Log.e(this.toString(), "error: " + err.toString())
   3. Launch DDMS from a terminal by executing ddms in your Android SDK /tools path.
   4. Run your application in the Android emulator.
   5. From the DDMS application, select the emulator (e.g., "emulator-5554") and click Device > Run logcat... to view all the log data.

Note: If you are running Eclipse and encounter a warning about the VM debug port when opening DDMS, you can ignore it if you're only interested in logs. However, if you want to further inspect and control your processes from DDMS, then you should close Eclipse before launching DDMS so that it may use the VM debugging port.
? Go to top

? Back to FAQs, Tips, and How-to

Hello there,
I am sorry but i just want to ask, is it possible to get and use the package called  in my application or is there any equivalent API similar to CTelephony of Symbian?. The public API for android telephony did not allow me what i wanted to do. Forexample something equivalent to Symbian's CTelephony look what is available about the call-states.

enum TCallStatus
		Indicates that the status is unknown.
		Idle line status (no active calls).
		Call dialling status .
		Call ringing status.
		Call answering status.
		Call connecting status.
		Call connected status.
		Call is undergoing temporary channel loss and it may or may not be reconnected.
		Call disconnecting status.
		Call on hold.
		Call is transferring.
		Call in transfer is alerting the remote party.
Is there any other API for android which is equivalent to this one. Further is it possible for me to answer or reject incoming call from my application? Please any help will be appreciable.

Feb 21, 2011
Note regarding the AIDL trick to answer/reject calls:

This no longer works as of Android 2.3. Google has made the MODIFY_PHONE_STATE permission that is required unavailable for use by normal third party apps.

Note to Google regarding the Android SDK documentation of permissions:

Recommend providing some indication in the documentation as to which permissions are "system-only". For example, in this listing it would be extremely helpful if it said "system-only" or something along those lines.  I have not been able to easily locate such an indicator or listing which would be most helpful, save time and frustration, spell it out for simpletons like me, you get the idea ;)


- Tedd
Feb 22, 2011
there is anyway for us to accomplish that now ?

Feb 23, 2011
FYI - Here is the commit where David Brown removed the permission. His email address is in the commit log if you'd like to drop him a line and make our case about why it should be rolled back.

There is ABSOLUTELY NO WORK AROUND to the change he made - the permission is gone for third party app developers, only Google and phone manufacturers can use it now.;a=commit;h=f4ece2086f3b7060edc4b93a12f04c9af648867a
Feb 23, 2011
I wouldn't spam him. It was clearly never a public API, so there's no reason Google should have preserved it.

Also the commit says they are planning to create a proper public telephony API which is good.
Feb 23, 2011
I would spam him because the feature (while not publicly endorsed) shouldn't have been removed until they released a proper public API. 

I can filter sales via the Market by setting a minimum Android version and a maximum Android version... but I cannot exclude specific versions. So when 2.4+ is released, I will have an app that works on 1.0-2.2, and 2.4+... but not 2.3.

If they had maintained support until the public API was released developer code would look like this:

if(androidVersion < 2.3) {
   ... do it the old way
else {
   ... use the new Telephony API

Unfortunately, it now looks like this:

if(androidVersion < 2.3) {
   ... do it the old way
else if(androidVersion == 2.3) {
   ... cry piss and moan b.c. there's nothing I can do
else if(androidVersion > 2.3) {
   ... use the new Telephony API
Mar 4, 2011
Hi guys, 

I've contacted David Brown, (I couldn't wait myself) and ask him about this permission and telephony api.

He mention the response of hackbod in
reforcing that we shouldn't use it cause things could break as system evolves.

But he already knows that the telephony api needs to be implemented, and that Telephony Team is planning exposing the api, but just don't know when.

He also suggest that we continue to file and star feature requests to push things.

We have to wait...

Mar 5, 2011
sort of a modifcation of it, one feature that i've been dying to have since first started using mobile phone is unobstrusive incoming call notification/dialogue when you're doing something else.   when you're writing a note, txting, browsing, penciling-in your agenda, tking pictures, incoming calls just take over the screen leaving you annoyed. so, like i said above, there should be a dialogue-box popping up on the top of the screen with an option to answer/ignore/or even reject, or you could actually use the notification bar letting you know who's calling and if you want to answer/reject, just pulldown the notfctn bar.
May 24, 2011
The closest solution I have found is the freeware/donationware: 


Call Blocker
method: interrupt the signal

This option is available in the freeware, crippleware version of Sanity

Unlike most of the software in the android market sanity is not malware masquerading as freeware.  [adware is malware]
Jul 17, 2011
Blacklist can reject incoming calls from specific nunbers
Oct 22, 2011

Blacklist is malware(Adware) thereby impeaching the developer of Blacklist Pro.
Oct 22, 2011
Adware is different to malware
Mar 6, 2012
How is the autoanswer application , able to reject the call and send a text ? Installed on Samsung Galaxy S2 , android version 2.3

Is this issue resolved ? Can some one help me to reject call on android version 2.3

Mar 6, 2012
I'm able to reject calls on all 2.3 versions.
but not silence the ringer.

what I did is use the ITelephony AIDL
get the interface via:
Class c = Class.forName(tm.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
telephonyService = (ITelephony)m.invoke(tm);

then call endCall method on the received telephonyService whenever there's an incoming call (listen via TelephonyManager for LISTEN_CALL_STATE)

disclaimer: of course this is not an officially supported method and uses internal interface which might change in the future.
I have not tested this yet on higher versions. (but tested on 2.1, 2.3.1, 2.3.3, 2.3.4, 2.3.7)
Jun 19, 2013
(No comment was entered for this change.)
Status: Assigned
Jan 8, 2014
Project Member #78
(No comment was entered for this change.)
Status: New
Sign in to add a comment

Powered by Google Project Hosting