phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp
changeset 65 2a5d4ab426d3
parent 50 377c906a8701
child 74 d1c62c765e48
--- a/phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp	Mon Aug 23 15:42:12 2010 +0300
+++ b/phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp	Fri Sep 03 13:33:36 2010 +0300
@@ -118,11 +118,10 @@
     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleKeyMessageL() ");
     switch ( aCode )
         {
-        // send-key
-        case EKeyYes:
+        case EKeyYes: // send-key
             if( IsNumberEntryVisibleL() )
                 {
-                CPhoneState::CallFromNumberEntryL();                            
+                CPhoneState::CallFromNumberEntryL();
                 }
             else
                 {
@@ -134,11 +133,9 @@
                 }
             break;
             
-        // end-key
-        case EKeyNo:
+        case EKeyNo: // end-key
             if ( aMessage == EPhoneKeyLongPress )
                 {
-                // Close all connections
                 iStateMachine->SendPhoneEngineMessage(
                     MPEPhoneModel::EPEMessageTerminateAllConnections );
                  
@@ -149,7 +146,6 @@
                 
                 if ( CPhoneState::IsNumberEntryUsedL() )
                     {
-                    // Remove number entry from screen
                     iViewCommandHandle->ExecuteCommandL( 
                         EPhoneViewRemoveNumberEntry );
                     // Do state-specific operation when number entry is cleared
@@ -157,22 +153,19 @@
                     }
                 if ( !TopAppIsDisplayedL() )
                     {
-                    // Bring app to foreground
                     TPhoneCmdParamInteger uidParam;
                     uidParam.SetInteger( KUidPhoneApplication.iUid );
                     iViewCommandHandle->ExecuteCommandL(
                         EPhoneViewBringAppToForeground, &uidParam );
                     }
                 }
-            else
+            else // handle short end key
                 {
-                // handle end key
-                DisconnectOutgoingCallL();              
+                DisconnectOutgoingCallL();
                 }
             break;
             
         default:
-            // do base operation
             CPhoneGsmInCall::HandleKeyMessageL( aMessage, aCode );
             break;
         }
@@ -201,19 +194,13 @@
         case MEngineMonitor::EPEMessageIdle:
             HandleIdleL( aCallId );
             break;
-                    
-        case MEngineMonitor::EPEMessageRemoteBusy:
-            // If call setup failed then stop capturing keys.
-            CaptureKeysDuringCallNotificationL( EFalse );
-            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
-            break;
+            
         default:
             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
             break;
         }
     }
 
-
 // -----------------------------------------------------------
 // CPhoneSingleAndCallSetupAndWaiting:HandleCommandL
 // -----------------------------------------------------------
@@ -222,30 +209,24 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleCommandL() ");
     TBool commandStatus = ETrue;
-
     switch( aCommand )
-        {               
-        // 'End active call' from menu
+        {
         case EPhoneInCallCmdEndThisActiveCall:
             DisconnectOutgoingCallL();
             break;
         
-        // 'End all calls' from menu
         case EPhoneInCallCmdEndAllCalls:
             iStateMachine->SendPhoneEngineMessage(
                 MPEPhoneModel::EPEMessageReleaseAll );
             break;
             
         case EPhoneDtmfDialerCancel:
-            {
-            }
-            break;    
+            break;
             
         default:
             commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
             break;
         }
-
     return commandStatus;
     }
 
@@ -265,7 +246,6 @@
     TPhoneViewResponseId alertingResponse;
     TPhoneCmdParamCallStateData callStateData;
     
-    // Remove call 
     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
     
     callStateData.SetCallState( EPEStateHeld );
@@ -289,13 +269,10 @@
         {
         // Some or all call id fetches were unsuccesfull.
         // Terminate all connections and return to idle state.
-        
         // TBD: Kill all bubbles here
-
         iStateMachine->SendPhoneEngineMessage(
             MPEPhoneModel::EPEMessageTerminateAllConnections );
-            
-        CPhoneGsmInCall::HandleIdleL( aCallId );            
+        CPhoneGsmInCall::HandleIdleL( aCallId );
         return;
         }
 
@@ -344,39 +321,28 @@
 void CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL( TInt aCallId )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::HandleConnectingL() ");
-    
     // Remove the number entry if it isn't DTMF dialer
-    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
+    if ( !IsNumberEntryVisibleL() )
         {
         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
         }
-    
     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveGlobalNote );
     
-    // Re-enable global notes
     TPhoneCmdParamBoolean globalNotifierParam;
     globalNotifierParam.SetBoolean( EFalse );
     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
         &globalNotifierParam );
 
     BeginUiUpdateLC();
-
-    // Update bubble content
     UpdateRemoteInfoDataL( aCallId );
-    
-    // Update bubble type
     TPhoneCmdParamCallHeaderData callHeaderParam;
     callHeaderParam.SetCallState( EPEStateConnecting );
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
-        &callHeaderParam );
-        
-    EndUiUpdate();                
-
-    // Set call waiting cba
+    iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewUpdateBubble, 
+            aCallId, 
+            &callHeaderParam );
+    EndUiUpdate();
     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
-    
-    // Stop key Capture when the phone is connecting
-    CaptureKeysDuringCallNotificationL( EFalse );           
     }
 
 // -----------------------------------------------------------
@@ -387,38 +353,31 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneSingleAndCallSetupAndWaiting::HandleConnectedL()");
-    // Keep Phone in the foreground
     TPhoneCmdParamBoolean booleanParam;
     booleanParam.SetBoolean( EFalse );
     iViewCommandHandle->ExecuteCommandL( 
         EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
-
-    // Show bubble
+    
     TPhoneCmdParamCallHeaderData callHeaderParam;
     callHeaderParam.SetCallState( EPEStateConnected );
     iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
         &callHeaderParam );
     
-    // Capturing keys and number entry must be removed because some
-    // networks jump over connecting state directly to connected state.
-    CaptureKeysDuringCallNotificationL( EFalse );
-    
     // Remove the number entry if it isn't DTMF dialer
-    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
+    if ( !IsNumberEntryVisibleL() )
         {
         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
         }
     
-    if ( aCallId != iWaitingCallId )
+    if ( aCallId != iWaitingCallId ) // Alerting call is connected
         {
-        // Alerting call is connected
         StateChangeToTwoSinglesAndWaitingL( aCallId );
         }
     else   
         {
         // Waiting call is connected while alerting call is disconnecting
         // (manual control sequence '1' + Send). 
-        StateChangeToTwoSinglesL( aCallId );                      
+        StateChangeToTwoSinglesL( aCallId );
         }
     }
     
@@ -429,10 +388,8 @@
 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL( TInt aCallId )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToCallSetupAndWaitingL() ");
-    // Remove call 
     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
     
-    // Reset Hold flag to view
     TPhoneCmdParamBoolean holdFlag;
     holdFlag.SetBoolean( EFalse );
     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );       
@@ -443,9 +400,6 @@
     SetToolbarButtonLoudspeakerEnabled();
     
     EndUiUpdate();
-    
-    // Go to Call Setup And Waiting state
-    // No need to update cbas
     iStateMachine->ChangeState( EPhoneStateCallSetupAndWaiting );
     }
 
@@ -456,20 +410,14 @@
 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndWaitingL( TInt aCallId )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndWaitingL() ");
-    // Remove call 
     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
-    
-    CheckIfRestoreNEContentAfterDtmfDialer();
-      
     if ( CPhoneState::IsNumberEntryUsedL() )
         {
-        // Show number entry
         TPhoneCmdParamBoolean booleanParam;
         booleanParam.SetBoolean( ETrue );
         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetNumberEntryVisible, &booleanParam );
         }
     
-        // Set Hold flag to view
     TPhoneCmdParamBoolean holdFlag;
     holdFlag.SetBoolean( ETrue );
     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
@@ -479,9 +427,8 @@
     SetTouchPaneButtons( EPhoneWaitingCallButtons );
     
     EndUiUpdate();
-    // Go to Single And Waiting state  
     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );  
-    iStateMachine->ChangeState( EPhoneStateWaitingInSingle );        
+    iStateMachine->ChangeState( EPhoneStateWaitingInSingle );
     }
 
 // -----------------------------------------------------------
@@ -491,11 +438,10 @@
 void CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL( TInt aCallId )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, "CPhoneSingleAndCallSetupAndWaiting::StateChangeToSingleAndAlertingL() ");
-    // Remove call 
     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
 
     // Remove the number entry if it isn't DTMF dialer
-    if ( !iOnScreenDialer || !IsNumberEntryVisibleL() )
+    if ( !IsNumberEntryVisibleL() )
         {
         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
         }
@@ -506,11 +452,9 @@
     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
 
     BeginUiUpdateLC();
-    
     SetTouchPaneButtons( EPhoneCallSetupButtons );
+    EndUiUpdate();
     
-    EndUiUpdate();
-    // Go to Single And Alerting state
     UpdateCbaL( EPhoneCallHandlingInCallCBA );
     iStateMachine->ChangeState( EPhoneStateAlertingInSingle );        
     }
@@ -523,16 +467,12 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesL()");
-
     BeginUiUpdateLC();
-    
     SetTouchPaneButtons( EPhoneTwoSinglesButtons );
-    
     EndUiUpdate();
 
-    // Go to two singles state 
     UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
-    iStateMachine->ChangeState( EPhoneStateTwoSingles );                     
+    iStateMachine->ChangeState( EPhoneStateTwoSingles );
     }
 
 // -----------------------------------------------------------
@@ -543,14 +483,10 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneSingleAndCallSetupAndWaiting::StateChangeToTwoSinglesAndWaitingL()");
-
     BeginUiUpdateLC();
-    
     SetTouchPaneButtons( EPhoneWaitingCallButtons );
-    
     EndUiUpdate();
 
-    // Go to two singles state and waiting
     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
     iStateMachine->ChangeState( EPhoneStateTwoSinglesAndWaiting );
     }
@@ -563,7 +499,6 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneSingleAndCallSetupAndWaiting::UpdateInCallCbaL() ");
-    
     if ( iAlerting )
         {
         UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
@@ -573,7 +508,5 @@
         UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
         }
     }
-    
-                
 
 // End of File