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