appinstaller/AppinstUi/Client/Src/SWInstLauncher.cpp
branchRCL_3
changeset 81 42552535c1ac
parent 70 e8965914fac7
equal deleted inserted replaced
73:79647526f98c 81:42552535c1ac
    23 
    23 
    24 #include "SWInstApi.h"
    24 #include "SWInstApi.h"
    25 #include "SWInstDefs.h"
    25 #include "SWInstDefs.h"
    26 #include "SWInstCommon.h"
    26 #include "SWInstCommon.h"
    27 
    27 
    28 
       
    29 using namespace SwiUI;
    28 using namespace SwiUI;
    30 
    29 
    31 // ================= MEMBER FUNCTIONS =======================
    30 // ================= MEMBER FUNCTIONS =======================
    32 
    31 
    33 // -----------------------------------------------------------------------------
    32 // -----------------------------------------------------------------------------
    47 // (other items were commented in a header).
    46 // (other items were commented in a header).
    48 // -----------------------------------------------------------------------------
    47 // -----------------------------------------------------------------------------
    49 //
    48 //
    50 EXPORT_C TInt RSWInstLauncher::Connect()
    49 EXPORT_C TInt RSWInstLauncher::Connect()
    51     {
    50     {
    52    
       
    53     TInt result( KErrNone );
    51     TInt result( KErrNone );
    54 
    52 
    55     if ( !iConnected )
    53     if ( !iConnected )
    56         {
    54         {
    57         if ( CEikonEnv::Static() )
    55         if ( CEikonEnv::Static() )
    58             {               
    56             {            
    59             TRAP( result, ConnectChainedAppL( KUidSWInstSvr ) );
    57             TRAP( result, ConnectChainedAppL( KUidSWInstSvr ) );
    60             }
    58             }
    61         else
    59         else
    62             {             
    60             {
    63             TRAP( result, REikAppServiceBase::ConnectNewAppL( KUidSWInstSvr ) );            
    61             TRAP( result, REikAppServiceBase::ConnectNewAppL( KUidSWInstSvr ) );            
    64             }
    62             }
    65         
    63         
    66         if ( result == KErrNone )
    64         if ( result == KErrNone )
    67             {
    65             {
    78 // Closes the connection to the server.
    76 // Closes the connection to the server.
    79 // (other items were commented in a header).
    77 // (other items were commented in a header).
    80 // -----------------------------------------------------------------------------
    78 // -----------------------------------------------------------------------------
    81 //  
    79 //  
    82 EXPORT_C void RSWInstLauncher::Close()
    80 EXPORT_C void RSWInstLauncher::Close()
    83     {        
    81     {
    84     if ( iConnected )
    82     if ( iConnected )
    85         {
    83         {
    86         if ( CEikonEnv::Static() )
    84         RAknAppServiceBase::Close();
    87             { 
       
    88             // Note this will crash if non ui application like SWI Daemon.
       
    89             RAknAppServiceBase::Close();
       
    90             }
       
    91         else
       
    92             {            
       
    93             // Use EikAppServiceBase if non UI application.
       
    94             REikAppServiceBase::Close();
       
    95             }
       
    96         
       
    97         iConnected = EFalse;
    85         iConnected = EFalse;
    98         }        
    86         }    
    99     }
    87     }
   100 
    88 
   101 // -----------------------------------------------------------------------------
    89 // -----------------------------------------------------------------------------
   102 // RSWInstLauncher::Install
    90 // RSWInstLauncher::Install
   103 // Launches the software install procedure.
    91 // Launches the software install procedure.