phoneapp/phoneuicontrol/src/cphonestate.cpp
branchRCL_3
changeset 14 24062c24fe38
parent 9 8871b09be73b
child 15 2a26698d78ba
equal deleted inserted replaced
9:8871b09be73b 14:24062c24fe38
  1478     {
  1478     {
  1479     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCenRepChangeL( ) ");
  1479     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleCenRepChangeL( ) ");
  1480     }
  1480     }
  1481 
  1481 
  1482 // -----------------------------------------------------------
  1482 // -----------------------------------------------------------
  1483 // CPhoneState::NeedToSendToBackgroundL
  1483 // CPhoneState::NeedToReturnToForegroundAppL
  1484 // -----------------------------------------------------------
  1484 // -----------------------------------------------------------
  1485 //
  1485 //
  1486 EXPORT_C TBool CPhoneState::NeedToSendToBackgroundL() const
  1486 EXPORT_C TBool CPhoneState::NeedToReturnToForegroundAppL() const
  1487     {
  1487     {
  1488     return iViewCommandHandle->HandleCommandL(
  1488     return iViewCommandHandle->HandleCommandL(
  1489         EPhoneViewGetNeedToSendToBackgroundStatus ) ==
  1489         EPhoneViewGetNeedToReturnToForegroundAppStatus ) ==
  1490         EPhoneViewResponseSuccess;
  1490         EPhoneViewResponseSuccess;
  1491     }
  1491     }
  1492 
  1492 
  1493 // -----------------------------------------------------------
  1493 // -----------------------------------------------------------
  1494 // CPhoneState::TopAppIsDisplayedL
  1494 // CPhoneState::TopAppIsDisplayedL
  1715             if ( IsNumberEntryUsedL() )
  1715             if ( IsNumberEntryUsedL() )
  1716                 {
  1716                 {
  1717                 // Show the number entry if it exists
  1717                 // Show the number entry if it exists
  1718                 SetNumberEntryVisibilityL(ETrue);
  1718                 SetNumberEntryVisibilityL(ETrue);
  1719                 }
  1719                 }
  1720             else if ( NeedToSendToBackgroundL() )
  1720             else if ( NeedToReturnToForegroundAppL() )
  1721                 {
  1721                 {
  1722                 // Continue displaying current app but set up the
  1722                 // Continue displaying current app but set up the
  1723                 // idle screen in the background
  1723                 // idle screen in the background
  1724                 SetupIdleScreenInBackgroundL();
  1724                 SetupIdleScreenInBackgroundL();
  1725                 }
  1725                 }
  2273         TPhoneCmdParamBoolean booleanParam;
  2273         TPhoneCmdParamBoolean booleanParam;
  2274         booleanParam.SetBoolean( EFalse );
  2274         booleanParam.SetBoolean( EFalse );
  2275         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVideoCallFlag, &booleanParam );
  2275         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetVideoCallFlag, &booleanParam );
  2276         }
  2276         }
  2277 
  2277 
  2278     // Go to background if necessary
  2278     // Check if application and number entry was open before incoming call. If so give control to number entry 
  2279     if ( NeedToSendToBackgroundL() ||  IsAutoLockOn() )
  2279 	// to prevent flickering
  2280         {
  2280     if ( NeedToReturnToForegroundAppL() ||  IsAutoLockOn() )
  2281         iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
  2281         {
  2282         // If number entry is used set control and visibility.
  2282         // If number entry is used set control and visibility.
  2283         if ( IsNumberEntryUsedL() )
  2283         if ( IsNumberEntryUsedL() )
  2284            {
  2284            {
  2285            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
  2285            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
  2286            }
  2286            }
  2287         }
       
  2288     // If there is no need to send back ground and number entry is used then
       
  2289     // we must show number entry.
       
  2290     else if ( !NeedToSendToBackgroundL() && IsNumberEntryUsedL() )
       
  2291         {
       
  2292         SetNumberEntryVisibilityL(ETrue);
       
  2293         }
  2287         }
  2294     }
  2288     }
  2295 
  2289 
  2296 // -----------------------------------------------------------
  2290 // -----------------------------------------------------------
  2297 // CPhoneState::CaptureKeysDuringCallNotificationL
  2291 // CPhoneState::CaptureKeysDuringCallNotificationL