phoneclientserver/phoneserver/Src/Ussd/CPhSrvUssdManager.cpp
changeset 31 a2467631ae02
parent 15 d7fc66ccd6fb
child 32 1f002146abb4
equal deleted inserted replaced
27:7eb70891911c 31:a2467631ae02
    47 #include <coreapplicationuisdomainpskeys.h>
    47 #include <coreapplicationuisdomainpskeys.h>
    48 
    48 
    49 
    49 
    50 // CONSTANTS
    50 // CONSTANTS
    51 const TInt KPhSrvDefaultValue = 0x00000000;
    51 const TInt KPhSrvDefaultValue = 0x00000000;
    52 // const TInt KPhSrvUssdNoTone = 0; // See SharedDataKeysVariant.h or NcnListInternalPSKeys.h
    52 // See SharedDataKeysVariant.h or NcnListInternalPSKeys.h
       
    53 // const TInt KPhSrvUssdNoTone = 0; 
    53 // const TInt KPhSrvUssdTimeOutObserverGranularity = 2;
    54 // const TInt KPhSrvUssdTimeOutObserverGranularity = 2;
    54 // const TInt KPhSrvUssdSentMessageObserverGranularity = 2;
    55 // const TInt KPhSrvUssdSentMessageObserverGranularity = 2;
    55 const TInt KPhSrvUssdAppUID = 0x10005955;
    56 // See KUssdSecureId in phcltclientserver.h
       
    57 //const TInt KPhSrvUssdAppUID = 0x10005955; 
    56 
    58 
    57 const TInt KPhSrvUssdMessageQueryInterval = 500000; // 0.5 sec
    59 const TInt KPhSrvUssdMessageQueryInterval = 500000; // 0.5 sec
    58 //const TInt KPhSrvUssdNoteExitPeriod = 500000; // 0.5 sec
    60 //const TInt KPhSrvUssdNoteExitPeriod = 500000; // 0.5 sec
    59 //
    61 //
    60 const TUint KPhSrvUssdDefaultDCS = 0x0f;                        // 00001111
    62 const TUint KPhSrvUssdDefaultDCS = 0x0f;                        // 00001111
   729     RWsSession wsSession;
   731     RWsSession wsSession;
   730     User::LeaveIfError(wsSession.Connect());
   732     User::LeaveIfError(wsSession.Connect());
   731     _DPRINT( 4, "PhSrv.UssdAppTaskExists.wsSession.Connect" );
   733     _DPRINT( 4, "PhSrv.UssdAppTaskExists.wsSession.Connect" );
   732     CleanupClosePushL(wsSession);
   734     CleanupClosePushL(wsSession);
   733     TApaTaskList tasklist(wsSession);
   735     TApaTaskList tasklist(wsSession);
   734     TApaTask task = tasklist.FindApp(TUid::Uid(KPhSrvUssdAppUID));
   736     TApaTask task = tasklist.FindApp( KUssdSecureId );
   735     ret = task.Exists();
   737     ret = task.Exists();
   736 
   738 
   737     CleanupStack::PopAndDestroy();
   739     CleanupStack::PopAndDestroy();
   738     return ret;
   740     return ret;
   739 }
   741 }
  1718     _DPRINT( 4, "PhSrv.RequestStartEditingL.wsSession.connect" );     // debug print
  1720     _DPRINT( 4, "PhSrv.RequestStartEditingL.wsSession.connect" );     // debug print
  1719     CleanupClosePushL( wsSession );
  1721     CleanupClosePushL( wsSession );
  1720 
  1722 
  1721     // Find the task with name
  1723     // Find the task with name
  1722     TApaTaskList tasklist( wsSession );
  1724     TApaTaskList tasklist( wsSession );
  1723     TApaTask task = tasklist.FindApp( TUid::Uid( KPhSrvUssdAppUID ) );
  1725     TApaTask task = tasklist.FindApp( KUssdSecureId );
  1724 
  1726 
  1725     // If task exists, bring it to foreground
  1727     // If task exists, bring it to foreground
  1726     if ( task.Exists() )
  1728     if ( task.Exists() )
  1727         {
  1729         {
  1728         _DPRINT( 4, "PhSrv.UssdM.RequestStartEditingL.task.BringToForeground" );
  1730         _DPRINT( 4, "PhSrv.UssdM.RequestStartEditingL.task.BringToForeground" );
  1735         User::LeaveIfError( apaLsSession.Connect() );
  1737         User::LeaveIfError( apaLsSession.Connect() );
  1736         _DPRINT( 4, "PhSrv.RequestStartEditingL.apaLsSession.connect" );     // debug print
  1738         _DPRINT( 4, "PhSrv.RequestStartEditingL.apaLsSession.connect" );     // debug print
  1737         CleanupClosePushL( apaLsSession );
  1739         CleanupClosePushL( apaLsSession );
  1738 
  1740 
  1739         TApaAppInfo appInfo;
  1741         TApaAppInfo appInfo;
  1740         TInt err = apaLsSession.GetAppInfo(
  1742         
  1741             appInfo,
  1743         TInt err = apaLsSession.GetAppInfo( appInfo, KUssdSecureId );
  1742             TUid::Uid( KPhSrvUssdAppUID )  );
  1744         _DDPRINT( 4, "PhSrv.RequestStartEditingL.GetAppInfo ", err );     // debug print
       
  1745         
  1743         if ( err == KErrNone )
  1746         if ( err == KErrNone )
  1744             {
  1747             {
  1745             _DDPRINT( 4, "PhSrv.RequestStartEditingL.GetAppInfo ", err );     // debug print
       
  1746 
       
  1747         #ifndef SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1
  1748         #ifndef SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1
  1748             CApaCommandLine* apaCommandLine = CApaCommandLine::NewLC();
  1749             CApaCommandLine* apaCommandLine = CApaCommandLine::NewLC();
  1749             apaCommandLine->SetExecutableNameL( appInfo.iFullName );
  1750             apaCommandLine->SetExecutableNameL( appInfo.iFullName );
  1750         #else // SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1
  1751         #else // SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1
  1751             CApaCommandLine* apaCommandLine =
  1752             CApaCommandLine* apaCommandLine =
  1752                 CApaCommandLine::NewLC( appInfo.iFullName );
  1753                 CApaCommandLine::NewLC( appInfo.iFullName );
  1753         #endif // SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1
  1754         #endif // SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1
  1754 
  1755 
  1755             err = apaLsSession.StartApp( *apaCommandLine );
  1756             TThreadId id( static_cast<TInt64>( 0 ) );
       
  1757             err = apaLsSession.StartApp( *apaCommandLine, id );
       
  1758             _DDPRINT( 4, "PhSrv.RequestStartEditingL.ThreadId ", id ); 
  1756             CleanupStack::PopAndDestroy( apaCommandLine );
  1759             CleanupStack::PopAndDestroy( apaCommandLine );
  1757             }
  1760             }
  1758         CleanupStack::PopAndDestroy(); // apaLsSession
  1761         CleanupStack::PopAndDestroy( &apaLsSession ); // apaLsSession
  1759         
  1762         
  1760         // bring the ussd editor to foreground, only for testing
  1763         // bring the ussd editor to foreground, only for testing
  1761         TApaTaskList tasklist( wsSession );
  1764         TApaTaskList tasklist( wsSession );
  1762         TApaTask task = tasklist.FindApp( TUid::Uid( KPhSrvUssdAppUID ) );
  1765         TApaTask task = tasklist.FindApp( KUssdSecureId );
  1763         if ( task.Exists() )
  1766         if ( task.Exists() )
  1764             {
  1767             {
  1765             _DPRINT( 4, "PhSrv.UssdM.RequestStartEditingL.task.BringToForeground" );
  1768             _DPRINT( 4, "PhSrv.UssdM.RequestStartEditingL.task.BringToForeground" );
  1766             task.BringToForeground();
  1769             task.BringToForeground();
  1767             }
  1770             }