installationservices/swi/source/swis/server/statemachine.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
    18 
    18 
    19 #include "statemachine.h"
    19 #include "statemachine.h"
    20 #include "log.h"
    20 #include "log.h"
    21 #include "plan.h"
    21 #include "plan.h"
    22 #include "swispubsubdefs.h"
    22 #include "swispubsubdefs.h"
    23 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK  
       
    24 #include <usif/scr/appregentries.h>
       
    25 #endif
       
    26 
    23 
    27 namespace Swi
    24 namespace Swi
    28 {
    25 {
    29 
    26 
    30 //
    27 //
    53 CSwisStateMachine::~CSwisStateMachine()
    50 CSwisStateMachine::~CSwisStateMachine()
    54 	{
    51 	{
    55 	Cancel();
    52 	Cancel();
    56 	// close UISS session
    53 	// close UISS session
    57 	iUiHandler.Close();
    54 	iUiHandler.Close();
       
    55 	delete iProgressPublisher;
    58 	
    56 	
    59 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
    57 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
    60 	iStsSession.Close();
    58 	iStsSession.Close();
    61 	delete iRegistryWrapper;
    59 	delete iRegistryWrapper;
    62 	delete iProgressPublisher;
       
    63 #else
    60 #else
    64 	delete iIntegrityServices;
    61 	delete iIntegrityServices;
    65 #endif
    62 #endif
    66 	
    63 	
    67 	// close SWI Observer session
    64 	// close SWI Observer session
    70 
    67 
    71 void CSwisStateMachine::ConstructL()
    68 void CSwisStateMachine::ConstructL()
    72 	{
    69 	{
    73 	// mark the installation/un-installation operation as unconfirmed to start with
    70 	// mark the installation/un-installation operation as unconfirmed to start with
    74 	iOperationConfirmed = EFalse;
    71 	iOperationConfirmed = EFalse;
    75 
    72 	iProgressPublisher = Swi::CProgressBarValuePublisher::NewL();
       
    73 	iUiHandler.SetProgressBarValuePublisher(iProgressPublisher);
       
    74 	
    76 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
    75 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
    77 	iStsSession.CreateTransactionL();	
    76 	iStsSession.CreateTransactionL();	
    78 	iRegistryWrapper = CRegistryWrapper::NewL();
    77 	iRegistryWrapper = CRegistryWrapper::NewL();
    79 	iProgressPublisher = CProgressBarValuePublisher::NewL();
       
    80 	iUiHandler.SetProgressBarValuePublisher(iProgressPublisher);
       
    81 #else
    78 #else
    82 	// Create integrity services, use the current time as transaction ID
    79 	// Create integrity services, use the current time as transaction ID
    83 	TTime currentTime;
    80 	TTime currentTime;
    84 	currentTime.UniversalTime();
    81 	currentTime.UniversalTime();
    85 	_LIT(KIntegrityServicesPath, "\\sys\\install\\integrityservices\\");
    82 	_LIT(KIntegrityServicesPath, "\\sys\\install\\integrityservices\\");
   348 	if (iOperationConfirmed)
   345 	if (iOperationConfirmed)
   349 		{			
   346 		{			
   350 		// re-generate the sisregistry cache .. very time consuming!
   347 		// re-generate the sisregistry cache .. very time consuming!
   351 		ResetRegistryCache();
   348 		ResetRegistryCache();
   352 		}
   349 		}
   353 #else
       
   354 	// Deregister the force registered applications from AppArc
       
   355 	DEBUG_PRINTF(_L8("Deregistering the force registered applications with AppArc"));
       
   356 	RSisLauncherSession launcher;
       
   357 	CleanupClosePushL(launcher);
       
   358 	User::LeaveIfError(launcher.Connect());
       
   359 	RArray<TAppUpdateInfo> emptyAppRegDataArray;
       
   360 	launcher.NotifyNewAppsL(emptyAppRegDataArray);
       
   361 	CleanupStack::PopAndDestroy(&launcher);
       
   362 #endif
   350 #endif
   363 
   351 
   364 	iMessage.Complete(aError);
   352 	iMessage.Complete(aError);
   365 	return KErrNone;
   353 	return KErrNone;
   366 	}
   354 	}
   433 	
   421 	
   434 void CSwisStateMachine::SetIsInInfoMode(TBool aOperationalMode)
   422 void CSwisStateMachine::SetIsInInfoMode(TBool aOperationalMode)
   435 	{
   423 	{
   436 	iIsInInfoMode = aOperationalMode;
   424 	iIsInInfoMode = aOperationalMode;
   437 	}
   425 	}
       
   426 #endif
   438 
   427 
   439 void CSwisStateMachine::SetFinalProgressBarValue(TInt aValue)
   428 void CSwisStateMachine::SetFinalProgressBarValue(TInt aValue)
   440 	{
   429 	{
   441 	iProgressPublisher->SetFinalProgressBarValue(aValue);
   430 	iProgressPublisher->SetFinalProgressBarValue(aValue);
   442 	}
   431 	}
   443 #endif
       
   444 } // namespace Swi
   432 } // namespace Swi