javamanager/javaregistry/legacy/installedappsregistry/src/installedappsregistryentry.cpp
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 1997-2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation of CInstalledAppsRegistryEntry class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <javaregistryincludes.h>
       
    20 
       
    21 #include "installedappsregistryentry.h"
       
    22 #include "javacommonutils.h"
       
    23 #include "javaregistryapplicationentry.h"
       
    24 #include "javaregistrypackageentry.h"
       
    25 #include "javastoragenames.h"
       
    26 #include "javasymbianoslayer.h"
       
    27 #include "logger.h"
       
    28 
       
    29 using namespace java::storage;
       
    30 using namespace java::util;
       
    31 using namespace std;
       
    32 
       
    33 // ======== MEMBER FUNCTIONS ========
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 // CInstalledAppsRegistryEntry::NewLC
       
    37 // ---------------------------------------------------------------------------
       
    38 //
       
    39 EXPORT_C CInstalledAppsRegistryEntry* CInstalledAppsRegistryEntry::NewLC()
       
    40 {
       
    41     CInstalledAppsRegistryEntry* self =
       
    42         new(ELeave) CInstalledAppsRegistryEntry;
       
    43     CleanupReleasePushL(*self);
       
    44     self->ConstructL();
       
    45     return self;
       
    46 }
       
    47 
       
    48 // ---------------------------------------------------------------------------
       
    49 // CInstalledAppsRegistryEntry::NewLC
       
    50 // ---------------------------------------------------------------------------
       
    51 //
       
    52 EXPORT_C CInstalledAppsRegistryEntry* CInstalledAppsRegistryEntry::NewLC
       
    53 (const CInstalledAppsRegistryEntry& aOther)
       
    54 {
       
    55     CInstalledAppsRegistryEntry* self =
       
    56         new(ELeave) CInstalledAppsRegistryEntry(aOther);
       
    57     CleanupReleasePushL(*self);
       
    58     self->ConstructL(aOther);
       
    59     return self;
       
    60 }
       
    61 
       
    62 // ---------------------------------------------------------------------------
       
    63 // CInstalledAppsRegistryEntry::NewLC
       
    64 // ---------------------------------------------------------------------------
       
    65 //
       
    66 EXPORT_C CInstalledAppsRegistryEntry* CInstalledAppsRegistryEntry::NewLC
       
    67 (RReadStream& aStream)
       
    68 {
       
    69     CInstalledAppsRegistryEntry* self =
       
    70         new(ELeave) CInstalledAppsRegistryEntry;
       
    71     CleanupReleasePushL(*self);
       
    72     self->ConstructL(aStream);
       
    73     return self;
       
    74 }
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // CInstalledAppsRegistryEntry::NewL
       
    78 // ---------------------------------------------------------------------------
       
    79 //
       
    80 EXPORT_C CInstalledAppsRegistryEntry* CInstalledAppsRegistryEntry::NewL(
       
    81     Java::CJavaRegistryEntry* aRegistryEntry)
       
    82 {
       
    83     CInstalledAppsRegistryEntry* self =
       
    84         new(ELeave) CInstalledAppsRegistryEntry;
       
    85     self->ConstructL(aRegistryEntry);
       
    86     return self;
       
    87 }
       
    88 
       
    89 // ---------------------------------------------------------------------------
       
    90 //
       
    91 // ---------------------------------------------------------------------------
       
    92 //
       
    93 CInstalledAppsRegistryEntry::~CInstalledAppsRegistryEntry()
       
    94 {
       
    95     // Oops, someone called delete directly and not release if this fails
       
    96     ASSERT(!iRefCount);
       
    97 
       
    98     if (iRegistryEntry)
       
    99     {
       
   100         delete iRegistryEntry;
       
   101         iRegistryEntry = NULL;
       
   102     }
       
   103 }
       
   104 
       
   105 // ---------------------------------------------------------------------------
       
   106 // CInstalledAppsRegistryEntry::CInstalledAppsRegistryEntry
       
   107 // ---------------------------------------------------------------------------
       
   108 //
       
   109 CInstalledAppsRegistryEntry::CInstalledAppsRegistryEntry()
       
   110         : iIsInRom(EFalse)
       
   111 {
       
   112     AddRef();
       
   113 }
       
   114 
       
   115 // ---------------------------------------------------------------------------
       
   116 // CInstalledAppsRegistryEntry::CInstalledAppsRegistryEntry
       
   117 // ---------------------------------------------------------------------------
       
   118 //
       
   119 CInstalledAppsRegistryEntry::CInstalledAppsRegistryEntry
       
   120 (const CInstalledAppsRegistryEntry& /*aOther*/)
       
   121 {
       
   122     // WARNING - make sure all member variables have been copied - some
       
   123     // of them (eg RArrays, heap objects) will need to be copied in the
       
   124     // ConstructL part
       
   125     AddRef();
       
   126 }
       
   127 
       
   128 // ---------------------------------------------------------------------------
       
   129 // CInstalledAppsRegistryEntry::AddRef
       
   130 // ---------------------------------------------------------------------------
       
   131 //
       
   132 EXPORT_C void CInstalledAppsRegistryEntry::AddRef()
       
   133 {
       
   134     ++iRefCount;
       
   135 }
       
   136 
       
   137 // ---------------------------------------------------------------------------
       
   138 // CInstalledAppsRegistryEntry::Release
       
   139 // ---------------------------------------------------------------------------
       
   140 //
       
   141 void CInstalledAppsRegistryEntry::Release()
       
   142 {
       
   143     // if the ref count goes to zero, then we delete
       
   144     if (!--iRefCount)
       
   145     {
       
   146         delete this;
       
   147     }
       
   148 }
       
   149 
       
   150 // ---------------------------------------------------------------------------
       
   151 // CInstalledAppsRegistryEntry::ConstructL
       
   152 // ---------------------------------------------------------------------------
       
   153 //
       
   154 void CInstalledAppsRegistryEntry::ConstructL()
       
   155 {
       
   156 }
       
   157 
       
   158 // ---------------------------------------------------------------------------
       
   159 // CInstalledAppsRegistryEntry::ConstructL
       
   160 // ---------------------------------------------------------------------------
       
   161 //
       
   162 void CInstalledAppsRegistryEntry::ConstructL(
       
   163     Java::CJavaRegistryEntry* aRegistryEntry)
       
   164 {
       
   165     iRegistryEntry = aRegistryEntry;
       
   166 }
       
   167 
       
   168 // ---------------------------------------------------------------------------
       
   169 // CInstalledAppsRegistryEntry::ConstructL
       
   170 // ---------------------------------------------------------------------------
       
   171 //
       
   172 void CInstalledAppsRegistryEntry::ConstructL
       
   173 (const CInstalledAppsRegistryEntry& /*aOther*/)
       
   174 {
       
   175 }
       
   176 
       
   177 // ---------------------------------------------------------------------------
       
   178 // CInstalledAppsRegistryEntry::ConstructL
       
   179 // ---------------------------------------------------------------------------
       
   180 //
       
   181 void CInstalledAppsRegistryEntry::ConstructL(RReadStream& /*aStream*/,
       
   182         TBool /*aStoreFileList*/)
       
   183 {
       
   184     User::Leave(KErrNotSupported);
       
   185 }
       
   186 
       
   187 // ---------------------------------------------------------------------------
       
   188 // CInstalledAppsRegistryEntry::InstalledFilesL
       
   189 // ---------------------------------------------------------------------------
       
   190 //
       
   191 CInstalledAppsRegistryFiles&
       
   192 CInstalledAppsRegistryEntry::InstalledFilesL() const
       
   193 {
       
   194     User::Leave(KErrNotSupported);
       
   195     return *iInstalledFiles;
       
   196 }
       
   197 
       
   198 // ---------------------------------------------------------------------------
       
   199 // CInstalledAppsRegistryEntry::WriteL
       
   200 // ---------------------------------------------------------------------------
       
   201 //
       
   202 EXPORT_C void CInstalledAppsRegistryEntry::WriteL
       
   203 (RWriteStream& /*aStream*/) const
       
   204 {
       
   205     User::Leave(KErrNotSupported);
       
   206 }
       
   207 
       
   208 /////////////////////////////////////////////////////////////////////////////
       
   209 // Attribute Setters
       
   210 /////////////////////////////////////////////////////////////////////////////
       
   211 // ---------------------------------------------------------------------------
       
   212 // CInstalledAppsRegistryEntry::SetUid
       
   213 // ---------------------------------------------------------------------------
       
   214 //
       
   215 EXPORT_C void CInstalledAppsRegistryEntry::SetUid(const TUid& /*aUid*/)
       
   216 {
       
   217 }
       
   218 
       
   219 // ---------------------------------------------------------------------------
       
   220 // CInstalledAppsRegistryEntry::SetVersion
       
   221 // ---------------------------------------------------------------------------
       
   222 //
       
   223 EXPORT_C void CInstalledAppsRegistryEntry::SetVersion
       
   224 (const TAppVersion& /*aVersion*/)
       
   225 {
       
   226 }
       
   227 
       
   228 // ---------------------------------------------------------------------------
       
   229 // CInstalledAppsRegistryEntry::SetType
       
   230 // ---------------------------------------------------------------------------
       
   231 //
       
   232 EXPORT_C void CInstalledAppsRegistryEntry::SetType(TInstallType /*aType*/)
       
   233 {
       
   234 }
       
   235 
       
   236 // ---------------------------------------------------------------------------
       
   237 // CInstalledAppsRegistryEntry::SetDrive
       
   238 // ---------------------------------------------------------------------------
       
   239 //
       
   240 EXPORT_C void CInstalledAppsRegistryEntry::SetDrive(TChar /*aDrive*/)
       
   241 {
       
   242 }
       
   243 
       
   244 // ---------------------------------------------------------------------------
       
   245 // CInstalledAppsRegistryEntry::AddFileL
       
   246 // ---------------------------------------------------------------------------
       
   247 //
       
   248 EXPORT_C void CInstalledAppsRegistryEntry::AddFileL(const TDesC& /*aFileName*/)
       
   249 {
       
   250     User::Leave(KErrNotSupported);
       
   251 }
       
   252 
       
   253 // ---------------------------------------------------------------------------
       
   254 // CInstalledAppsRegistryEntry::AddDirectoryL
       
   255 // ---------------------------------------------------------------------------
       
   256 //
       
   257 EXPORT_C void CInstalledAppsRegistryEntry::AddDirectoryL
       
   258 (const TDesC& /*aDirName*/)
       
   259 {
       
   260     User::Leave(KErrNotSupported);
       
   261 }
       
   262 
       
   263 // ---------------------------------------------------------------------------
       
   264 // CInstalledAppsRegistryEntry::AddApparcIdentifierL
       
   265 // ---------------------------------------------------------------------------
       
   266 //
       
   267 EXPORT_C void CInstalledAppsRegistryEntry::AddApparcIdentifierL
       
   268 (const TDesC& /*aApparcIdentifier*/)
       
   269 {
       
   270     User::Leave(KErrNotSupported);
       
   271 }
       
   272 
       
   273 // ---------------------------------------------------------------------------
       
   274 // CInstalledAppsRegistryEntry::AddCertificateChainL
       
   275 // ---------------------------------------------------------------------------
       
   276 //
       
   277 EXPORT_C void CInstalledAppsRegistryEntry::AddCertificateChainL
       
   278 (const TDesC8& /*aCertChain*/)
       
   279 {
       
   280     User::Leave(KErrNotSupported);
       
   281 }
       
   282 
       
   283 // ---------------------------------------------------------------------------
       
   284 // CInstalledAppsRegistryEntry::AddPropertyL
       
   285 // ---------------------------------------------------------------------------
       
   286 //
       
   287 EXPORT_C void CInstalledAppsRegistryEntry::AddPropertyL(TUid /*aPropertyId*/,
       
   288         const TDesC8& /*aValue*/)
       
   289 {
       
   290     User::Leave(KErrNotSupported);
       
   291 }
       
   292 
       
   293 // ---------------------------------------------------------------------------
       
   294 // CInstalledAppsRegistryEntry::AddLanguageL
       
   295 // ---------------------------------------------------------------------------
       
   296 //
       
   297 EXPORT_C void CInstalledAppsRegistryEntry::AddLanguageL(TLanguage /*aLang*/,
       
   298         const TDesC& /*aPackage*/,
       
   299         const TDesC& /*aVendor*/)
       
   300 {
       
   301     User::Leave(KErrNotSupported);
       
   302 }
       
   303 
       
   304 // ---------------------------------------------------------------------------
       
   305 // CInstalledAppsRegistryEntry::AddDependencyL
       
   306 // ---------------------------------------------------------------------------
       
   307 //
       
   308 EXPORT_C void CInstalledAppsRegistryEntry::AddDependencyL(TUid /*aUid*/)
       
   309 {
       
   310     User::Leave(KErrNotSupported);
       
   311 }
       
   312 
       
   313 // ---------------------------------------------------------------------------
       
   314 // CInstalledAppsRegistryEntry::AddEmbeddedPackageL
       
   315 // ---------------------------------------------------------------------------
       
   316 //
       
   317 EXPORT_C void CInstalledAppsRegistryEntry::AddEmbeddedPackageL
       
   318 (TUid /*aUid*/)
       
   319 {
       
   320     User::Leave(KErrNotSupported);
       
   321 }
       
   322 
       
   323 /////////////////////////////////////////////////////////////////////////////
       
   324 // Attribute Getters
       
   325 /////////////////////////////////////////////////////////////////////////////
       
   326 // ---------------------------------------------------------------------------
       
   327 // CInstalledAppsRegistryEntry::UidL
       
   328 // ---------------------------------------------------------------------------
       
   329 //
       
   330 TUid CInstalledAppsRegistryEntry::UidL() const
       
   331 {
       
   332     JELOG2(EJavaStorage);
       
   333     return iRegistryEntry->Uid();
       
   334 }
       
   335 
       
   336 // ---------------------------------------------------------------------------
       
   337 // CInstalledAppsRegistryEntry::PackageNameL
       
   338 // ---------------------------------------------------------------------------
       
   339 //
       
   340 const TDesC& CInstalledAppsRegistryEntry::PackageNameL
       
   341 (TLanguage /*aLanguage*/) const
       
   342 {
       
   343     User::Leave(KErrNotSupported);
       
   344     return KNullDesC;
       
   345 }
       
   346 
       
   347 // ---------------------------------------------------------------------------
       
   348 // CInstalledAppsRegistryEntry::VendorNameL
       
   349 // ---------------------------------------------------------------------------
       
   350 //
       
   351 const TDesC& CInstalledAppsRegistryEntry::VendorNameL
       
   352 (TLanguage /*aLanguage*/) const
       
   353 {
       
   354     User::Leave(KErrNotSupported);
       
   355     return KNullDesC;
       
   356 }
       
   357 
       
   358 // ---------------------------------------------------------------------------
       
   359 // CInstalledAppsRegistryEntry::VersionL
       
   360 // ---------------------------------------------------------------------------
       
   361 //
       
   362 TAppVersion CInstalledAppsRegistryEntry::VersionL() const
       
   363 {
       
   364     JELOG2(EJavaStorage);
       
   365 
       
   366     TAppVersion appVersion(0, 0, 0);
       
   367 
       
   368     if (Java::EMidp2Midlet == iRegistryEntry->Type())
       
   369     {
       
   370         Java::CJavaRegistryPackageEntry* packageEntry =
       
   371             ((Java::CJavaRegistryApplicationEntry*)
       
   372              iRegistryEntry)->PackageEntryL();
       
   373 
       
   374         if (packageEntry)
       
   375         {
       
   376             appVersion = packageEntry->Version();
       
   377             delete packageEntry;
       
   378             packageEntry = NULL;
       
   379         }
       
   380     }
       
   381     else // Application suite
       
   382     {
       
   383         appVersion = ((Java::CJavaRegistryPackageEntry*)
       
   384                       iRegistryEntry)->Version();
       
   385     }
       
   386 
       
   387     return appVersion;
       
   388 }
       
   389 
       
   390 // ---------------------------------------------------------------------------
       
   391 // CInstalledAppsRegistryEntry::DriveL
       
   392 // ---------------------------------------------------------------------------
       
   393 //
       
   394 TChar CInstalledAppsRegistryEntry::DriveL() const
       
   395 {
       
   396     JELOG2(EJavaStorage);
       
   397     TChar driveChar;
       
   398     User::LeaveIfError(RFs::DriveToChar(iRegistryEntry->Drive(), driveChar));
       
   399     return driveChar;
       
   400 }
       
   401 
       
   402 // ---------------------------------------------------------------------------
       
   403 // CInstalledAppsRegistryEntry::TypeL
       
   404 // ---------------------------------------------------------------------------
       
   405 //
       
   406 TInstallType CInstalledAppsRegistryEntry::TypeL() const
       
   407 {
       
   408     return EMIDLETSuite;
       
   409 }
       
   410 
       
   411 // ---------------------------------------------------------------------------
       
   412 // CInstalledAppsRegistryEntry::LanguagesL
       
   413 // ---------------------------------------------------------------------------
       
   414 //
       
   415 void CInstalledAppsRegistryEntry::LanguagesL
       
   416 (RArray<TLanguage>& /*aLangArray*/) const
       
   417 {
       
   418     User::Leave(KErrNotSupported);
       
   419 }
       
   420 
       
   421 // ---------------------------------------------------------------------------
       
   422 // CInstalledAppsRegistryEntry::LanguageSupportedL
       
   423 // ---------------------------------------------------------------------------
       
   424 //
       
   425 TBool CInstalledAppsRegistryEntry::LanguageSupportedL
       
   426 (TLanguage /*aLanguage*/) const
       
   427 {
       
   428     User::Leave(KErrNotSupported);
       
   429     return EFalse;
       
   430 }
       
   431 
       
   432 // ---------------------------------------------------------------------------
       
   433 // CInstalledAppsRegistryEntry::ListFilesL
       
   434 // ---------------------------------------------------------------------------
       
   435 //
       
   436 void CInstalledAppsRegistryEntry::ListFilesL
       
   437 (RPointerArray<HBufC>& /*aFileArray*/) const
       
   438 {
       
   439     User::Leave(KErrNotSupported);
       
   440 }
       
   441 
       
   442 // ---------------------------------------------------------------------------
       
   443 // CInstalledAppsRegistryEntry::FindFileWithExtL
       
   444 // ---------------------------------------------------------------------------
       
   445 //
       
   446 void CInstalledAppsRegistryEntry::FindFileWithExtL
       
   447 (const TDesC& /*aExtension*/,
       
   448  TFileName& /*aFileName*/) const
       
   449 {
       
   450     User::Leave(KErrNotSupported);
       
   451 }
       
   452 
       
   453 // ---------------------------------------------------------------------------
       
   454 // CInstalledAppsRegistryEntry::UsesFileL
       
   455 // ---------------------------------------------------------------------------
       
   456 //
       
   457 TBool CInstalledAppsRegistryEntry::UsesFileL
       
   458 (const TDesC& /*aFileName*/) const
       
   459 {
       
   460     User::Leave(KErrNotSupported);
       
   461     return ETrue;
       
   462 }
       
   463 
       
   464 // ---------------------------------------------------------------------------
       
   465 // CInstalledAppsRegistryEntry::IsInRomL
       
   466 // ---------------------------------------------------------------------------
       
   467 //
       
   468 TBool CInstalledAppsRegistryEntry::IsInRomL() const
       
   469 {
       
   470     /* If JAR file is in ROM backup and restore cannot restore application
       
   471      * JAR file to ROM thus causing restore to fail. Although ROOT_PATH
       
   472      * point to RAM drive application is marked as ROM application.
       
   473      */
       
   474     TUid packageUid = TUid::Null();
       
   475 
       
   476     if (Java::EMidp2Midlet == iRegistryEntry->Type())
       
   477     {
       
   478         Java::CJavaRegistryPackageEntry* packageEntry =
       
   479             ((Java::CJavaRegistryApplicationEntry*)
       
   480              iRegistryEntry)->PackageEntryL();
       
   481 
       
   482         if (packageEntry)
       
   483         {
       
   484             packageUid = packageEntry->Uid();
       
   485             delete packageEntry;
       
   486             packageEntry = NULL;
       
   487         }
       
   488     }
       
   489     else
       
   490     {
       
   491         packageUid = iRegistryEntry->Uid();
       
   492     }
       
   493 
       
   494     java::util::Uid uid;
       
   495     JavaStorageApplicationEntry_t suiteEntry;
       
   496 
       
   497     try
       
   498     {
       
   499         auto_ptr<JavaStorage> js(JavaStorage::createInstance());
       
   500         js->open();
       
   501         js->read(APPLICATION_PACKAGE_TABLE, TUidToUid(packageUid, uid), suiteEntry);
       
   502         js->close();
       
   503         js.reset(0);
       
   504     }
       
   505     catch (JavaStorageException& jse)
       
   506     {
       
   507         ELOG1(EJavaStorage, "Read failed: %s ",
       
   508               jse.toString().c_str());
       
   509     }
       
   510 
       
   511     wstring value = L"";
       
   512 
       
   513     JavaStorageEntry attr;
       
   514     attr.setEntry(JAR_PATH, L"");
       
   515 
       
   516     JavaStorageApplicationEntry_t::iterator finder = suiteEntry.find(attr);
       
   517 
       
   518     if (finder != suiteEntry.end())
       
   519     {
       
   520         value = (*finder).entryValue();
       
   521     }
       
   522 
       
   523     if (value.size() == 0)
       
   524     {
       
   525         User::Leave(KErrGeneral);
       
   526     }
       
   527 
       
   528     suiteEntry.clear();
       
   529 
       
   530     wstring::size_type start = 0;
       
   531     wstring::size_type end = 1;
       
   532 
       
   533     char* driveLetter =  JavaCommonUtils::wstringToUtf8(
       
   534                              value.substr(start, end));
       
   535 
       
   536     TBool isInRom = EFalse;
       
   537 
       
   538     if (driveLetter[0] == 'z' || driveLetter[0] == 'Z')
       
   539     {
       
   540         isInRom = ETrue;
       
   541     }
       
   542     delete[] driveLetter;
       
   543 
       
   544     return isInRom;
       
   545 }
       
   546 
       
   547 // ---------------------------------------------------------------------------
       
   548 // CInstalledAppsRegistryEntry::ListDirectoriesL
       
   549 // ---------------------------------------------------------------------------
       
   550 //
       
   551 void CInstalledAppsRegistryEntry::ListDirectoriesL
       
   552 (RPointerArray<HBufC>& /*aDirArray*/) const
       
   553 {
       
   554     User::Leave(KErrNotSupported);
       
   555 }
       
   556 
       
   557 // ---------------------------------------------------------------------------
       
   558 // CInstalledAppsRegistryEntry::NumberOfCertificateChainsL
       
   559 // ---------------------------------------------------------------------------
       
   560 //
       
   561 TInt CInstalledAppsRegistryEntry::NumberOfCertificateChainsL() const
       
   562 {
       
   563     return iRegistryEntry->NumberOfCertificateChains();
       
   564 }
       
   565 
       
   566 // ---------------------------------------------------------------------------
       
   567 // CInstalledAppsRegistryEntry::CertificateChainL
       
   568 // ---------------------------------------------------------------------------
       
   569 //
       
   570 const TDesC8& CInstalledAppsRegistryEntry::CertificateChainL
       
   571 (TInt aChain) const
       
   572 {
       
   573     return iRegistryEntry->CertificateChain(aChain);
       
   574 }
       
   575 
       
   576 // ---------------------------------------------------------------------------
       
   577 // CInstalledAppsRegistryEntry::SizeL
       
   578 // ---------------------------------------------------------------------------
       
   579 //
       
   580 TInt CInstalledAppsRegistryEntry::SizeL() const
       
   581 {
       
   582     TUid packageUid = TUid::Null();
       
   583 
       
   584     if (Java::EMidp2Midlet == iRegistryEntry->Type())
       
   585     {
       
   586         Java::CJavaRegistryPackageEntry* packageEntry =
       
   587             ((Java::CJavaRegistryApplicationEntry*)
       
   588              iRegistryEntry)->PackageEntryL();
       
   589 
       
   590         if (packageEntry)
       
   591         {
       
   592             packageUid = packageEntry->Uid();
       
   593             delete packageEntry;
       
   594             packageEntry = NULL;
       
   595         }
       
   596     }
       
   597     else
       
   598     {
       
   599         packageUid = iRegistryEntry->Uid();
       
   600     }
       
   601 
       
   602     std::auto_ptr<Java::CJavaRegistry> registry(Java::CJavaRegistry::NewL());
       
   603 
       
   604     std::auto_ptr<Java::CJavaRegistryPackageEntry> entry(
       
   605         (Java::CJavaRegistryPackageEntry*) registry->RegistryEntryL(packageUid));
       
   606 
       
   607     TInt diskSpace = -1;
       
   608     if (entry.get())
       
   609     {
       
   610         diskSpace = entry->UsedUserDiskSpace();
       
   611     }
       
   612     return diskSpace;
       
   613 }
       
   614 
       
   615 // ---------------------------------------------------------------------------
       
   616 // CInstalledAppsRegistryEntry::GetPropertyL
       
   617 // ---------------------------------------------------------------------------
       
   618 //
       
   619 HBufC8* CInstalledAppsRegistryEntry::GetPropertyL(TUid /*aPropertyId*/) const
       
   620 {
       
   621     User::Leave(KErrNotSupported);
       
   622     return NULL;
       
   623 }
       
   624 
       
   625 // ---------------------------------------------------------------------------
       
   626 // CInstalledAppsRegistryEntry::ListApparcIdentifiersL
       
   627 // ---------------------------------------------------------------------------
       
   628 //
       
   629 void CInstalledAppsRegistryEntry::ListApparcIdentifiersL
       
   630 (RPointerArray<HBufC>& /*aApparcIdentifiersArray*/) const
       
   631 {
       
   632     User::Leave(KErrNotSupported);
       
   633 }
       
   634 
       
   635 // ---------------------------------------------------------------------------
       
   636 // CInstalledAppsRegistryEntry::FindLanguage
       
   637 // ---------------------------------------------------------------------------
       
   638 //
       
   639 const CEntryLangDetails* CInstalledAppsRegistryEntry::FindLanguage
       
   640 (TLanguage /*aLanguage*/) const
       
   641 {
       
   642     return NULL;
       
   643 }
       
   644 
       
   645 // ---------------------------------------------------------------------------
       
   646 // CInstalledAppsRegistryEntry::FindLanguage
       
   647 // ---------------------------------------------------------------------------
       
   648 //
       
   649 const CEntryLangDetails& CInstalledAppsRegistryEntry::FindLanguageL
       
   650 (TLanguage /*aLanguage*/) const
       
   651 {
       
   652     CEntryLangDetails* temp = NULL;
       
   653     User::Leave(KErrNotSupported);
       
   654     return *temp;
       
   655 }
       
   656 
       
   657 // ---------------------------------------------------------------------------
       
   658 // CInstalledAppsRegistryEntry::GetProperty
       
   659 // ---------------------------------------------------------------------------
       
   660 //
       
   661 CPropertyValuePair* CInstalledAppsRegistryEntry::GetProperty
       
   662 (TUid /*aPropertyId*/) const
       
   663 {
       
   664     return NULL;
       
   665 }
       
   666 
       
   667 // ---------------------------------------------------------------------------
       
   668 // CInstalledAppsRegistryEntry::SizeForStreamingL
       
   669 // ---------------------------------------------------------------------------
       
   670 //
       
   671 TInt CInstalledAppsRegistryEntry::SizeForStreamingL() const
       
   672 {
       
   673     // This is not part of MInstalledAppsRegistryEntry.
       
   674     User::Leave(KErrNotSupported);
       
   675     return 0;
       
   676 }