phoneapp/phoneuistates/src/cphoneconference.cpp
branchRCL_3
changeset 61 41a7f70b3818
parent 58 40a3f856b14d
child 62 5266b1f337bd
--- a/phoneapp/phoneuistates/src/cphoneconference.cpp	Thu Aug 19 09:54:27 2010 +0300
+++ b/phoneapp/phoneuistates/src/cphoneconference.cpp	Tue Aug 31 15:14:29 2010 +0300
@@ -17,7 +17,6 @@
 
 
 // INCLUDES
-#include <ScreensaverInternalPSKeys.h>
 #include <eikmenub.h> 
 #include <eikenv.h>
 #include <StringLoader.h>
@@ -42,7 +41,6 @@
 #include "tphonecmdparamcallstatedata.h"
 #include "cphonekeys.h"
 #include "phonelogger.h"
-#include "cphonepubsubproxy.h"
 
 // ================= MEMBER FUNCTIONS =======================
 
@@ -83,13 +81,6 @@
     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
         &globalNotifierParam );
     
-    CPhonePubSubProxy::Instance()->ChangePropertyValue(
-                    KPSUidScreenSaver,
-                    KScreenSaverAllowScreenSaver,
-                    EPhoneScreensaverAllowed ); 
-  
-    DefineAndSetHoldFlagL();
-    
     }
 
 // -----------------------------------------------------------
@@ -153,6 +144,12 @@
             {
             TPhoneCmdParamCallHeaderData callHeaderParam;
             callHeaderParam.SetCallState( EPEStateHeld );
+            TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
+            TInt callLabelId = CPhoneMainResourceResolver::Instance()->
+                    ResolveResourceID( EPhoneCallOnHold );
+
+            StringLoader::Load( labelText, callLabelId, CCoeEnv::Static() );
+            callHeaderParam.SetLabelText( labelText );
             iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateBubble, aCallId, 
                 &callHeaderParam );
             }
@@ -168,7 +165,7 @@
             break;
             
         case MEngineMonitor::EPEMessageDialing:
-            HandleDialingL( aCallId );
+            HandleDiallingL( aCallId );
             break;
             
         case MEngineMonitor::EPEMessageIncoming:
@@ -195,7 +192,6 @@
         {   
         case EAknSoftkeyCancel:
             BeginUiUpdateLC();
-            CloseSelectionListL();
             SetTouchPaneButtons( EPhoneConferenceButtons );
             EndUiUpdate();    
             UpdateCbaL( EPhoneCallHandlingInCallCBA );
@@ -215,7 +211,6 @@
             
         // Conference -> Drop participant
         case EPhoneInCallCmdDropSelection:
-            OpenDropParticipantSelectionL();
             break;
         
         // Drop CBA    
@@ -224,7 +219,6 @@
             break;
             
         case EPhoneInCallCmdPrivateSelection:
-            OpenPrivateSelectionL();
             break;
             
         case EPhoneInCallCmdPrivate:
@@ -232,25 +226,13 @@
             break;
           
         case EPhoneInCallCmdNewCall:
-            LaunchNewCallQueryL();
             break;
             
         case EPhoneInCallCmdNewCallCall:
-            CallFromNewCallQueryL();
             break;
             
         case EPhoneInCallCmdParticipants:
-            OpenParticipantsListL();
-            break;
-            
-        case EPhoneViewOpenNumberEntry:
-            if ( IsConferenceBubbleInSelectionMode() )
-                {
-                CloseSelectionListL();
-                SetTouchPaneButtons( EPhoneConferenceButtons );
-                }
-            commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
-            break;            
+            break;     
 
         default:
             commandStatus = CPhoneGsmInCall::HandleCommandL( aCommand );
@@ -266,47 +248,7 @@
 //
 void CPhoneConference::UpdateInCallCbaL()
     {
-    if ( iViewCommandHandle->HandleCommandL( EPhoneViewIsConferenceInExpandedMode ) 
-        != EPhoneViewResponseSuccess )
-        {
-        UpdateCbaL( EPhoneCallHandlingInCallCBA );
-        }    
-    }
-
-// -----------------------------------------------------------
-// CPhoneConference::OpenMenuBarL
-// -----------------------------------------------------------
-//
-void CPhoneConference::OpenMenuBarL()
-    {
-    __LOGMETHODSTARTEND( EPhoneUIStates, 
-        "CPhoneConference::OpenMenuBarL()");
-    TInt resourceId;
-
-    if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
-        {
-        resourceId = EPhoneDtmfDialerMenubar;
-        }
-    else if ( IsNumberEntryVisibleL() )
-        {
-        resourceId = EPhoneConfCallMenubarWithNumberEntry;
-        }
-    else if ( FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) 
-              && IsConferenceBubbleInSelectionMode() )        
-        {
-        resourceId = EPhoneConfCallParticipantsMenubar;            
-        }
-    else
-        {
-        resourceId = EPhoneConfCallMenubar;
-        }
-
-    TPhoneCmdParamInteger integerParam;
-    integerParam.SetInteger( 
-        CPhoneMainResourceResolver::Instance()->
-        ResolveResourceID( resourceId ) );
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen, 
-        &integerParam );
+    UpdateCbaL( EPhoneCallHandlingInCallCBA );
     }
 
 // -----------------------------------------------------------
@@ -319,33 +261,19 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneConference::HandleKeyEventL()");
-    if ( IsConferenceBubbleInSelectionMode() )
+
+    if ( CPhoneKeys::IsNumericKey( aKeyEvent, aEventCode ) )
         {
-        if ( aKeyEvent.iCode == EKeyUpArrow ||
-             aKeyEvent.iCode == EKeyDownArrow )
-            {
-            TPhoneCmdParamKeyEvent keyEventParam;
-            keyEventParam.SetKeyEvent( aKeyEvent );
-            keyEventParam.SetEventCode( aEventCode );    
-            
-            iViewCommandHandle->ExecuteCommandL( 
-                EPhoneViewMoveHighLightInList, &keyEventParam );
-            }
+        // Handle numeric keys when key events are received 
+        // in conference state.
+        CPhoneGsmInCall::HandleNumericKeyEventL( aKeyEvent, aEventCode );
         }
     else
         {
-        if ( CPhoneKeys::IsNumericKey( aKeyEvent, aEventCode ) )
-            {
-            // Handle numeric keys when key events are received 
-            // in conference state.
-            CPhoneGsmInCall::HandleNumericKeyEventL( aKeyEvent, aEventCode );
-            }
-        else
-            {
-            // Handle other key events.
-            CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode );
-            }
+        // Handle other key events.
+        CPhoneState::HandleKeyEventL( aKeyEvent, aEventCode );
         }
+    
     }
 
 // --------------------------------------------------------------
@@ -408,12 +336,6 @@
 
     // Stop capturing keys
     CaptureKeysDuringCallNotificationL( EFalse );
-
-    // If dialler is not open then close menu bar.
-    if ( !IsNumberEntryUsedL() )
-        {
-        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
-        }
         
     // If conference bubble still exists then we have conference and
     // single call
@@ -443,7 +365,6 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneConference::HandleConferenceIdleL()");
-    BeginTransEffectLC( ENumberEntryClose );
     BeginUiUpdateLC();
     
     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveConferenceBubble );
@@ -456,7 +377,7 @@
         {
         case ENoActiveCalls:
             MakeStateTransitionToIdleL();
-            break; 
+            break;
             
         case EOneActiveCall:
             {
@@ -467,17 +388,13 @@
                 EPhoneViewGetCallIdByState, &callStateData );
                 
             if( callStateData.CallId() > KErrNotFound )
-                {            
-                CPhonePubSubProxy::Instance()->ChangePropertyValue(
-                                KPSUidScreenSaver,
-                                KScreenSaverAllowScreenSaver,
-                                EPhoneScreensaverNotAllowed );
+                {
                 UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
                 iStateMachine->ChangeState( EPhoneStateWaitingInSingle );    
                 }
             else
                 {
-                MakeStateTransitionToSingleL();
+                MakeStateTransitionToSingleL();                    
                 }
             }
             break;
@@ -490,8 +407,8 @@
             MakeStateTransitionToTwoSinglesL();
             break;
         }
-    EndUiUpdate();
-    EndTransEffect();     
+    
+    EndUiUpdate(); 
     }
 
 // -----------------------------------------------------------
@@ -503,7 +420,7 @@
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneConference::HandleHeldConferenceL()");
     TPhoneCmdParamCallHeaderData callHeaderParam;
-    callHeaderParam.SetCallState( EPEStateHeld );
+    callHeaderParam.SetCallState( EPEStateHeldConference );
     
     TInt callLabelId;
     TBuf<KPhoneCallHeaderLabelMaxLength> labelText( KNullDesC );
@@ -518,61 +435,16 @@
  
     iViewCommandHandle->ExecuteCommandL( 
         EPhoneViewUpdateBubble, aCallId, &callHeaderParam );
-       
-    // Set Hold flag to view
-    SetHoldFlagL();
-    
+           
     if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
         {
-        SendGlobalInfoNoteL( EPhoneInformationConferenceOnHold );
+        SendGlobalInfoNoteL( EPhoneInformationConferenceOnHold, ETrue );
         }
     
-    SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
-    
+    SetTouchPaneButtons( EPhoneConferenceButtons );
     UpdateInCallCbaL();
     }
 
-
-// -----------------------------------------------------------
-// CPhoneConference::DefineAndSetHoldFlagL
-// -----------------------------------------------------------
-//
-void CPhoneConference::DefineAndSetHoldFlagL()
-    {
-    // Find out is conference held or not
-    TPhoneCmdParamCallStateData callStateData;
-    callStateData.SetCallId( KConferenceCallId );
-    iViewCommandHandle->HandleCommandL( EPhoneViewGetCallState,
-            &callStateData );
-    
-    // Set Hold flag to view
-    TPhoneCmdParamBoolean holdFlag;
-        
-    if( callStateData.CallState() == EPEStateHeld )
-        {
-        holdFlag.SetBoolean( ETrue );
-        }
-    else
-        {
-        holdFlag.SetBoolean( EFalse );   
-        }
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
-    
-    }
-
-// -----------------------------------------------------------
-// CPhoneConference::SetHoldFlagL
-// -----------------------------------------------------------
-//
-void CPhoneConference::SetHoldFlagL()
-    {
-    // Set Hold flag to view
-    TPhoneCmdParamBoolean holdFlag;
-    holdFlag.SetBoolean( ETrue );
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
-
-    }
-
 // -----------------------------------------------------------
 // CPhoneConference::HandleConnectedConferenceL
 // -----------------------------------------------------------
@@ -583,8 +455,8 @@
         "CPhoneConference::HandleConnectedConferenceL()");
     // Update call state
     TPhoneCmdParamCallHeaderData callHeaderParam;
-    callHeaderParam.SetCallState( EPEStateConnected );
-
+    callHeaderParam.SetCallState( EPEStateConnectedConference );
+    
     TBuf<KPhoneCallHeaderLabelMaxLength> conferenceText( KNullDesC );
     TInt callLabelId = CPhoneMainResourceResolver::Instance()->
             ResolveResourceID( EPhoneCLIConferenceCall );
@@ -605,31 +477,15 @@
     
     if ( !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ) )
         { 
-        SendGlobalInfoNoteL( EPhoneInformationConferenceActiveted );
+        SendGlobalInfoNoteL( EPhoneInformationConferenceActiveted, ETrue );
         }
     
-    SetTouchPaneButtonEnabled( EPhoneInCallCmdPrivate );
+    SetTouchPaneButtons( EPhoneConferenceButtons );
     
     UpdateInCallCbaL();
     }
 
 // -----------------------------------------------------------
-// CPhoneConference::OpenDropParticipantSelectionL
-// -----------------------------------------------------------
-//
-void CPhoneConference::OpenDropParticipantSelectionL()
-    {
-    __LOGMETHODSTARTEND( EPhoneUIStates, 
-        "CPhoneConference::OpenDropParticipantSelectionL()");
-    TPhoneCmdParamBoolean booleanParam;
-    booleanParam.SetBoolean( ETrue );
-    iViewCommandHandle->ExecuteCommandL( 
-        EPhoneViewOpenConferenceList, &booleanParam );
-
-    iCbaManager->SetCbaL( EPhoneDropParticipantCBA );
-    }
-
-// -----------------------------------------------------------
 // CPhoneConference::DropSelectedParticipantL
 // -----------------------------------------------------------
 //
@@ -653,22 +509,6 @@
     }
 
 // -----------------------------------------------------------
-// CPhoneConference::OpenPrivateSelectionL
-// -----------------------------------------------------------
-//
-void CPhoneConference::OpenPrivateSelectionL()
-    {
-    __LOGMETHODSTARTEND( EPhoneUIStates, 
-        "CPhoneConference::OpenPrivateSelectionL()");
-    TPhoneCmdParamBoolean booleanParam;
-    booleanParam.SetBoolean( ETrue );
-    iViewCommandHandle->ExecuteCommandL( 
-        EPhoneViewOpenConferenceList, &booleanParam );
-
-    iCbaManager->SetCbaL( EPhonePrivateParticipantCBA );
-    }
-
-// -----------------------------------------------------------
 // CPhoneConference::PrivateSelectedParticipantL
 // -----------------------------------------------------------
 //
@@ -691,7 +531,6 @@
         
         // Update call view
         BeginUiUpdateLC();
-        CloseSelectionListL();
         SetTouchPaneButtons( EPhoneConferenceButtons );
         EndUiUpdate();    
                 
@@ -712,34 +551,11 @@
 
     if ( IsNumberEntryUsedL() )
         {
-        if ( NeedToReturnToForegroundAppL() )
-            {
-            // Return phone to the background if menu application is needed to foreground.
-            iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
-    
-            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
-    
-            // Set Number Entry CBA
-            iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
-            }
-        else
-            {
-            // Show the number entry if it exists
-            SetNumberEntryVisibilityL(ETrue);
-        
-            // Close dtmf dialer when call is disconnected.
-            if ( iOnScreenDialer && IsDTMFEditorVisibleL() )
-                {            
-                CloseDTMFEditorL();
-                // Display idle screen and update CBAs
-                DisplayIdleScreenL();
-                }
-            }
-        }  
-    else if ( !TopAppIsDisplayedL() || NeedToReturnToForegroundAppL() )
+        // Show the number entry if it exists
+        SetNumberEntryVisibilityL(ETrue);      
+        }
+    else if ( !TopAppIsDisplayedL() )
         {
-        // Close menu bar, if it is displayed
-        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
         
         // Continue displaying current app but set up the 
         // idle screen in the background
@@ -747,9 +563,6 @@
         }
     else
         {
-        // Close menu bar, if it is displayed
-        iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
-        
          // Display idle screen
         DisplayIdleScreenL();
         }
@@ -770,10 +583,12 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneConference::MakeStateTransitionToSingleL()");
-    // Close menu bar, if it is displayed
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
  
-
+    if ( IsNumberEntryUsedL() )
+        {
+        // Show the number entry if it exists
+        SetNumberEntryVisibilityL(ETrue);
+        }
     SetTouchPaneButtons( EPhoneIncallButtons );    
   
     // Go to single state
@@ -789,9 +604,12 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneConference::MakeStateTransitionToTwoSinglesL()");
-    // Close menu bar, if it is displayed
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
 
+    if ( IsNumberEntryUsedL() )
+        {
+        // Show the number entry if it exists
+        SetNumberEntryVisibilityL(ETrue);
+        }
         
     SetTouchPaneButtons( EPhoneTwoSinglesButtons );        
     
@@ -803,21 +621,6 @@
     }
 
 // -----------------------------------------------------------
-// CPhoneConference::CloseSelectionListL
-// -----------------------------------------------------------
-//
-void CPhoneConference::CloseSelectionListL()
-    {
-    __LOGMETHODSTARTEND( EPhoneUIStates, 
-        "CPhoneConference::CloseSelectionListL()");
-    // Close conference list
-    TPhoneCmdParamBoolean booleanParam;
-    booleanParam.SetBoolean( EFalse );
-    iViewCommandHandle->ExecuteCommandL( 
-        EPhoneViewOpenConferenceList, &booleanParam );
-    }
-
-// -----------------------------------------------------------
 // CPhoneConference::ToggleHold
 // -----------------------------------------------------------
 //
@@ -825,76 +628,78 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneConference::ToggleHoldL()");
-    TPhoneCmdParamBoolean hold;
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetHoldFlag, &hold );
+    
+    TPECallControlCaps callControlCaps =
+        iStateMachine->PhoneEngineInfo()->CallControlCaps( KConferenceCallId );
     
-    if( hold.Boolean() )
+    if ( callControlCaps & MCCECallObserver::ECCECapsHold  )
         {
+        iStateMachine->SetCallId( KConferenceCallId );         
         iStateMachine->SendPhoneEngineMessage( 
-            CPEPhoneModelIF::EPEMessageResumeConference );
+            CPEPhoneModelIF::EPEMessageHold );    
+        }
+    else if ( callControlCaps & MCCECallObserver::ECCECapsResume )
+        {
+        iStateMachine->SetCallId( KConferenceCallId );         
+        iStateMachine->SendPhoneEngineMessage( 
+            CPEPhoneModelIF::EPEMessageResume );    
         }
     else
         {
-        iStateMachine->SendPhoneEngineMessage( 
-            CPEPhoneModelIF::EPEMessageHoldConference );
+        SendGlobalInfoNoteL( EPhoneNoteTextNotAllowed, ETrue );    
         }
     }
 
 // -----------------------------------------------------------
-// CPhoneConference::HandleDialingL
+// CPhoneConference::HandleDiallingL
 // -----------------------------------------------------------
 //
-void CPhoneConference::HandleDialingL( TInt aCallId )
+void CPhoneConference::HandleDiallingL( TInt aCallId )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
-        "CPhoneConference::HandleDialingL()");
-    CPhonePubSubProxy::Instance()->ChangePropertyValue(
-                    KPSUidScreenSaver,
-                    KScreenSaverAllowScreenSaver,
-                    EPhoneScreensaverNotAllowed );
-    CloseSelectionListL();
+        "CPhoneConference::HandleDiallingL()");
+    BeginUiUpdateLC(); 
+    
+    SetNumberEntryVisibilityL(EFalse);
     
     // Display call setup 
     DisplayCallSetupL( aCallId );
-          
+    
+    // Conference is understood as single call in buttons enumerations.
+    SetTouchPaneButtons(EPhoneCallSetupAndSingleButtons); 
+
+    EndUiUpdate();
+    
+    // Set Call Setup CBA 
+    UpdateCbaL( EPhoneCallHandlingCallSetupCBA );
+      
     // Go to conference and call setup state
     iStateMachine->ChangeState( EPhoneStateConferenceAndCallSetup );
     }
 
 // -----------------------------------------------------------
-// CPhoneConference::DoStateSpecificCallSetUpDefinitionsL
+// CPhoneConference::DisplayCallSetupL
 // -----------------------------------------------------------
 //
-EXPORT_C void CPhoneConference::DoStateSpecificCallSetUpDefinitionsL()
-    {
-    // Show incoming call buttons
-    SetTouchPaneButtons( EPhoneCallSetupAndSingleButtons );
-    }
-
-// ---------------------------------------------------------
-// CPhoneConference::CallFromNewCallQueryL
-// ---------------------------------------------------------
-//
-void CPhoneConference::CallFromNewCallQueryL()
+void CPhoneConference::DisplayCallSetupL( TInt aCallId )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
-        "CPhoneConference::CallFromNewCallQueryL()");
-    // First get the phone number from the dialog
-    TPhoneCmdParamString phoneNumberParam;
-    HBufC *content = HBufC::NewLC( KPhoneNumberEntryBufferSize );
-    TPtr ptr( content->Des() );
-    phoneNumberParam.SetString( &ptr );
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetTextQueryContent,
-        &phoneNumberParam );
+        "CPhoneConference::DisplayCallSetupL()");
+
+    // Remove dialogs if necessary
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+
+    // Capture keys when the phone is dialling
+    CaptureKeysDuringCallNotificationL( ETrue );
 
-    // Store the phone number
-    iStateMachine->PhoneEngineInfo()->SetPhoneNumber( ptr );
+    // Bring Phone app in the foreground
+    TPhoneCmdParamInteger uidParam;
+    uidParam.SetInteger( KUidPhoneApplication.iUid );
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewBringAppToForeground,
+        &uidParam );
 
-    // clean up stack
-    CleanupStack::PopAndDestroy( content );
-  
-    // Dial number
-    DialVoiceCallL();
+    // Display call setup header
+    DisplayHeaderForOutgoingCallL( aCallId );
     }
 
 // -----------------------------------------------------------
@@ -906,44 +711,25 @@
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneConference::HandleIncomingL()");
     
-    CPhonePubSubProxy::Instance()->ChangePropertyValue(
-                    KPSUidScreenSaver,
-                    KScreenSaverAllowScreenSaver,
-                    EPhoneScreensaverNotAllowed );
-    
-    IsNumberEntryUsedL() ? 
-        BeginTransEffectLC( ECallUiAppear ) :
-        BeginTransEffectLC( ENumberEntryOpen );
     BeginUiUpdateLC();
-    
-    // Hide the number entry if it exists
-    if ( IsNumberEntryUsedL() )
-        {
-        SetNumberEntryVisibilityL( EFalse );    
-        }
-    
-    // Indicate that the menu application on foreground needs to be sent back to the foreground 
-    // after call is ended.
-    SetNeedToReturnToForegroundAppStatusL( !TopAppIsDisplayedL() );
-    
+ 
     TPhoneCmdParamBoolean dialerParam;
     dialerParam.SetBoolean( ETrue );
     
     // Get allow waiting call header param value.
     AllowShowingOfWaitingCallHeaderL( dialerParam );
-            
-    CloseSelectionListL();
-
     // Close fast swap window if it's displayed
-    EikonEnv()->DismissTaskList();
-
-    SetTouchPaneButtons( EPhoneWaitingCallButtons );
+    CEikonEnv::Static()->DismissTaskList();
+    
+    // Check if HW Keys or Call UI should be disabled
+    CheckDisableHWKeysAndCallUIL();
     
     // Display incoming call
     DisplayIncomingCallL( aCallId, dialerParam );
+    
+    SetTouchPaneButtons( EPhoneWaitingCallButtons );
 
     EndUiUpdate();
-    EndTransEffect();
 
     // Go to incoming state
     UpdateCbaL( EPhoneCallHandlingCallWaitingCBA );
@@ -956,19 +742,31 @@
 //
 void CPhoneConference::DisplayIncomingCallL( 
     TInt aCallId, 
-    const TPhoneCmdParamBoolean /*aCommandParam*/ )
+    const TPhoneCmdParamBoolean aCommandParam )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneConference::DisplayIncomingCallL()");
-    // Close menu bar, if it is displayed
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
 
-    // Remove any phone dialogs if they are displayed
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+    // Cannot delete active note, e.g. New call query, 
+    // but show waiting note with or without caller name
+    if ( IsAnyQueryActiveL() ||  
+        ( !aCommandParam.Boolean() && iOnScreenDialer ) )
+        {
+        CallWaitingNoteL( aCallId );        
+        }
+    else
+        {
+        // Remove any phone dialogs if they are displayed
+        iViewCommandHandle->ExecuteCommandL( EPhoneViewRemovePhoneDialogs );
+        }
 
     // Indicate that the Phone needs to be sent to the background if
     // an application other than the top application is in the foreground
-    SetNeedToReturnToForegroundAppStatusL( !TopAppIsDisplayedL() );
+    TPhoneCmdParamBoolean booleanParam;
+    booleanParam.SetBoolean( !TopAppIsDisplayedL() );
+    iViewCommandHandle->ExecuteCommandL( 
+        EPhoneViewSetNeedToSendToBackgroundStatus,
+        &booleanParam );
 
     // Bring Phone app in the foreground
     TPhoneCmdParamInteger uidParam;
@@ -1010,7 +808,6 @@
         UpdateCbaL( EPhoneCallHandlingNewCallSwapCBA );
         iStateMachine->ChangeState( EPhoneStateConferenceAndSingle );                    
         SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );
-        SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
         }
     else
         {            
@@ -1018,73 +815,6 @@
         }       
     EndUiUpdate();
     }
-
-// -----------------------------------------------------------
-// CPhoneConference::OpenParticipantsListL
-// -----------------------------------------------------------
-//    
-void CPhoneConference::OpenParticipantsListL()
-    {
-    BeginUiUpdateLC();
-    
-    TPhoneCmdParamBoolean booleanParam;
-    booleanParam.SetBoolean( ETrue );
-    
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewOpenConferenceList,
-                                         &booleanParam );    
-
-    SetTouchPaneButtons( EPhoneParticipantListButtons );
-                                         
-    EndUiUpdate();
-    
-    iCbaManager->SetCbaL( EPhoneParticipantListCBA );
-     
-    // Find out is conference held or not
-    TPhoneCmdParamCallStateData callStateData;
-    callStateData.SetCallId( KConferenceCallId );
-    iViewCommandHandle->HandleCommandL( EPhoneViewGetCallState,
-        &callStateData );
-    
-    if( callStateData.CallState() == EPEStateHeld )
-        {
-        //set Private button to Dimmed.        
-        SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
-        } 
-    else
-        {
-        //set Private button to UnDimmed.        
-         SetTouchPaneButtonEnabled( EPhoneInCallCmdPrivate );        
-        }   
-                                           
-    }
-
-// -----------------------------------------------------------
-// CPhoneConference::IsConferenceBubbleInSelectionMode
-// -----------------------------------------------------------
-//
-TBool CPhoneConference::IsConferenceBubbleInSelectionMode() const
-    {
-    TPhoneCmdParamBoolean booleanParam;
-    
-    iViewCommandHandle->ExecuteCommand( 
-        EPhoneViewGetIsConferenceInSelectionMode, &booleanParam );
-    
-    return booleanParam.Boolean();
-    }
-
-// ---------------------------------------------------------
-// CPhoneState::HandleCreateNumberEntryL
-// ---------------------------------------------------------
-//
-void CPhoneConference::HandleCreateNumberEntryL( const TKeyEvent& aKeyEvent,
-        TEventCode aEventCode )
-    {
-    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneConference::HandleCreateNumberEntryL() ");
-    if ( !IsConferenceBubbleInSelectionMode() )
-        {
-        CPhoneGsmInCall::HandleCreateNumberEntryL( aKeyEvent,aEventCode );
-        }
-    }
     
 // -----------------------------------------------------------
 // CPhoneConference::UpdateConferenceSecurityStatusL
@@ -1111,35 +841,4 @@
         }
     }
 
-// -----------------------------------------------------------
-// CPhoneConference::DisconnectCallL
-// -----------------------------------------------------------
-//
-void CPhoneConference::DisconnectCallL()
-    {
-    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneConference::DisconnectCallL( ) ");
-    // Fetch active call's id from view
-    TPhoneCmdParamCallStateData callStateData;
-    callStateData.SetCallState( EPEStateConnected );
-    iViewCommandHandle->HandleCommandL(
-        EPhoneViewGetCallIdByState, &callStateData );
-
-    if( callStateData.CallId() == KErrNotFound )
-        {
-        // No connected call, find the hold call
-        callStateData.SetCallState( EPEStateHeld );
-        iViewCommandHandle->HandleCommandL(
-            EPhoneViewGetCallIdByState, &callStateData );
-        }
-  
-    if( callStateData.CallId() > KErrNotFound  )
-        {
-        iStateMachine->SendPhoneEngineMessage(
-                      CPEPhoneModelIF::EPEMessageHangUpConference );  
-        }
-    else
-        {
-        CPhoneState::DisconnectCallL();
-        }
-    }
 // End of File