applicationmanagement/server/src/AMPreInstallApp.cpp
branchRCL_3
changeset 57 6757f1e2efd2
parent 0 3ce708148e4d
child 58 5b858729772b
equal deleted inserted replaced
55:c4687ff85147 57:6757f1e2efd2
    13  *
    13  *
    14  * Description: Implementation of applicationmanagement components
    14  * Description: Implementation of applicationmanagement components
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #include "AMPreInstallApp.h"
    18 
    19 #include <pathinfo.h>
    19 #include <pathinfo.h>
    20 #include <driveinfo.h>
    20 #include <driveinfo.h>
    21 #include "debug.h"
       
    22 #include <apmstd.h>  //for KMaxDataTypeLength
    21 #include <apmstd.h>  //for KMaxDataTypeLength
    23 #include <sisregistrysession.h>
    22 #include <sisregistrysession.h>
    24 #include <sisregistrypackage.h>
    23 #include <sisregistrypackage.h>
    25 #include <e32cmn.h> 
    24 #include <e32cmn.h> 
    26 #include<utf.h>
    25 #include <utf.h>
    27 #include<sisregistryentry.h>
    26 #include <sisregistryentry.h>
    28 #include <caf/caf.h>
    27 #include <caf/caf.h>
    29 #include <apgcli.h>
    28 #include <apgcli.h>
    30 #include <SWInstDefs.h>
    29 #include <SWInstDefs.h>
    31 
    30 
       
    31 #include "AMPreInstallApp.h"
       
    32 #include "debug.h"
       
    33 
    32 using namespace NApplicationManagement;
    34 using namespace NApplicationManagement;
    33 CAMPreInstallApp* CAMPreInstallApp::NewL()
    35 CAMPreInstallApp* CAMPreInstallApp::NewL()
    34     {
    36     {
    35     CAMPreInstallApp* self = CAMPreInstallApp::NewLC();
    37     CAMPreInstallApp* self = CAMPreInstallApp::NewLC();
    36     CleanupStack::Pop(self);
    38     CleanupStack::Pop(self);
    37     return self;
    39     return self;
    38 
    40 
    39     }
    41     }
       
    42 
       
    43 
    40 CAMPreInstallApp* CAMPreInstallApp::NewLC()
    44 CAMPreInstallApp* CAMPreInstallApp::NewLC()
    41     {
    45     {
    42     CAMPreInstallApp *self = new ( ELeave ) CAMPreInstallApp(  );
    46     CAMPreInstallApp *self = new (ELeave) CAMPreInstallApp();
    43     CleanupStack::PushL( self ) ;
    47     CleanupStack::PushL(self);
    44     self->ConstructL() ;
    48     self->ConstructL();
    45     return self;
    49     return self;
    46 
    50 
    47     }
    51     }
    48 CAMPreInstallApp::CAMPreInstallApp()
    52 CAMPreInstallApp::CAMPreInstallApp()
    49     {
    53     {
    63     User::LeaveIfError(iFs.Connect() );
    67     User::LeaveIfError(iFs.Connect() );
    64     TPtrC mmcDrive(TParsePtrC( PathInfo::MemoryCardRootPath() ).Drive());
    68     TPtrC mmcDrive(TParsePtrC( PathInfo::MemoryCardRootPath() ).Drive());
    65       iPreInstallPath.Append(mmcDrive);
    69       iPreInstallPath.Append(mmcDrive);
    66       iPreInstallPath.Append(KPreInstallPath);
    70       iPreInstallPath.Append(KPreInstallPath);
    67     }
    71     }
    68 void CAMPreInstallApp::GetPreInstalledAppsL(RPointerArray<TPreInstalledAppParams> &aPreInstalledAppParams)
    72 void CAMPreInstallApp::GetPreInstalledAppsL(RPointerArray<
       
    73         TPreInstalledAppParams> &aPreInstalledAppParams)
    69     {
    74     {
    70 
    75 
    71     MakeAllInstallPathsL();
    76     MakeAllInstallPathsL();
    72     ListPreInstalledAppL();
    77     ListPreInstalledAppL();
    73     aPreInstalledAppParams = iPreInstalledAppParams;
    78     aPreInstalledAppParams = iPreInstalledAppParams;
   108                 CleanupStack::PopAndDestroy(pathAndName);
   113                 CleanupStack::PopAndDestroy(pathAndName);
   109                 continue;
   114                 continue;
   110                 }
   115                 }
   111 
   116 
   112 #ifdef RD_MULTIPLE_DRIVE
   117 #ifdef RD_MULTIPLE_DRIVE
   113             if ( TParsePtrC( installDocPath ).Path().CompareF(KPreInstallPath) == 0 )
   118             if (TParsePtrC(installDocPath).Path().CompareF(KPreInstallPath)
       
   119                     == 0)
   114 #else
   120 #else
   115             if (installDocPath.CompareF(iPreInstallPath) == 0)
   121             if (installDocPath.CompareF(iPreInstallPath) == 0)
   116 #endif
   122 #endif
   117                 {
   123                 {
   118 
   124 
   153 		//User::LeaveIfError(regEntryError);
   159 		//User::LeaveIfError(regEntryError);
   154 		if (regEntryError == KErrNone)
   160 		if (regEntryError == KErrNone)
   155 		    {
   161 		    {
   156                 CleanupClosePushL(registryEntry);
   162                 CleanupClosePushL(registryEntry);
   157                 TBool isPreInstalled = registryEntry.PreInstalledL();
   163                 TBool isPreInstalled = registryEntry.PreInstalledL();
       
   164                // TBool isPreInstalled = ETrue;
       
   165 
   158                 RDEBUG_4("Clist_PreInstallAppUi: ListPreInstalledApp: UID is : '0x%X', installed:, preinstalled %d  %d",appUid,installed,isPreInstalled);
   166                 RDEBUG_4("Clist_PreInstallAppUi: ListPreInstalledApp: UID is : '0x%X', installed:, preinstalled %d  %d",appUid,installed,isPreInstalled);
   159 
   167 
   160                 for (TInt i(0); isPreInstalled && i < uids.Count(); i++)
   168                 for (TInt i(0); isPreInstalled && i < uids.Count(); i++)
   161                     {
   169                     {
   162                     if (appUid == uids[i])
   170                     if (appUid == uids[i])
   223         }
   231         }
   224 #else   
   232 #else   
   225     if (iPreInstallDocumentPath.Length() > 0)
   233     if (iPreInstallDocumentPath.Length() > 0)
   226         {
   234         {
   227         ListPreInstalledAppL(iPreInstallDocumentPath);
   235         ListPreInstalledAppL(iPreInstallDocumentPath);
       
   236         //_LIT(KInstallpath,"C:\\private\\10202dce\\");
       
   237         //ListPreInstalledAppL(KInstallpath);
   228         }
   238         }
   229 #endif
   239 #endif
   230     }
   240 
       
   241     }
       
   242     
   231 TBool CAMPreInstallApp::RecognizeL(TDesC& aPathAndName, HBufC* aMimeType)
   243 TBool CAMPreInstallApp::RecognizeL(TDesC& aPathAndName, HBufC* aMimeType)
   232     {
   244     {
   233     TBool IsOK(ETrue);
   245     TBool IsOK(ETrue);
   234     ContentAccess::CContent* pkgContent = ContentAccess::CContent::NewLC(
   246     ContentAccess::CContent* pkgContent = ContentAccess::CContent::NewLC(
   235             aPathAndName, ContentAccess::EContentShareReadWrite);
   247             aPathAndName, ContentAccess::EContentShareReadWrite);