homescreenpluginsrv/hspsmanager/src/hspsrominstaller.cpp
branchRCL_3
changeset 22 1b207dd38b72
parent 19 edd621764147
child 27 2c7f27287390
equal deleted inserted replaced
19:edd621764147 22:1b207dd38b72
    67 // ChspsRomInstaller::NewL()
    67 // ChspsRomInstaller::NewL()
    68 // Two-phased constructor.
    68 // Two-phased constructor.
    69 // -----------------------------------------------------------------------------
    69 // -----------------------------------------------------------------------------
    70 ChspsRomInstaller* ChspsRomInstaller::NewL( 
    70 ChspsRomInstaller* ChspsRomInstaller::NewL( 
    71 		ChspsThemeServer& aThemeServer,
    71 		ChspsThemeServer& aThemeServer,
    72 		RFs& aFsSession )
    72 		RFs& aFsSession,
    73     {
    73 		const TBool aInstallUdaEmmc )
    74     ChspsRomInstaller* self = NewLC( aThemeServer, aFsSession );
    74     {    
       
    75     ChspsRomInstaller* self = 
       
    76             new ( ELeave ) ChspsRomInstaller( aThemeServer, aFsSession, aInstallUdaEmmc );
       
    77     CleanupStack::PushL( self );
       
    78     self->ConstructL();
    75     CleanupStack::Pop( self );
    79     CleanupStack::Pop( self );
    76     return( self ) ;
    80     return( self ) ;
    77     }
    81     }
    78 
    82 
    79 // -----------------------------------------------------------------------------
       
    80 // ChspsRomInstaller::NewLC()
       
    81 // Two-phased constructor.
       
    82 // -----------------------------------------------------------------------------
       
    83 ChspsRomInstaller* ChspsRomInstaller::NewLC( 
       
    84 		ChspsThemeServer& aThemeServer,
       
    85 		RFs& aFsSession)
       
    86     {
       
    87     ChspsRomInstaller* self = new ( ELeave ) ChspsRomInstaller( aThemeServer, aFsSession );
       
    88     CleanupStack::PushL( self );
       
    89     self->ConstructL();
       
    90     return self;
       
    91     }
       
    92 
    83 
    93 // -----------------------------------------------------------------------------
    84 // -----------------------------------------------------------------------------
    94 // ChspsRomInstaller::ConstructL()
    85 // ChspsRomInstaller::ConstructL()
    95 // Symbian 2nd phase constructor can leave.
    86 // Symbian 2nd phase constructor can leave.
    96 // -----------------------------------------------------------------------------
    87 // -----------------------------------------------------------------------------
    99     {    
    90     {    
   100     iInstallationHandler = ChspsInstallationHandler::NewL( iThemeServer );    
    91     iInstallationHandler = ChspsInstallationHandler::NewL( iThemeServer );    
   101     
    92     
   102     // Prevent notifications from ROM based installations
    93     // Prevent notifications from ROM based installations
   103     iInstallationHandler->DisableNotifications();
    94     iInstallationHandler->DisableNotifications();
       
    95     
       
    96     // Skip UDA and eMMC drives if restoring plug-ins
       
    97     if( !iInstallUdaEmmc )
       
    98         {
       
    99         iInstallationHandler->DisableUdaEmmcInstallations();
       
   100         }
   104     }
   101     }
   105 
   102 
   106 // -----------------------------------------------------------------------------
   103 // -----------------------------------------------------------------------------
   107 // ChspsRomInstaller::ChspsRomInstaller()
   104 // ChspsRomInstaller::ChspsRomInstaller()
   108 // C++ default constructor can NOT contain any code, that might leave.
   105 // C++ default constructor can NOT contain any code, that might leave.
   109 // -----------------------------------------------------------------------------
   106 // -----------------------------------------------------------------------------
   110 ChspsRomInstaller::ChspsRomInstaller(
   107 ChspsRomInstaller::ChspsRomInstaller(
   111 		ChspsThemeServer& aThemeServer,
   108 		ChspsThemeServer& aThemeServer,
   112         RFs& aFsSession )
   109         RFs& aFsSession,
   113 		: CActive(EPriorityStandard), 
   110         const TBool aInstallUdaEmmc )
   114 		    iThemeServer(aThemeServer), 
   111 		: CActive( EPriorityStandard ), 
   115 		    iFsSession(aFsSession),
   112 		    iThemeServer( aThemeServer ), 
   116 		    iRet(EhspsInstallThemeFailed)
   113 		    iFsSession( aFsSession ),
       
   114 		    iRet( EhspsInstallThemeFailed ),
       
   115             iInstallUdaEmmc( aInstallUdaEmmc )
   117     {
   116     {
   118     CActiveScheduler::Add( this );
   117     CActiveScheduler::Add( this );
   119     }
   118     }
   120 
   119 
   121 // -----------------------------------------------------------------------------
   120 // -----------------------------------------------------------------------------
   136 void ChspsRomInstaller::InstallL()
   135 void ChspsRomInstaller::InstallL()
   137     {
   136     {
   138     RPointerArray<HBufC> fileArray;
   137     RPointerArray<HBufC> fileArray;
   139     CleanupResetAndDestroyPushL( fileArray );
   138     CleanupResetAndDestroyPushL( fileArray );
   140             
   139             
   141     // Find UDA and ROM widgets to be installed     
   140     // Find the manifest files     
   142     FindInstallationFilesL( fileArray );
   141     FindInstallationFilesL( fileArray );
   143             
   142             
   144     // Install the manifest files    
   143     // Install the manifest files    
   145     for( TInt index=0; index < fileArray.Count(); index++ )
   144     for( TInt index=0; index < fileArray.Count(); index++ )
   146         {         
   145         {         
   172 void ChspsRomInstaller::FindInstallationFilesL(  
   171 void ChspsRomInstaller::FindInstallationFilesL(  
   173         RPointerArray<HBufC>& aFileArray )
   172         RPointerArray<HBufC>& aFileArray )
   174     {
   173     {
   175     __ASSERT_DEBUG( aFileArray.Count() == 0, User::Leave( KErrArgument ) );
   174     __ASSERT_DEBUG( aFileArray.Count() == 0, User::Leave( KErrArgument ) );
   176                     
   175                     
   177     DoFindInstallationFilesL( aFileArray, KPrivateInstallE );
   176     if( iInstallUdaEmmc )
   178     DoFindInstallationFilesL( aFileArray, KPrivateInstallC );    
   177         {
       
   178         // Handle installation of the imaker exports 
       
   179         DoFindInstallationFilesL( aFileArray, KPrivateInstallE );    
       
   180         DoFindInstallationFilesL( aFileArray, KPrivateInstallC );  
       
   181         }
       
   182     
       
   183     // ROM
   179     DoFindInstallationFilesL( aFileArray, KPrivateInstallZ );    
   184     DoFindInstallationFilesL( aFileArray, KPrivateInstallZ );    
   180     }
   185     }
   181 
   186 
   182 // -----------------------------------------------------------------------------
   187 // -----------------------------------------------------------------------------
   183 // ChspsRomInstaller::DoFindInstallationFilesL()
   188 // ChspsRomInstaller::DoFindInstallationFilesL()