Keypad sound is lost when focus returns to the Symbian app
Article Metadata
Compatibility
S60 2nd Edition
Article
Overview
Our application launches external applications, but sounds generated by the phone when the keypad is used are not heard when our application is re-entered through the Tasks list or when the launched application is closed. The launched applications include, for example, camera, video, messages, and agenda. To hear the keypad tones again, our application has to be closed and opened again.
Description
According to the specifications, the CAknKeySoundSystem takes care of generating sounds. Its BringToForegorund() method tells the server that this client is now in the foreground, and that it's context stack should be used for processing sounds.
This is called automatically by CAknAppUi:
void CAknAppUi::HandleForegroundEventL(TBool aForeground)
{
if (iKeySounds && aForeground)
{
iKeySounds->BringToForeground();
}
CEikAppUi::HandleForegroundEventL(aForeground);
}
Solution
When you use the ways described in the Nokia Developer document Utilizing External Application Views to switch between application, make sure that you call the base class function:
CAknAppUi::HandleForegroundEventL(aForeground);
in your overloaded implementation of HandleForegroundEventL() - otherwise the keypad sounds will be lost.
For example,
void CMyViewAppUi::HandleForegroundEventL(TBool aForeground)
{
CAknAppUi::HandleForegroundEventL(aForeground);
... // Application-specific code on Focus change
}


(no comments yet)