0

Possible Duplicate:
How to block calls in android

You can intercept a call on Android?

Community
  • 1
  • 1
BlaBRA
  • 2,201
  • 4
  • 18
  • 13
  • Asked/discussed/answered before. One such previous question: http://stackoverflow.com/questions/1083527/how-to-block-calls-in-android – mbafford Jun 29 '10 at 14:59

1 Answers1

0

By intercept I presume you mean detect and block/cancel?

If so that is not possible.

You can listen for the Ringing and Off Hook states to determine that an incoming call has taken place but you cant block or intercept an incoming call.

Donal Rafferty
  • 19,707
  • 39
  • 114
  • 191
  • That is not entirely true. I have a modified Phone app that any number i have in there, it will never even ring. it disconnects the caller immediately. You would probably have to build it against the android platform and not the SDK, but you can do it. – Ryan Conrad Jun 29 '10 at 14:18
  • @Ryan Conrad, you have a sample code to give me? []'s – BlaBRA Jun 29 '10 at 14:33
  • It's also possible by hooking into the internal APIs, but not through the public/accepted APIs. This has been discussed in other questions on stackoverflow. – mbafford Jun 29 '10 at 14:58
  • By building your own ROM it is of course possible but by using the public API's it is not. – Donal Rafferty Jun 29 '10 at 15:06
  • @Donal: You would have to build from AOSP, but they are not "private API's" they are just not part of the SDK, they are part of the platform. @forte: take a look in http://github.com/cyanogen/android_packages_apps_Phone - i believe it is handled in there. – Ryan Conrad Jun 29 '10 at 15:50
  • Interesting Ryan, do you mean Just take the code out of the Android source and use it in applications? As in you dont have to change the code within the Android source code and build your own ROM? – Donal Rafferty Jun 29 '10 at 16:14
  • you dont really have to build your own rom, but you do have to compile it with the android core platform. So you do sort of build the ROM, but your just compiling it. you dont have to distribute it or anything more. You just use it for the "Core functionality". You do not change anything in there, just need it to build. It's how the Launcher, Phone, Music, Contacts etc all have to be built, they will not build against the SDK, you have to use the platform. http://source.android.com/source/download.html tells you the requirements needed to build from AOSP – Ryan Conrad Jun 29 '10 at 16:33
  • @Ryan Conrad: If they are not part of the SDK, they are in fact private APIs. That's what private API *means*. :) Private APIs can change at any time and there is no guarantee that they will continue working the same way from version to version or device to device. – adamp Jun 29 '10 at 21:17