phoneapp/phoneuistates/src/cphoneconferenceandwaiting.cpp
changeset 78 baacf668fe89
parent 76 cfea66083b62
--- a/phoneapp/phoneuistates/src/cphoneconferenceandwaiting.cpp	Mon Oct 04 16:06:10 2010 +0300
+++ b/phoneapp/phoneuistates/src/cphoneconferenceandwaiting.cpp	Fri Oct 15 12:58:46 2010 +0300
@@ -29,13 +29,13 @@
 #include "phonelogger.h"
 #include "tphonecmdparamboolean.h"
 #include "tphonecmdparaminteger.h"
-#include "tphonecmdparamcallstatedata.h"
 #include "cphonemainresourceresolver.h"
 #include "phonerssbase.h"
 #include "tphonecmdparamglobalnote.h"
 #include "phoneui.hrh"
 #include "cphonecenrepproxy.h"
 #include "mphonestorage.h"
+#include "phonecallutil.h"
 
 // ================= MEMBER FUNCTIONS =======================
 
@@ -69,12 +69,7 @@
 void CPhoneConferenceAndWaiting::ConstructL()
     {
     CPhoneConference::ConstructL();
-    
-    TPhoneCmdParamCallStateData callStateData;
-    callStateData.SetCallState( EPEStateRinging );
-    iViewCommandHandle->HandleCommandL(
-        EPhoneViewGetCallIdByState, &callStateData );
-    iRingingCallId = callStateData.CallId();
+    iRingingCallId = PhoneCallUtil::CallIdByState( EPEStateRinging );
     }
 
 // -----------------------------------------------------------
@@ -188,14 +183,9 @@
 void CPhoneConferenceAndWaiting::HandleConnectedL( TInt aCallId )
     {
     __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneConferenceAndWaiting::HandleConnectedL()");
-    TPhoneCmdParamCallStateData callStateData;
     if ( iRingingCallId == KErrNotFound )
         {
-        TPhoneCmdParamCallStateData callStateData;
-        callStateData.SetCallState( EPEStateRinging );
-        iViewCommandHandle->HandleCommandL(
-            EPhoneViewGetCallIdByState, &callStateData );
-        iRingingCallId = callStateData.CallId();   
+        iRingingCallId = PhoneCallUtil::CallIdByState( EPEStateRinging );   
         }
     
     if ( iRingingCallId == aCallId )
@@ -232,11 +222,7 @@
     __LOGMETHODSTARTEND(EPhoneUIStates, "CPhoneConferenceAndWaiting::HandleIdleL()");
     if ( iRingingCallId == KErrNotFound )
         {
-        TPhoneCmdParamCallStateData callStateData;
-        callStateData.SetCallState( EPEStateRinging );
-        iViewCommandHandle->HandleCommandL(
-            EPhoneViewGetCallIdByState, &callStateData );
-        iRingingCallId = callStateData.CallId();   
+        iRingingCallId = PhoneCallUtil::CallIdByState( EPEStateRinging );   
         }
     
     if( iRingingCallId == aCallId )
@@ -283,7 +269,8 @@
         {
         case ENoActiveCalls: // Go to incoming state
             {           
-            BringIncomingToForegroundL(); 
+            BringIncomingToForegroundL();
+            SetRingingTonePlaybackL( iRingingCallId );
             UpdateCallHeaderAndUiCommandsL( iRingingCallId );
             
             if ( iNumberEntryManager->IsNumberEntryVisibleL() )
@@ -291,7 +278,6 @@
                 iNumberEntryManager->SetNumberEntryVisibilityL(EFalse);   
                 }
             
-            SetRingingTonePlaybackL( iRingingCallId );
             SetBackButtonActive(EFalse);
             iStateMachine->ChangeState( EPhoneStateIncoming );
             }
@@ -346,11 +332,7 @@
     
     if ( iRingingCallId == KErrNotFound )
         {
-        TPhoneCmdParamCallStateData callStateData;
-        callStateData.SetCallState( EPEStateRinging );
-        iViewCommandHandle->HandleCommandL(
-            EPhoneViewGetCallIdByState, &callStateData );
-        iRingingCallId = callStateData.CallId();
+        iRingingCallId = PhoneCallUtil::CallIdByState( EPEStateRinging );
         }
         
     TPhoneCmdParamBoolean conferenceBubbleExists;