installationservices/swi/source/swis/server/processor.cpp
branchRCL_3
changeset 12 7ca52d38f8c3
parent 0 ba25891c3a9e
child 25 7333d7932ef7
equal deleted inserted replaced
11:3ba40be8e484 12:7ca52d38f8c3
     1 /*
     1 /*
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 1997-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 the License "Eclipse Public License v1.0"
     5 * under the terms of the License "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".
   782 #else
   782 #else
   783 			TRAP(err, IntegrityServices().RemoveL(fileToRemove));
   783 			TRAP(err, IntegrityServices().RemoveL(fileToRemove));
   784 #endif
   784 #endif
   785 			// Display error dialog and leave if the file cannot be removed,
   785 			// Display error dialog and leave if the file cannot be removed,
   786 			// ignoring missing files, media cards not present or corrupt media
   786 			// ignoring missing files, media cards not present or corrupt media
       
   787 
       
   788 			TInt noOfDetletionAttempts=1;
       
   789 			while ((err == KErrInUse ||err==KErrAccessDenied )&& noOfDetletionAttempts <= KMaxNoOfDeletionAttempts )
       
   790 			    {
       
   791 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
   792 			    TRAP(err, TransactionSession().RemoveL(fileToRemove));
       
   793 #else
       
   794 			    TRAP(err, IntegrityServices().RemoveL(fileToRemove));
       
   795 #endif
       
   796                 DEBUG_PRINTF2(_L8("Deletion attempt %d"), noOfDetletionAttempts);
       
   797                 noOfDetletionAttempts++;
       
   798                 User::After(KRetryInterval);
       
   799 			    }
       
   800 
   787 			if(err !=KErrNone && err != KErrNotFound && err != KErrPathNotFound	&& err != KErrNotReady && err != KErrCorrupt)
   801 			if(err !=KErrNone && err != KErrNotFound && err != KErrPathNotFound	&& err != KErrNotReady && err != KErrCorrupt)
   788 				{
   802 				{
   789 				CDisplayError* displayCannotDelete=CDisplayError::NewLC(iPlan.AppInfoL(), EUiCannotDelete, fileToRemove);
   803         		CDisplayError* displayCannotDelete=CDisplayError::NewLC(iPlan.AppInfoL(), EUiCannotDelete, fileToRemove);
   790 				iUiHandler.ExecuteL(*displayCannotDelete);
   804 				iUiHandler.ExecuteL(*displayCannotDelete);
   791 				CleanupStack::PopAndDestroy(displayCannotDelete);
   805 				CleanupStack::PopAndDestroy(displayCannotDelete);
   792 				User::Leave(err);
   806 				User::Leave(err);
   793 				}
   807 				}
   794 			//Create an SWI event					
   808 			//Create an SWI event					
   832 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
   846 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
   833 					TRAP(err, TransactionSession().RemoveL(privatePath));
   847 					TRAP(err, TransactionSession().RemoveL(privatePath));
   834 #else
   848 #else
   835 					TRAP(err, IntegrityServices().RemoveL(privatePath));
   849 					TRAP(err, IntegrityServices().RemoveL(privatePath));
   836 #endif
   850 #endif
       
   851 
       
   852 		            TInt noOfDetletionAttempts=1;
       
   853 		            while ((err == KErrInUse ||err==KErrAccessDenied )&& noOfDetletionAttempts <= KMaxNoOfDeletionAttempts )
       
   854 		                {
       
   855 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
   856 		                TRAP(err, TransactionSession().RemoveL(privatePath));
       
   857 #else
       
   858 		                TRAP(err, IntegrityServices().RemoveL(privatePath));
       
   859 #endif
       
   860 		                DEBUG_PRINTF2(_L8("Deletion attempt %d"), noOfDetletionAttempts);
       
   861 		                noOfDetletionAttempts++;
       
   862 		                User::After(KRetryInterval);
       
   863 		                }
       
   864 
   837 					if (err != KErrNone && err != KErrNotReady &&
   865 					if (err != KErrNone && err != KErrNotReady &&
   838 						err != KErrNotFound && err != KErrPathNotFound && err != KErrCorrupt)
   866 						err != KErrNotFound && err != KErrPathNotFound && err != KErrCorrupt)
   839 						{
   867 						{
   840 						User::Leave(err);
   868 						User::Leave(err);
   841 						}
   869 						}