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

Posts: 21
Registered: ‎07-15-2008
My Device: Not Specified
Accepted Solution

detect if phone call is in progress

I have a job on a Timer (via TimerTask), and noticed that it queues up behind a phone call (because the data network is in use when the phone is on). So when the phone call ends, the jobs that were waiting to send data to the application server over http spit back all their stuff at once.


I'm thinking that I should do a "only execute the job if the phone isn't in use" type deal. I have my certs for signing, and am wondering if the best way to check for an active phone call is something like:




if (phone.getActiveCall == null)

{  this.doStuff();  }


{  //phone's in use. don't do anything.   }




If I'm totally off track in my use of Timer, or checking for an active call, please let me know! Smiley Surprised

Posts: 17,003
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: detect if phone call is in progress

I use
CoverageInfo.isOutOfCoverage() || RadioInfo.isDataServiceSuspended() to put my connection queue into wait status.
PhoneListener (calldisconnected) and CoverageStatusListener are used to notify the connection queue.
In addition i use a SystemListener to restart all connections if the device was automatically turned off and on.
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter