Displaying content on devices that operate on a CDMA network

The Phone application on a BlackBerry® device displays the active call screen when a user answers a call or makes a call. After the user answers a call, the user can receive and answer a second call. On devices that operate on a CDMA network, the second call does not invoke the same events that the original call does. For these devices, to display custom content on the active call screen, you must override the AbstractPhoneListener.callAnswered() method and AbstractPhoneListener.callWaiting() method.

Method

Description

callAnswered()

To display content on the first active call screen, override AbstractPhoneListener.callAnswered() and obtain call screen objects for the active call. The Phone application invokes this method when the user answers the first call. On devices that operate on a GSM® network, the Phone application invokes this method when the user answers the first call and second call.

callWaiting()

To display content on the second active call screen, override AbstractPhoneListener.callWaiting() and obtain call screen objects for the active call. The Phone application invokes this method when the user answers the second call.

Code sample: Displaying content on devices that operate on a CDMA network

The following code sample demonstrates how to override AbstractPhoneListener.callWaiting(). You can check whether the device operates on a CDMA network by using the RadioInfo class. You obtain the instances of the active call screen by invoking ScreenModel.getPhoneScreen() and passing in PhoneScreen.ACTIVE so that you are only specifying content for the second call.

public void callWaiting(int callId)
{
    // For CDMA devices, specify the content for the active call screen
    if((RadioInfo.getSupportedWAFs() & RadioInfo.WAF_CDMA) != 0)
    {
        ScreenModel screenModel = new ScreenModel(callId);

        PhoneScreen phoneScreenPortrait = screenModel.getPhoneScreen(PhoneScreen.PORTRAIT, PhoneScreen.ACTIVE);
 
        PhoneScreen phoneScreenLandscape = screenModel.getPhoneScreen(PhoneScreen.LANDSCAPE, PhoneScreen.ACTIVE);
    }
   
    // For GSM and CDMA devices, specify the content for the incoming call screen
}

Was this information helpful? Send us your comments.