phoneapp/phoneuistates/src/cphoneincoming.cpp
changeset 74 d1c62c765e48
parent 65 2a5d4ab426d3
child 78 baacf668fe89
equal deleted inserted replaced
65:2a5d4ab426d3 74:d1c62c765e48
   186     TPhoneCmdParamCallStateData callState;
   186     TPhoneCmdParamCallStateData callState;
   187     callState.SetCallState( EPEStateConnected );
   187     callState.SetCallState( EPEStateConnected );
   188     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallIdByState, &callState );
   188     iViewCommandHandle->ExecuteCommandL( EPhoneViewGetCallIdByState, &callState );
   189     TInt connectedCall = callState.CallId(); 
   189     TInt connectedCall = callState.CallId(); 
   190     
   190     
   191     BeginUiUpdateLC();
   191     DisplayCallHeaderL( aCallId, ECheckIfNEUsedBeforeSettingVisibilityFalse );
   192     
   192 
   193     TPhoneCmdParamBoolean dialerParam;
       
   194     dialerParam.SetBoolean( ETrue );
       
   195     AllowShowingOfWaitingCallHeaderL( dialerParam );
       
   196       
       
   197     // Close fast swap window if it's displayed
       
   198     CEikonEnv::Static()->DismissTaskList();
       
   199     
       
   200     // If the 1st incoming call became Connected, this is waiting call
       
   201     // If the 1st incoming call went just Idle, this is a normal call
       
   202     if ( connectedCall > KErrNotFound )
   193     if ( connectedCall > KErrNotFound )
   203         {
   194         {
   204         SetTouchPaneButtons( EPhoneWaitingCallButtons );
   195         UpdateUiCommands();
   205         }
       
   206     else
       
   207         {
       
   208         SetTouchPaneButtons( EPhoneIncomingCallButtons );
       
   209         }
       
   210     
       
   211     if ( KErrNotFound == connectedCall )
       
   212         {
       
   213         dialerParam.SetBoolean( EFalse );
       
   214         }
       
   215     
       
   216     DisplayIncomingCallL( aCallId, dialerParam );
       
   217     SetTouchPaneButtons( EPhoneWaitingCallButtons );
       
   218 
       
   219     if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
       
   220             && !CPhoneCenRepProxy::Instance()->
       
   221             IsTelephonyFeatureSupported( KTelephonyLVFlagAllowUnlockOnIncoming ) 
       
   222             && ( IsKeyLockOn() || IsAutoLockOn() ) )
       
   223         {
       
   224         DisableCallUIL();
       
   225         }
       
   226     else
       
   227         {
       
   228         if ( IsKeyLockOn() )
       
   229             {
       
   230             iViewCommandHandle->ExecuteCommandL( EPhoneViewDisableKeyLockWithoutNote );
       
   231             }
       
   232         }
       
   233         
       
   234     if( CPhoneCenRepProxy::Instance()->
       
   235             IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) 
       
   236             && ( IsKeyLockOn() || IsAutoLockOn() ) )
       
   237         {
       
   238         DisableHWKeysL();
       
   239         }
       
   240         
       
   241     EndUiUpdate();
       
   242 
       
   243     if ( connectedCall > KErrNotFound )
       
   244         {
       
   245         iCbaManager->UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
       
   246         iStateMachine->ChangeState( EPhoneStateWaitingInSingle );   
   196         iStateMachine->ChangeState( EPhoneStateWaitingInSingle );   
   247         }
       
   248     }
       
   249     
       
   250 // -----------------------------------------------------------
       
   251 // CPhoneIncoming::DisplayIncomingCallL
       
   252 // -----------------------------------------------------------
       
   253 //
       
   254 void CPhoneIncoming::DisplayIncomingCallL( 
       
   255     TInt aCallId, 
       
   256     const TPhoneCmdParamBoolean aCommandParam )
       
   257     {
       
   258     __LOGMETHODSTARTEND( EPhoneUIStates, 
       
   259         "CPhoneIncoming::DisplayIncomingCallL()");
       
   260     // Cannot delete active note, e.g. New call query, 
       
   261     // but show waiting note with or without caller name
       
   262     if ( IsAnyQueryActiveL() || aCommandParam.Boolean() )
       
   263         {
       
   264         CallWaitingNoteL( aCallId );
       
   265         }
       
   266     else
       
   267         {
       
   268         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
       
   269         }
       
   270     
       
   271     // Indicate that the Phone needs to be sent to the background if
       
   272     // an application other than the top application is in the foreground
       
   273     TPhoneCmdParamBoolean booleanParam;
       
   274     booleanParam.SetBoolean( !TopAppIsDisplayedL() );
       
   275     iViewCommandHandle->ExecuteCommandL( 
       
   276         EPhoneViewSetNeedToSendToBackgroundStatus,
       
   277         &booleanParam );
       
   278 
       
   279     TPhoneCmdParamInteger uidParam;
       
   280     uidParam.SetInteger( KUidPhoneApplication.iUid );
       
   281     iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
       
   282         &uidParam );
       
   283     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetTopApplication,
       
   284         &uidParam );
       
   285 
       
   286     DisplayHeaderForCallComingInL( aCallId, ETrue ); //waiting call 
       
   287     }    
       
   288 
       
   289 // -----------------------------------------------------------
       
   290 // CPhoneIncoming::AllowShowingOfWaitingCallHeaderL
       
   291 // -----------------------------------------------------------
       
   292 //
       
   293 void CPhoneIncoming::AllowShowingOfWaitingCallHeaderL( 
       
   294     TPhoneCmdParamBoolean& aCommandParam )
       
   295     {
       
   296     __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneIncoming::AllowShowingOfWaitingCallHeaderL() ");
       
   297     if ( aCommandParam.Boolean() && IsNumberEntryUsedL() )
       
   298         {
       
   299         SetNumberEntryVisibilityL(EFalse);
       
   300         }
   197         }
   301     }
   198     }
   302 
   199 
   303 // -----------------------------------------------------------
   200 // -----------------------------------------------------------
   304 // CPhoneIncoming::HandleErrorL
   201 // CPhoneIncoming::HandleErrorL