Revision: 201033 RCL_3 PDK_3.0.3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 14 Sep 2010 21:31:28 +0300
branchRCL_3
changeset 27 e8965914fac7
parent 26 8b7f4e561641
Revision: 201033 Kit: 201035
appinstaller/AppinstUi/Client/Src/SWInstLauncher.cpp
appinstaller/AppinstUi/Client/Src/SWInstSilentLauncher.cpp
iaupdate/IAD/api/client/src/iaupdateclient.cpp
iaupdate/IAD/engine/controller/src/iaupdateutils.cpp
installationservices/swi/source/sisregistry/server_legacy/sisregistryserversession.cpp
ncdengine/provider/deviceinteraction/src/ncdinstallationserviceimpl.cpp
--- a/appinstaller/AppinstUi/Client/Src/SWInstLauncher.cpp	Wed Sep 01 12:22:02 2010 +0100
+++ b/appinstaller/AppinstUi/Client/Src/SWInstLauncher.cpp	Tue Sep 14 21:31:28 2010 +0300
@@ -25,6 +25,7 @@
 #include "SWInstDefs.h"
 #include "SWInstCommon.h"
 
+
 using namespace SwiUI;
 
 // ================= MEMBER FUNCTIONS =======================
@@ -48,16 +49,17 @@
 //
 EXPORT_C TInt RSWInstLauncher::Connect()
     {
+   
     TInt result( KErrNone );
 
     if ( !iConnected )
         {
         if ( CEikonEnv::Static() )
-            {            
+            {               
             TRAP( result, ConnectChainedAppL( KUidSWInstSvr ) );
             }
         else
-            {
+            {             
             TRAP( result, REikAppServiceBase::ConnectNewAppL( KUidSWInstSvr ) );            
             }
         
@@ -78,12 +80,22 @@
 // -----------------------------------------------------------------------------
 //  
 EXPORT_C void RSWInstLauncher::Close()
-    {
+    {        
     if ( iConnected )
         {
-        RAknAppServiceBase::Close();
+        if ( CEikonEnv::Static() )
+            { 
+            // Note this will crash if non ui application like SWI Daemon.
+            RAknAppServiceBase::Close();
+            }
+        else
+            {            
+            // Use EikAppServiceBase if non UI application.
+            REikAppServiceBase::Close();
+            }
+        
         iConnected = EFalse;
-        }    
+        }        
     }
 
 // -----------------------------------------------------------------------------
--- a/appinstaller/AppinstUi/Client/Src/SWInstSilentLauncher.cpp	Wed Sep 01 12:22:02 2010 +0100
+++ b/appinstaller/AppinstUi/Client/Src/SWInstSilentLauncher.cpp	Tue Sep 14 21:31:28 2010 +0300
@@ -56,7 +56,7 @@
 // -----------------------------------------------------------------------------
 //
 EXPORT_C TInt RSWInstSilentLauncher::Connect()
-    {
+    {       
     TInt result( KErrNone );
 
     TUint differentiator = 0;
--- a/iaupdate/IAD/api/client/src/iaupdateclient.cpp	Wed Sep 01 12:22:02 2010 +0100
+++ b/iaupdate/IAD/api/client/src/iaupdateclient.cpp	Tue Sep 14 21:31:28 2010 +0300
@@ -143,7 +143,7 @@
     {
     IAUPDATE_TRACE("[IAUPDATE] RIAUpdateClient::Close() begin");
     // Let the parent handle closing.
-    RAknAppServiceBase::Close();
+    REikAppServiceBase::Close();
     iConnected = EFalse;
     delete iData;
     iData = NULL;
--- a/iaupdate/IAD/engine/controller/src/iaupdateutils.cpp	Wed Sep 01 12:22:02 2010 +0100
+++ b/iaupdate/IAD/engine/controller/src/iaupdateutils.cpp	Tue Sep 14 21:31:28 2010 +0300
@@ -302,7 +302,7 @@
 // -----------------------------------------------------------------------------
 
 EXPORT_C TBool IAUpdateUtils::IsWidgetInstalledL(const TDesC& aIdentifier, TIAUpdateVersion& aVersion )
-    {
+    { 
     RWidgetRegistryClientSession widgetRegistry;
 
     User::LeaveIfError( widgetRegistry.Connect() );
@@ -317,15 +317,29 @@
         {
         CWidgetInfo* widgetInfo( widgetInfoArr[i] );  
         
-        CWidgetPropertyValue* BundleId = widgetRegistry.GetWidgetPropertyValueL(widgetInfo->iUid, EBundleIdentifier );
+        CWidgetPropertyValue* BundleId = 
+                widgetRegistry.GetWidgetPropertyValueL(widgetInfo->iUid, EBundleIdentifier );
         CleanupStack::PushL( BundleId );
         
         if( aIdentifier.Compare( *(BundleId->iValue.s) )== 0 )
             {
-            CWidgetPropertyValue* version = widgetRegistry.GetWidgetPropertyValueL(widgetInfo->iUid, EBundleVersion );
+            // Get version
+            CWidgetPropertyValue* version = 
+                    widgetRegistry.GetWidgetPropertyValueL(widgetInfo->iUid, EBundleVersion );
             CleanupStack::PushL( version );
             
-            DesToVersionL(*(version->iValue.s), aVersion.iMajor, aVersion.iMinor, aVersion.iBuild );
+            // Convert version
+            if (version->iValue.s)
+                {
+                DesToVersionL(*(version->iValue.s), aVersion.iMajor, aVersion.iMinor, aVersion.iBuild );
+                }
+            else
+                {
+                // version does not exist, set default (0.0.1)
+                aVersion.iMajor = 0;
+                aVersion.iMinor = 0;
+                aVersion.iBuild = 1;
+                }
             
             CleanupStack::PopAndDestroy( version );
             CleanupStack::PopAndDestroy( BundleId );
--- a/installationservices/swi/source/sisregistry/server_legacy/sisregistryserversession.cpp	Wed Sep 01 12:22:02 2010 +0100
+++ b/installationservices/swi/source/sisregistry/server_legacy/sisregistryserversession.cpp	Tue Sep 14 21:31:28 2010 +0300
@@ -1758,7 +1758,11 @@
 	        {
 	        // First boot detected. Add the first boot marker file as well as the format marker on the drive.
             SisRegistryUtil::CreateFileWithAttributesL(iFs, firstBootMarkerFilePath);
-            SisRegistryUtil::CreateFileWithAttributesL(iFs, formatMarkerPath, fileAttributes);
+			TRAPD(err,SisRegistryUtil::CreateFileWithAttributesL(iFs, formatMarkerPath, fileAttributes);)
+			if (err != KErrNone && err != KErrAlreadyExists)
+				{
+				User::LeaveIfError(err);
+				}            
 	        }
 	    else
 	        {
--- a/ncdengine/provider/deviceinteraction/src/ncdinstallationserviceimpl.cpp	Wed Sep 01 12:22:02 2010 +0100
+++ b/ncdengine/provider/deviceinteraction/src/ncdinstallationserviceimpl.cpp	Tue Sep 14 21:31:28 2010 +0300
@@ -2359,7 +2359,20 @@
             CWidgetPropertyValue* version = 
                 iWidgetRegistry.GetWidgetPropertyValueL(aUid, EBundleVersion );
             CleanupStack::PushL( version );
-            TCatalogsVersion::ConvertL( aVersion, *(version->iValue.s) );
+            
+            // Convert version
+            if (version->iValue.s)
+                {
+                TCatalogsVersion::ConvertL( aVersion, *(version->iValue.s) );
+                }
+            else
+                {
+                // version does not exist, set default (0.0.1)
+                aVersion.iMajor = 0;
+                aVersion.iMinor = 0;
+                aVersion.iBuild = 1;
+                }
+
             CleanupStack::PopAndDestroy( version ); 
             return (ETrue);
             }
@@ -2403,11 +2416,24 @@
         
         if( aIdentifier.Compare( *(bundleId->iValue.s) )== 0 )
             {
+            // Get version
             CWidgetPropertyValue* version = 
                 iWidgetRegistry.GetWidgetPropertyValueL
                     (widgetInfo->iUid, EBundleVersion );
             CleanupStack::PushL( version );
-            TCatalogsVersion::ConvertL( aVersion, *(version->iValue.s) );
+            
+            // Convert version
+            if (version->iValue.s)
+                {
+                TCatalogsVersion::ConvertL( aVersion, *(version->iValue.s) );
+                }
+            else
+                {
+                // version does not exist, set default (0.0.1)
+                aVersion.iMajor = 0;
+                aVersion.iMinor = 0;
+                aVersion.iBuild = 1;
+                }
             
             CleanupStack::PopAndDestroy( version );
             CleanupStack::PopAndDestroy( bundleId );