javamanager/javasettings/appmngrplugin/src/appmngr2midletappinfo.cpp
branchRCL_3
changeset 83 26b2b12093af
parent 71 d5e927d5853b
equal deleted inserted replaced
77:7cee158cb8cd 83:26b2b12093af
   777         if (KErrNone != err)
   777         if (KErrNone != err)
   778         {
   778         {
   779             ELOG1(EJavaAppMngrPlugin, "GetAppIconL error %d", err);
   779             ELOG1(EJavaAppMngrPlugin, "GetAppIconL error %d", err);
   780         }
   780         }
   781     }
   781     }
   782 
   782     
   783     CleanupStack::PopAndDestroy(&midletUids);
   783     CleanupStack::PopAndDestroy(&midletUids);
   784 
   784 
   785     // security domain
   785     // security domain
   786     CAppMngr2MidletSettingsHandler* settingsHandler
   786     CAppMngr2MidletSettingsHandler* settingsHandler
   787     = CAppMngr2MidletSettingsHandler::NewL(*iLocalizedMIDletName, iEntry->Uid(), iResourceHandler);
   787     = CAppMngr2MidletSettingsHandler::NewL(*iLocalizedMIDletName, iEntry->Uid(), iResourceHandler);
   788     CleanupStack::PushL(settingsHandler);
   788     CleanupStack::PushL(settingsHandler);
   789     iSecurityDomainCategory = settingsHandler->GetSecurityDomainCategoryL();
   789     iSecurityDomainCategory = settingsHandler->GetSecurityDomainCategory();
   790     iSecurityDomainName = settingsHandler->GetSecurityDomainNameL();
   790     iSecurityDomainName = settingsHandler->GetSecurityDomainName();
   791     CleanupStack::PopAndDestroy(settingsHandler);
   791     CleanupStack::PopAndDestroy(settingsHandler);
   792     if (iSecurityDomainCategory != UNIDENTIFIED_THIRD_PARTY_DOMAIN_CATEGORY)
   792     if (iSecurityDomainCategory != UNIDENTIFIED_THIRD_PARTY_DOMAIN_CATEGORY)
   793     {
   793     {
   794         attribute = aEntry->AttributeL(KMIDletPermissions()); // no ownership
   794         attribute = aEntry->AttributeL(KMIDletPermissions()); // no ownership
   795         if (attribute)
   795         if (attribute)
   996 }
   996 }
   997 
   997 
   998 void CAppMngr2MidletAppInfo::GetAppIconL(TUid aMidletUid)
   998 void CAppMngr2MidletAppInfo::GetAppIconL(TUid aMidletUid)
   999 {
   999 {
  1000     LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::GetAppIconL");
  1000     LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::GetAppIconL");
  1001 
  1001     
  1002     ASSERT(!iAppBitmap);
  1002     ASSERT(!iAppBitmap);
  1003     ASSERT(!iAppMask);
  1003     ASSERT(!iAppMask);
  1004 
  1004     
  1005     RApaLsSession lsSession;
  1005     RApaLsSession lsSession;
  1006     User::LeaveIfError(lsSession.Connect());
  1006     User::LeaveIfError(lsSession.Connect()); 
  1007     CleanupClosePushL(lsSession);
  1007     CleanupClosePushL(lsSession);
  1008     CApaMaskedBitmap* apaBmp = CApaMaskedBitmap::NewLC();
  1008     CApaMaskedBitmap* apaBmp = CApaMaskedBitmap::NewLC();
  1009 
  1009     
  1010     TSize size = static_cast<CAppMngr2MidletRuntime&>(Runtime()).JavaRasterIconSize();
  1010     TSize size = static_cast<CAppMngr2MidletRuntime&>(Runtime()).JavaRasterIconSize();
  1011     TInt err = lsSession.GetAppIcon(aMidletUid, size, *apaBmp);
  1011     TInt err = lsSession.GetAppIcon(aMidletUid, size, *apaBmp);
  1012     if (err == KErrNone)
  1012     if (err == KErrNone)
  1013     {
  1013     {
  1014         iAppBitmap = new (ELeave) CFbsBitmap();
  1014         iAppBitmap = new (ELeave) CFbsBitmap(); 
  1015         iAppMask = new (ELeave) CFbsBitmap();
  1015         iAppMask = new (ELeave) CFbsBitmap();
  1016         User::LeaveIfError(iAppBitmap->Duplicate(apaBmp->Handle()));
  1016         User::LeaveIfError(iAppBitmap->Duplicate(apaBmp->Handle()));
  1017         User::LeaveIfError(iAppMask->Duplicate(apaBmp->Mask()->Handle()));
  1017         User::LeaveIfError(iAppMask->Duplicate(apaBmp->Mask()->Handle()));
  1018     }
  1018     }
  1019     CleanupStack::PopAndDestroy(apaBmp);
  1019     CleanupStack::PopAndDestroy(apaBmp);
  1023     {
  1023     {
  1024         AknsUtils::CreateAppIconLC(AknsUtils::SkinInstance(), aMidletUid,
  1024         AknsUtils::CreateAppIconLC(AknsUtils::SkinInstance(), aMidletUid,
  1025                                    EAknsAppIconTypeList, iAppBitmap, iAppMask);
  1025                                    EAknsAppIconTypeList, iAppBitmap, iAppMask);
  1026         CleanupStack::Pop(2); // iAppBitmap, iAppMask
  1026         CleanupStack::Pop(2); // iAppBitmap, iAppMask
  1027     }
  1027     }
  1028 
  1028     
  1029     LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::GetAppIconL");
  1029     LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::GetAppIconL");
  1030 }
  1030 }