phoneapp/phoneuicontrol/src/cphonestateidle.cpp
changeset 78 baacf668fe89
parent 76 cfea66083b62
equal deleted inserted replaced
76:cfea66083b62 78:baacf668fe89
    28 #include <featmgr.h>
    28 #include <featmgr.h>
    29 #include <settingsinternalcrkeys.h>
    29 #include <settingsinternalcrkeys.h>
    30 #include <mpeengineinfo.h>
    30 #include <mpeengineinfo.h>
    31 #include <mpeclientinformation.h>
    31 #include <mpeclientinformation.h>
    32 #include <bldvariant.hrh>
    32 #include <bldvariant.hrh>
       
    33 #include <apaid.h>
    33 
    34 
    34 #include "cphonepubsubproxy.h"
    35 #include "cphonepubsubproxy.h"
    35 #include "cphonecenrepproxy.h"
    36 #include "cphonecenrepproxy.h"
    36 #include "cphonestateidle.h"
    37 #include "cphonestateidle.h"
    37 #include "tphonecmdparaminteger.h"
    38 #include "tphonecmdparaminteger.h"
    43 #include "mphonestatemachine.h"
    44 #include "mphonestatemachine.h"
    44 #include "phonestatedefinitions.h"
    45 #include "phonestatedefinitions.h"
    45 #include "tphonecmdparamappinfo.h"
    46 #include "tphonecmdparamappinfo.h"
    46 #include "cphonekeys.h"
    47 #include "cphonekeys.h"
    47 
    48 
    48 #include "tphonecmdparamcallstatedata.h"
       
    49 #include "phoneviewcommanddefinitions.h"
    49 #include "phoneviewcommanddefinitions.h"
    50 #include "phoneui.hrh"
    50 #include "phoneui.hrh"
    51 #include "phonerssbase.h"
    51 #include "phonerssbase.h"
    52 #include "cphonemainresourceresolver.h"
    52 #include "cphonemainresourceresolver.h"
    53 #include "phonelogger.h"
    53 #include "phonelogger.h"
    54 #include "phoneui.pan"
    54 #include "phoneui.pan"
    55 #include "mphonecustomization.h"
    55 #include "mphonecustomization.h"
    56 
    56 
       
    57 const TUid KNetworkHandlingStarterUid = { 0x2002E67A };
    57 
    58 
    58 // ================= MEMBER FUNCTIONS =======================
    59 // ================= MEMBER FUNCTIONS =======================
    59 
    60 
    60 // C++ default constructor can NOT contain any code, that
    61 // C++ default constructor can NOT contain any code, that
    61 // might leave.
    62 // might leave.
    69     }
    70     }
    70 
    71 
    71 // Destructor
    72 // Destructor
    72 EXPORT_C CPhoneStateIdle::~CPhoneStateIdle()
    73 EXPORT_C CPhoneStateIdle::~CPhoneStateIdle()
    73     {
    74     {
       
    75     __LOGMETHODSTARTEND(
       
    76         EPhoneControl, "CPhoneStateIdle::~CPhoneStateIdle()" );
       
    77     CloseQtProcess(KNetworkHandlingStarterUid);
    74     }
    78     }
    75 
    79 
    76 // -----------------------------------------------------------
    80 // -----------------------------------------------------------
    77 // CPhoneStateIdle::ConstructL()
    81 // CPhoneStateIdle::ConstructL()
    78 // -----------------------------------------------------------
    82 // -----------------------------------------------------------
    79 //
    83 //
    80 EXPORT_C void CPhoneStateIdle::ConstructL()
    84 EXPORT_C void CPhoneStateIdle::ConstructL()
    81     {
    85     {
    82     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ConstructL() ");
    86     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::ConstructL() ");
    83     CPhoneState::BaseConstructL();
    87     CPhoneState::BaseConstructL();
       
    88 
       
    89     LaunchQtProcessL(KNetworkHandlingStarterUid);
    84     }
    90     }
    85 
    91 
    86 // -----------------------------------------------------------
    92 // -----------------------------------------------------------
    87 // CPhoneStateIdle::NewL()
    93 // CPhoneStateIdle::NewL()
    88 // -----------------------------------------------------------
    94 // -----------------------------------------------------------
   287 //
   293 //
   288 void CPhoneStateIdle::HandleIncomingL( TInt aCallId )
   294 void CPhoneStateIdle::HandleIncomingL( TInt aCallId )
   289     {
   295     {
   290     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) ");
   296     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::HandleIncomingL( ) ");
   291     HandleAudioAvailableOutputChangedL();
   297     HandleAudioAvailableOutputChangedL();
   292     SetRingingTonePlaybackL( aCallId );
   298     
       
   299     TPhoneCmdParamBoolean ringingParam;
       
   300     ringingParam.SetBoolean( ETrue );        
       
   301     iViewCommandHandle->ExecuteCommand(
       
   302             EPhoneViewSetRingingFlag,&ringingParam);
   293     
   303     
   294     BeginUiUpdateLC();
   304     BeginUiUpdateLC();
   295     iNumberEntryManager->SetVisibilityIfNumberEntryUsedL(EFalse);
   305     iNumberEntryManager->SetVisibilityIfNumberEntryUsedL(EFalse);
   296     DisplayIncomingCallL( aCallId );
   306     DisplayIncomingCallL( aCallId );
   297     SetBackButtonActive(EFalse);
   307     SetBackButtonActive(EFalse);
   298     UpdateUiCommands();
   308     UpdateUiCommands();
   299     EndUiUpdate();
   309     EndUiUpdate();
   300     
   310     
       
   311 	SetRingingTonePlaybackL( aCallId );
       
   312 	
   301     ChangeTo( EPhoneStateIncoming );
   313     ChangeTo( EPhoneStateIncoming );
   302     }
   314     }
   303 
   315 
   304 // -----------------------------------------------------------
   316 // -----------------------------------------------------------
   305 // CPhoneStateIdle::HandleDialingL
   317 // CPhoneStateIdle::HandleDialingL
   450         else
   462         else
   451 #endif // _DEBUG
   463 #endif // _DEBUG
   452             {
   464             {
   453             // call the number
   465             // call the number
   454             iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
   466             iStateMachine->PhoneEngineInfo()->SetPhoneNumber( *phoneNumber );
   455             DialMultimediaCallL();
   467             DialMultimediaCall();
   456             CleanupStack::PopAndDestroy( phoneNumber );
   468             CleanupStack::PopAndDestroy( phoneNumber );
   457             }
   469             }
   458         }
   470         }
   459     }
   471     }
   460 
   472 
   607         {
   619         {
   608         CPhoneState::SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote );
   620         CPhoneState::SendGlobalInfoNoteL( EPhoneInformationVideoCallNotAllowedDuringRestoreNote );
   609         }
   621         }
   610     else
   622     else
   611         {
   623         {
   612         CPhoneState::DialMultimediaCallL();
   624         CPhoneState::DialMultimediaCall();
   613         }
   625         }
   614     }
   626     }
   615 
   627 
   616 // -----------------------------------------------------------
   628 // -----------------------------------------------------------
   617 // CPhoneStateIdle::DialVoiceCallL
   629 // CPhoneStateIdle::DialVoiceCallL
   686     __PHONELOG1( EBasic, EPhoneControl, 
   698     __PHONELOG1( EBasic, EPhoneControl, 
   687            "PhoneUIControl: CPhoneStateIdle::ChangeTo - aState =%d ",
   699            "PhoneUIControl: CPhoneStateIdle::ChangeTo - aState =%d ",
   688            aState );
   700            aState );
   689     iStateMachine->ChangeState( aState );
   701     iStateMachine->ChangeState( aState );
   690     }
   702     }
   691 
   703     
       
   704 // -----------------------------------------------------------
       
   705 // CPhoneStateIdle::LaunchQtProcessL
       
   706 // -----------------------------------------------------------
       
   707 //
       
   708 void CPhoneStateIdle::LaunchQtProcessL(TUid aUid)
       
   709     {
       
   710     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::LaunchQtProcessL()" );
       
   711     TApaAppInfo appInfo;
       
   712     RApaLsSession lsSession;
       
   713     User::LeaveIfError( lsSession.Connect() );
       
   714     CleanupClosePushL( lsSession );
       
   715     User::LeaveIfError( lsSession.GetAppInfo( appInfo, aUid ) );
       
   716     CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
       
   717     cmdLine->SetExecutableNameL( appInfo.iFullName );
       
   718     cmdLine->SetCommandL( EApaCommandRun );
       
   719     User::LeaveIfError( lsSession.StartApp( *cmdLine ) );
       
   720     CleanupStack::PopAndDestroy( 2 );
       
   721     }
       
   722 
       
   723 // -----------------------------------------------------------
       
   724 // CPhoneStateIdle::CloseQtProcess
       
   725 // -----------------------------------------------------------
       
   726 //
       
   727 void CPhoneStateIdle::CloseQtProcess(TUid aUid)
       
   728     {
       
   729     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIdle::CloseQtProcess()" );
       
   730     TApaTaskList appList( iEnv->WsSession() );
       
   731     TApaTask task = appList.FindApp( aUid );
       
   732     if ( task.Exists() )
       
   733         {
       
   734         task.KillTask();
       
   735         }
       
   736     }
       
   737     
   692 // End of File
   738 // End of File