phoneapp/phoneuistates/src/cphoneincoming.cpp
branchRCL_3
changeset 61 41a7f70b3818
parent 58 40a3f856b14d
child 62 5266b1f337bd
equal deleted inserted replaced
58:40a3f856b14d 61:41a7f70b3818
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // INCLUDES
    19 // INCLUDES
    20 #include <featmgr.h>
    20 #include <featmgr.h>
       
    21 #include <telephonyvariant.hrh>
    21 #include "cphoneincoming.h"
    22 #include "cphoneincoming.h"
    22 #include "phonerssbase.h"
    23 #include "phonerssbase.h"
    23 #include "phonelogger.h"
    24 #include "phonelogger.h"
    24 #include "cphonegeneralgsmmessageshandler.h"
    25 #include "cphonegeneralgsmmessageshandler.h"
    25 #include "phonestatedefinitionsgsm.h"
    26 #include "phonestatedefinitionsgsm.h"
    26 #include "tphonecmdparaminteger.h"
    27 #include "tphonecmdparaminteger.h"
    27 #include "tphonecmdparamboolean.h"
    28 #include "tphonecmdparamboolean.h"
    28 #include "phoneui.hrh"
    29 #include "phoneui.hrh"
    29 #include "mphonestatemachine.h"
    30 #include "mphonestatemachine.h"
    30 #include "mphonesecuritymodeobserver.h"
    31 #include "mphonestorage.h"
       
    32 #include "cphonecenrepproxy.h"
    31 #include "tphonecmdparamcallstatedata.h"
    33 #include "tphonecmdparamcallstatedata.h"
    32 
    34 
    33 // ================= MEMBER FUNCTIONS =======================
    35 // ================= MEMBER FUNCTIONS =======================
    34 
    36 
    35 // C++ default constructor can NOT contain any code, that
    37 // C++ default constructor can NOT contain any code, that
   115                     aMessage, aCallId );
   117                     aMessage, aCallId );
   116                 }
   118                 }
   117             break;
   119             break;
   118             
   120             
   119         case MEngineMonitor::EPEMessageRemoteHeld:
   121         case MEngineMonitor::EPEMessageRemoteHeld:
   120                 SendGlobalInfoNoteL( EPhoneInformationRemotePutOnHoldNote );
   122                 SendGlobalInfoNoteL( EPhoneInformationRemotePutOnHoldNote, ETrue );
   121             break;
   123             break;
   122         
   124         
   123         case MEngineMonitor::EPEMessageRemoteResumed:
   125         case MEngineMonitor::EPEMessageRemoteResumed:
   124                 SendGlobalInfoNoteL( EPhoneInformationConnectedNote );
   126                 SendGlobalInfoNoteL( EPhoneInformationConnectedNote, ETrue );
   125             break;
   127             break;
   126 		
       
   127 		case MEngineMonitor::EPEMessageShowVersion:
       
   128 			{
       
   129 			if ( iStateMachine->SecurityMode()->IsSecurityMode() )
       
   130 				{
       
   131 				// Do nothing if security mode is enabled.
       
   132 				return;
       
   133 				}
       
   134 			}
       
   135 		// Fall through
       
   136 
   128 
   137         // fall through.
   129         // fall through.
   138         case MEngineMonitor::EPEMessageIssuingSSRequest:
   130         case MEngineMonitor::EPEMessageIssuingSSRequest:
   139         case MEngineMonitor::EPEMessageCallBarred:
   131         case MEngineMonitor::EPEMessageCallBarred:
   140         case MEngineMonitor::EPEMessageIssuedSSRequest:
   132         case MEngineMonitor::EPEMessageIssuedSSRequest:
   197     TPhoneCmdParamCallStateData callState;
   189     TPhoneCmdParamCallStateData callState;
   198     callState.SetCallState( EPEStateConnected );
   190     callState.SetCallState( EPEStateConnected );
   199     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallIdByState, &callState );
   191     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallIdByState, &callState );
   200     TInt connectedCall = callState.CallId(); 
   192     TInt connectedCall = callState.CallId(); 
   201     
   193     
   202     IsNumberEntryUsedL() ? 
       
   203         BeginTransEffectLC( ECallUiAppear ) :
       
   204         BeginTransEffectLC( ENumberEntryOpen );
       
   205     BeginUiUpdateLC();
   194     BeginUiUpdateLC();
   206     
       
   207     // Hide the number entry if it exists
       
   208     if ( IsNumberEntryUsedL() )
       
   209         {
       
   210         SetNumberEntryVisibilityL( EFalse );    
       
   211         }
       
   212     
   195     
   213     TPhoneCmdParamBoolean dialerParam;
   196     TPhoneCmdParamBoolean dialerParam;
   214     dialerParam.SetBoolean( ETrue );
   197     dialerParam.SetBoolean( ETrue );
   215     
   198     
   216     AllowShowingOfWaitingCallHeaderL( dialerParam );
   199     AllowShowingOfWaitingCallHeaderL( dialerParam );
   217       
   200       
   218     // Close fast swap window if it's displayed
   201     // Close fast swap window if it's displayed
   219     EikonEnv()->DismissTaskList();
   202     CEikonEnv::Static()->DismissTaskList();
   220     
   203     
   221     // If the 1st incoming call became Connected, this is waiting call
   204     // If the 1st incoming call became Connected, this is waiting call
   222     // If the 1st incoming call went just Idle, this is a normal call
   205     // If the 1st incoming call went just Idle, this is a normal call
   223     if ( connectedCall > KErrNotFound )
   206     if ( connectedCall > KErrNotFound )
   224         {
   207         {
   232     if ( KErrNotFound == connectedCall )
   215     if ( KErrNotFound == connectedCall )
   233         {
   216         {
   234         dialerParam.SetBoolean( EFalse );
   217         dialerParam.SetBoolean( EFalse );
   235         }
   218         }
   236     
   219     
   237     SetToolbarDimming( EFalse );
       
   238     // Display incoming call
   220     // Display incoming call
   239     DisplayIncomingCallL( aCallId, dialerParam );
   221     DisplayIncomingCallL( aCallId, dialerParam );
   240 
   222     
       
   223     SetTouchPaneButtons( EPhoneWaitingCallButtons );
       
   224 
       
   225     if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
       
   226             && !CPhoneCenRepProxy::Instance()->
       
   227             IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) 
       
   228             && ( IsKeyLockOn() || IsAutoLockOn() ) )
       
   229         {
       
   230         DisableCallUIL();
       
   231         }
       
   232     else
       
   233         {
       
   234         // if keys have been locked, disable keylock without information note
       
   235         if ( IsKeyLockOn() )
       
   236             {
       
   237             iViewCommandHandle->ExecuteCommandL( EPhoneViewDisableKeyLockWithoutNote );
       
   238             }
       
   239         }
       
   240         
       
   241     if( CPhoneCenRepProxy::Instance()->
       
   242             IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) 
       
   243             && ( IsKeyLockOn() || IsAutoLockOn() ) )
       
   244         {
       
   245         DisableHWKeysL();
       
   246         }
       
   247         
   241     EndUiUpdate();
   248     EndUiUpdate();
   242     EndTransEffect();
       
   243 
   249 
   244     if ( connectedCall > KErrNotFound )
   250     if ( connectedCall > KErrNotFound )
   245         {
   251         {
       
   252         // Go to incoming state
   246         iCbaManager->UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
   253         iCbaManager->UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
   247         iStateMachine->ChangeState( EPhoneStateWaitingInSingle );   
   254         iStateMachine->ChangeState( EPhoneStateWaitingInSingle );   
   248         }
   255         }
   249     }
   256     }
   250     
   257     
   256     TInt aCallId, 
   263     TInt aCallId, 
   257     const TPhoneCmdParamBoolean aCommandParam )
   264     const TPhoneCmdParamBoolean aCommandParam )
   258     {
   265     {
   259     __LOGMETHODSTARTEND( EPhoneUIStates, 
   266     __LOGMETHODSTARTEND( EPhoneUIStates, 
   260         "CPhoneIncoming::DisplayIncomingCallL()");
   267         "CPhoneIncoming::DisplayIncomingCallL()");
   261  
   268 
   262     // Close menu bar, if it is displayed
   269     // Cannot delete active note, e.g. New call query, 
   263     iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
   270     // but show waiting note with or without caller name
   264 
   271     if ( IsAnyQueryActiveL() || 
   265     // Remove any phone dialogs if they are displayed
   272         ( aCommandParam.Boolean() && iOnScreenDialer ) )
   266     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   273         {
   267 
   274         CallWaitingNoteL( aCallId );        
   268     // if keys have been locked, disable keylock without information note
   275         }
   269     if ( IsKeyLockOn() )
   276     else
   270         {
   277         {
   271         iViewCommandHandle->ExecuteCommandL( EPhoneViewDisableKeyLockWithoutNote );
   278         // Remove any phone dialogs if they are displayed
       
   279         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
   272         }
   280         }
   273     
   281     
   274     // Indicate that the Phone needs to be sent to the background if
   282     // Indicate that the Phone needs to be sent to the background if
   275     // an application other than the top application is in the foreground
   283     // an application other than the top application is in the foreground
   276     SetNeedToReturnToForegroundAppStatusL( !TopAppIsDisplayedL() );
   284     TPhoneCmdParamBoolean booleanParam;
   277     
   285     booleanParam.SetBoolean( !TopAppIsDisplayedL() );
       
   286     iViewCommandHandle->ExecuteCommandL( 
       
   287         EPhoneViewSetNeedToSendToBackgroundStatus,
       
   288         &booleanParam );
       
   289 
   278     // Bring Phone app in the foreground
   290     // Bring Phone app in the foreground
   279     TPhoneCmdParamInteger uidParam;
   291     TPhoneCmdParamInteger uidParam;
   280     uidParam.SetInteger( KUidPhoneApplication.iUid );
   292     uidParam.SetInteger( KUidPhoneApplication.iUid );
   281     iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
   293     iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
   282         &uidParam );
   294         &uidParam );
   283 
   295 
   284     // Set Phone as the top application
   296     // Set Phone as the top application
   285     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
   297     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
   286         &uidParam );
   298         &uidParam );
   287 
   299 
   288     DisplayHeaderForCallComingInL( aCallId, aCommandParam.Boolean() ); //waiting call 
   300     DisplayHeaderForCallComingInL( aCallId, ETrue ); //waiting call 
   289     }    
   301     }    
   290 
   302 
   291 // -----------------------------------------------------------
   303 // -----------------------------------------------------------
   292 // CPhoneIncoming::AllowShowingOfWaitingCallHeaderL
   304 // CPhoneIncoming::AllowShowingOfWaitingCallHeaderL
   293 // -----------------------------------------------------------
   305 // -----------------------------------------------------------
   295 void CPhoneIncoming::AllowShowingOfWaitingCallHeaderL( 
   307 void CPhoneIncoming::AllowShowingOfWaitingCallHeaderL( 
   296     TPhoneCmdParamBoolean& aCommandParam )
   308     TPhoneCmdParamBoolean& aCommandParam )
   297     {
   309     {
   298     __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneIncoming::AllowShowingOfWaitingCallHeaderL() ");
   310     __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneIncoming::AllowShowingOfWaitingCallHeaderL() ");
   299 
   311 
   300     iViewCommandHandle->ExecuteCommandL( 
   312     if ( aCommandParam.Boolean() && IsNumberEntryUsedL() )
   301         EPhoneViewAllowWaitingCallHeader, 
       
   302         &aCommandParam );
       
   303     
       
   304     // Non-touch :Hide number entry if it exists on 
       
   305     // Touch : an internal operation ongoing 
       
   306     // -> do not hide dialer
       
   307     if ( !iOnScreenDialer )
       
   308         {   
       
   309         SetNumberEntryVisibilityL(EFalse);
       
   310         }
       
   311     // If param is true and number entry is open only then
       
   312     // hide number entry.
       
   313     else if ( aCommandParam.Boolean() && IsNumberEntryUsedL() )
       
   314         {
   313         {
   315         SetNumberEntryVisibilityL(EFalse);
   314         SetNumberEntryVisibilityL(EFalse);
   316         }
   315         }
   317     }
   316     }
   318 
   317