diff -r c58fd5f0c240 -r 594d59766373 satui/satapp/SATUISrc/CSatUiViewAppUi.cpp --- a/satui/satapp/SATUISrc/CSatUiViewAppUi.cpp Thu Jul 15 19:16:18 2010 +0300 +++ b/satui/satapp/SATUISrc/CSatUiViewAppUi.cpp Thu Aug 19 10:28:14 2010 +0300 @@ -1268,7 +1268,7 @@ { TFLOGSTRING( "CSatUiViewAppUi::HandleForegroundEventL \ need to display a dialog" ) - if ( iForegroundControl ) + if ( iForegroundControl && ForegroundAlive() ) { iForegroundControl->SetFocus( ETrue, EDrawNow ); } @@ -3530,5 +3530,34 @@ } TFLOGSTRING( "CSatUiViewAppUi::StopPlayToneL exiting" ) } + +// ----------------------------------------------------------------------------- +// CSatUiViewAppUi::ForegroundAlive +// Check if foreground control is alive when HandleForegroundEventL is called. +// ----------------------------------------------------------------------------- +// +TBool CSatUiViewAppUi::ForegroundAlive() const + { + TFLOGSTRING( "CSatUiViewAppUi::ForegroundAlive called" ) + + // Only if value of iForegroundControl equals to one of the following 8 + // pointers, the alive value will be set to true. This will check if + // the foreground control is alive. + TBool alive = + iForegroundControl == static_cast( iWaitNote ) + || iForegroundControl == static_cast( + iDisplayTextIconDialog ) + || iForegroundControl == static_cast( + iDisplayTextDialog ) + || iForegroundControl == static_cast( iGetInputDialog ) + || iForegroundControl == static_cast( iPermanentNote ) + || iForegroundControl == static_cast( iNoteDialog ) + || iForegroundControl == static_cast( iBipWaitNote ) + || iForegroundControl == static_cast( iQueryDialog ); + + TFLOGSTRING2( "CSatUiViewAppUi::ForegroundAlive exiting alive=%d", alive ) + + return alive; + } // End of File