appinstaller/AppMngr2/Sisx/src/appmngr2sisxappinfo.cpp
branchRCL_3
changeset 15 51c0f5edf5ef
parent 0 ba25891c3a9e
child 18 3ba40be8e484
equal deleted inserted replaced
6:aba6b8104af3 15:51c0f5edf5ef
     1 /*
     1 /*
     2 * Copyright (c) 2003-2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   233 //
   233 //
   234 void CAppMngr2SisxAppInfo::ConstructL( Swi::RSisRegistryEntry& aEntry )
   234 void CAppMngr2SisxAppInfo::ConstructL( Swi::RSisRegistryEntry& aEntry )
   235     {
   235     {
   236     FLOG( "CAppMngr2SisxAppInfo::ConstructL()" );
   236     FLOG( "CAppMngr2SisxAppInfo::ConstructL()" );
   237     CAppMngr2AppInfo::ConstructL();     // base construct
   237     CAppMngr2AppInfo::ConstructL();     // base construct
   238     
   238 
   239     iAppUid = aEntry.UidL();
   239     iAppUid = aEntry.UidL();
   240     FLOG( "CAppMngr2SisxAppInfo::ConstructL, iAppUid = 0x%08x", iAppUid.iUid );
   240     FLOG( "CAppMngr2SisxAppInfo::ConstructL, iAppUid = 0x%08x", iAppUid.iUid );
   241     iName = aEntry.PackageNameL();
   241     iName = aEntry.PackageNameL();
   242     FLOG( "CAppMngr2SisxAppInfo::ConstructL, iName = %S", iName );
   242     FLOG( "CAppMngr2SisxAppInfo::ConstructL, iName = %S", iName );
   243     iDetails = SizeStringWithUnitsL( aEntry.SizeL() );
   243     iDetails = SizeStringWithUnitsL( aEntry.SizeL() );
   244     FLOG( "CAppMngr2SisxAppInfo::ConstructL, iDetails = %S", iDetails );
   244     FLOG( "CAppMngr2SisxAppInfo::ConstructL, aEntry.SizeL() = %Ld, iDetails = %S",
       
   245             aEntry.SizeL(), iDetails );
   245 
   246 
   246     TUint drivesMask = aEntry.InstalledDrivesL();
   247     TUint drivesMask = aEntry.InstalledDrivesL();
   247     if( drivesMask )
   248     if( drivesMask )
   248         {
   249         {
   249         // Select the highest drive as location drive
   250         // Select the highest drive as location drive
   261         }
   262         }
   262     iLocation = TAppMngr2DriveUtils::LocationFromDriveL( iLocationDrive, iFs );
   263     iLocation = TAppMngr2DriveUtils::LocationFromDriveL( iLocationDrive, iFs );
   263 
   264 
   264     iVersion = aEntry.VersionL();
   265     iVersion = aEntry.VersionL();
   265     iVendor = aEntry.LocalizedVendorNameL();
   266     iVendor = aEntry.LocalizedVendorNameL();
   266     
   267 
   267     iIsAugmentation = aEntry.IsAugmentationL();
   268     iIsAugmentation = aEntry.IsAugmentationL();
   268     if( iIsAugmentation )
   269     if( iIsAugmentation )
   269         {
   270         {
   270         Swi::CSisRegistryPackage* pkg = aEntry.PackageL();
   271         Swi::CSisRegistryPackage* pkg = aEntry.PackageL();
   271         iAugmentationIndex = pkg->Index();
   272         iAugmentationIndex = pkg->Index();
   272         delete pkg;
   273         delete pkg;
   273         }
   274         }
   274 
   275 
   275     Swi::TSisPackageTrust trustLevel = aEntry.TrustL();  
   276     Swi::TSisPackageTrust trustLevel = aEntry.TrustL();
   276     if( trustLevel >= Swi::ESisPackageCertificateChainValidatedToTrustAnchor )
   277     if( trustLevel >= Swi::ESisPackageCertificateChainValidatedToTrustAnchor )
   277         {
   278         {
   278         iIsTrusted = ETrue;
   279         iIsTrusted = ETrue;
   279         }
   280         }
   280 
   281 
   294             if( iIsDRMProtected )
   295             if( iIsDRMProtected )
   295                 {
   296                 {
   296                 FLOG( "CAppMngr2SisxAppInfo::ConstructL, protected file %S", fileName );
   297                 FLOG( "CAppMngr2SisxAppInfo::ConstructL, protected file %S", fileName );
   297                 iProtectedFile = fileName;  // takes ownership
   298                 iProtectedFile = fileName;  // takes ownership
   298                 files.Remove( fileIndex );
   299                 files.Remove( fileIndex );
   299                 iIsRightsObjectMissingOrExpired = 
   300                 iIsRightsObjectMissingOrExpired =
   300                     TAppMngr2DRMUtils::IsDRMRightsObjectExpiredOrMissingL( *fileName ); 
   301                     TAppMngr2DRMUtils::IsDRMRightsObjectExpiredOrMissingL( *fileName );
   301                 }
   302                 }
   302             }
   303             }
   303         CleanupStack::PopAndDestroy( &files );
   304         CleanupStack::PopAndDestroy( &files );
   304         }
   305         }
   305 
   306 
   314 //
   315 //
   315 void CAppMngr2SisxAppInfo::ShowDetailsL()
   316 void CAppMngr2SisxAppInfo::ShowDetailsL()
   316     {
   317     {
   317     FLOG( "CAppMngr2SisxAppInfo::ShowDetailsL()" );
   318     FLOG( "CAppMngr2SisxAppInfo::ShowDetailsL()" );
   318     TRAP_IGNORE( ReadCertificatesL() );
   319     TRAP_IGNORE( ReadCertificatesL() );
   319     
   320 
   320     CAppMngr2SisxInfoIterator* iterator = CAppMngr2SisxInfoIterator::NewL( *this,
   321     CAppMngr2SisxInfoIterator* iterator = CAppMngr2SisxInfoIterator::NewL( *this,
   321             EAppMngr2StatusInstalled );
   322             EAppMngr2StatusInstalled );
   322     CleanupStack::PushL( iterator );
   323     CleanupStack::PushL( iterator );
   323     
   324 
   324     SwiUI::CommonUI::CCUIDetailsDialog* details = SwiUI::CommonUI::CCUIDetailsDialog::NewL();
   325     SwiUI::CommonUI::CCUIDetailsDialog* details = SwiUI::CommonUI::CCUIDetailsDialog::NewL();
   325     FLOG( "CAppMngr2SisxAppInfo::ShowDetailsL, isDRM %d, noRightsObj %d, CertCount %d",
   326     FLOG( "CAppMngr2SisxAppInfo::ShowDetailsL, isDRM %d, noRightsObj %d, CertCount %d",
   326             iIsDRMProtected, iIsRightsObjectMissingOrExpired, iCertificates.Count() );
   327             iIsDRMProtected, iIsRightsObjectMissingOrExpired, iCertificates.Count() );
   327     
   328 
   328     if( iIsDRMProtected && !iIsRightsObjectMissingOrExpired )
   329     if( iIsDRMProtected && !iIsRightsObjectMissingOrExpired )
   329         {
   330         {
   330         RFile fileHandle;
   331         RFile fileHandle;
   331         TInt err = fileHandle.Open( iFs, *iProtectedFile, EFileShareReadersOnly | EFileRead );
   332         TInt err = fileHandle.Open( iFs, *iProtectedFile, EFileShareReadersOnly | EFileRead );
   332         CleanupClosePushL( fileHandle );
   333         CleanupClosePushL( fileHandle );
   333         
   334 
   334         if( iCertificates.Count() )
   335         if( iCertificates.Count() )
   335             {
   336             {
   336             details->ExecuteLD( *iterator, iCertificates, fileHandle );
   337             details->ExecuteLD( *iterator, iCertificates, fileHandle );
   337             }
   338             }
   338         else
   339         else
   351         else
   352         else
   352             {
   353             {
   353             details->ExecuteLD( *iterator );
   354             details->ExecuteLD( *iterator );
   354             }
   355             }
   355         }
   356         }
   356     
   357 
   357     CleanupStack::PopAndDestroy( iterator );
   358     CleanupStack::PopAndDestroy( iterator );
   358     }
   359     }
   359 
   360 
   360 // ---------------------------------------------------------------------------
   361 // ---------------------------------------------------------------------------
   361 // CAppMngr2SisxAppInfo::ReadCertificatesL()
   362 // CAppMngr2SisxAppInfo::ReadCertificatesL()
   364 void CAppMngr2SisxAppInfo::ReadCertificatesL()
   365 void CAppMngr2SisxAppInfo::ReadCertificatesL()
   365     {
   366     {
   366     if( !iCertsRead )
   367     if( !iCertsRead )
   367         {
   368         {
   368         FLOG_PERF_STATIC_BEGIN( SisxAppInfo_ReadCerts );
   369         FLOG_PERF_STATIC_BEGIN( SisxAppInfo_ReadCerts );
   369         
   370 
   370         Swi::RSisRegistrySession regSession;
   371         Swi::RSisRegistrySession regSession;
   371         CleanupClosePushL( regSession );
   372         CleanupClosePushL( regSession );
   372         User::LeaveIfError( regSession.Connect() );
   373         User::LeaveIfError( regSession.Connect() );
   373 
   374 
   374         Swi::RSisRegistryEntry entry;
   375         Swi::RSisRegistryEntry entry;
   398 
   399 
   399         CleanupStack::PopAndDestroy( &certificateChain );
   400         CleanupStack::PopAndDestroy( &certificateChain );
   400         CleanupStack::PopAndDestroy( &entry );
   401         CleanupStack::PopAndDestroy( &entry );
   401         CleanupStack::PopAndDestroy( &regSession );
   402         CleanupStack::PopAndDestroy( &regSession );
   402         iCertsRead = ETrue;
   403         iCertsRead = ETrue;
   403         
   404 
   404         FLOG_PERF_STATIC_END( SisxAppInfo_ReadCerts )
   405         FLOG_PERF_STATIC_END( SisxAppInfo_ReadCerts )
   405         }
   406         }
   406     }
   407     }
   407 
   408 
   408 // ---------------------------------------------------------------------------
   409 // ---------------------------------------------------------------------------
   422         }
   423         }
   423     else
   424     else
   424         {
   425         {
   425         User::Leave( KErrInUse );
   426         User::Leave( KErrInUse );
   426         }
   427         }
   427     
   428 
   428     if( iIsAugmentation )
   429     if( iIsAugmentation )
   429         {
   430         {
   430         FLOG( "CAppMngr2SisxAppInfo::HandleUninstallL, is augmentation" );
   431         FLOG( "CAppMngr2SisxAppInfo::HandleUninstallL, is augmentation" );
   431         SwiUI::TOpUninstallIndexParam params;
   432         SwiUI::TOpUninstallIndexParam params;
   432         params.iUid = iAppUid;
   433         params.iUid = iAppUid;
   433         params.iIndex = iAugmentationIndex;
   434         params.iIndex = iAugmentationIndex;
   434         
   435 
   435         SwiUI::TOpUninstallIndexParamPckg pckg( params );
   436         SwiUI::TOpUninstallIndexParamPckg pckg( params );
   436         if( iSWInstLauncherCustomUninstallParams )
   437         if( iSWInstLauncherCustomUninstallParams )
   437             {
   438             {
   438             delete iSWInstLauncherCustomUninstallParams;
   439             delete iSWInstLauncherCustomUninstallParams;
   439             iSWInstLauncherCustomUninstallParams = NULL;
   440             iSWInstLauncherCustomUninstallParams = NULL;