Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 5
Registered: ‎07-13-2011
My Device: 9800
My Carrier: JAVA
Accepted Solution

How to block phone calls

I want to implement a firewall. But I am new in Blackberry development. After investigated the API doc, I can not find out any standard API which can block phone calls. Do anyone know how to do that? Thanks a lot.
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: How to block phone calls

In my experience, there is no "cut and dried" API for this.

 

You can probably satisfy your requriement by using PhoneListener and blocking calls with key event injection.

 

Developer
Posts: 24
Registered: ‎09-15-2009
My Device: Not Specified

Re: How to block phone calls

"You can probably satisfy your requriement by using PhoneListener and blocking calls with key event injection."

 

Yes, that's exactly how you have to do it.

When the phone listener receives the incoming call event, you inject the KEY_END key (down and up).

But there's a catch: You have to do this in a separate thread, and you have to sleep about 100ms when you received the callIncoming event before injecting the key events, otherwise it won't work.

 

look at net.rim.device.api.system.EventInjector and net.rim.blackberry.api.phone.PhoneListener

Highlighted
New Contributor
Posts: 5
Registered: ‎07-13-2011
My Device: 9800
My Carrier: JAVA

Re: How to block phone calls

Thanks for your reply, it's very detail and helpful