appinstaller/AppinstUi/Client/Src/SWInstLauncher.cpp
branchRCL_3
changeset 27 e8965914fac7
parent 0 ba25891c3a9e
equal deleted inserted replaced
26:8b7f4e561641 27:e8965914fac7
    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 
    28 using namespace SwiUI;
    29 using namespace SwiUI;
    29 
    30 
    30 // ================= MEMBER FUNCTIONS =======================
    31 // ================= MEMBER FUNCTIONS =======================
    31 
    32 
    32 // -----------------------------------------------------------------------------
    33 // -----------------------------------------------------------------------------
    46 // (other items were commented in a header).
    47 // (other items were commented in a header).
    47 // -----------------------------------------------------------------------------
    48 // -----------------------------------------------------------------------------
    48 //
    49 //
    49 EXPORT_C TInt RSWInstLauncher::Connect()
    50 EXPORT_C TInt RSWInstLauncher::Connect()
    50     {
    51     {
       
    52    
    51     TInt result( KErrNone );
    53     TInt result( KErrNone );
    52 
    54 
    53     if ( !iConnected )
    55     if ( !iConnected )
    54         {
    56         {
    55         if ( CEikonEnv::Static() )
    57         if ( CEikonEnv::Static() )
    56             {            
    58             {               
    57             TRAP( result, ConnectChainedAppL( KUidSWInstSvr ) );
    59             TRAP( result, ConnectChainedAppL( KUidSWInstSvr ) );
    58             }
    60             }
    59         else
    61         else
    60             {
    62             {             
    61             TRAP( result, REikAppServiceBase::ConnectNewAppL( KUidSWInstSvr ) );            
    63             TRAP( result, REikAppServiceBase::ConnectNewAppL( KUidSWInstSvr ) );            
    62             }
    64             }
    63         
    65         
    64         if ( result == KErrNone )
    66         if ( result == KErrNone )
    65             {
    67             {
    76 // Closes the connection to the server.
    78 // Closes the connection to the server.
    77 // (other items were commented in a header).
    79 // (other items were commented in a header).
    78 // -----------------------------------------------------------------------------
    80 // -----------------------------------------------------------------------------
    79 //  
    81 //  
    80 EXPORT_C void RSWInstLauncher::Close()
    82 EXPORT_C void RSWInstLauncher::Close()
    81     {
    83     {        
    82     if ( iConnected )
    84     if ( iConnected )
    83         {
    85         {
    84         RAknAppServiceBase::Close();
    86         if ( CEikonEnv::Static() )
       
    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         
    85         iConnected = EFalse;
    97         iConnected = EFalse;
    86         }    
    98         }        
    87     }
    99     }
    88 
   100 
    89 // -----------------------------------------------------------------------------
   101 // -----------------------------------------------------------------------------
    90 // RSWInstLauncher::Install
   102 // RSWInstLauncher::Install
    91 // Launches the software install procedure.
   103 // Launches the software install procedure.