Brew Question:
Download Questions PDF

When making a voice call using ITAPI_MakeVoiceCall, responding No to the Privacy Alert hangs the application. What is the workaround?

Brew Interview Question
Brew Interview Question

Answer:

This is a bug in BREW SDK version 1.0.1, and will be fixed in an upcoming release.
The recommended workaround for BREW SDK Version 1.0.1 is for the user to press 'No' twice (i.e. press Select Key twice). When the Privacy Alert Yes/No dialog is displayed, all key events up until the first Select key press go to the Dialog. After the first Select key (for the dialog), subsequent key events go to the application.

Steps are outlined below:

Added a boolean 'madeVoiceCall' in the Applet structure

If ITAPI_MakeVoiceCall() returns Success, set madeVoiceCall to TRUE

retValue = ITAPI_MakeVoiceCall(pMe->p_tapi, PHONE_NUM,

AEECLSID_SAMPLEAPP);

ITAPI_Release(pMe->p_tapi);

if(retValue == SUCCESS) {

pMe->madeTapiCall = TRUE;

}



Handle EVT_KEY in the app handler function. If the Select key was pressed and madeVoiceCall is TRUE, the user has selected No in response to the Privacy Alert. Set madeVoiceCall = FALSE and redraw screen.

case EVT_KEY:

if (wParam == AVK_SELECT && pMe->madeTapiCall ==

TRUE) {

// Redraw screen

pMe->madeTapiCall = FALSE;

}

return TRUE;



If the user selected 'Yes' to the Privacy Alert, the application would have been suspended. When resumed, the madeVoiceCall flag must be cleared.

case EVT_APP_RESUME:

if(pMe->madeTapiCall == TRUE) {

pMe->madeTapiCall = FALSE;

}

… … …

… … …

return TRUE;

Download Brew Interview Questions And Answers PDF

Previous QuestionNext Question
What settings are required to allow a running BREW application to be suspended when a non-BREW SMS message is received on the Sharp Z-800?After making a voice call using ITAPI_MakeVoiceCall, why does my application seem to be restarted when I respond No to the "Return to Application" prompt?