35 #include "sisinfo.h" |
35 #include "sisinfo.h" |
36 #include "sisuid.h" |
36 #include "sisuid.h" |
37 #include "log.h" |
37 #include "log.h" |
38 #include "swispubsubdefs.h" |
38 #include "swispubsubdefs.h" |
39 #include "securitycheckutil.h" |
39 #include "securitycheckutil.h" |
|
40 #include "secutils.h" |
40 #include "cleanuputils.h" |
41 #include "cleanuputils.h" |
41 #include "sisversion.h" |
42 #include "sisversion.h" |
42 #include "sisregistrywritablesession.h" |
43 #include "sisregistrywritablesession.h" |
43 #include <f32file.h> |
44 #include <f32file.h> |
44 #include "sisregistrypackage.h" |
45 #include "sisregistrypackage.h" |
878 |
879 |
879 const RPointerArray<TPtrC8>& controllerBinaries = iRestoreController.ControllerBinaries(); |
880 const RPointerArray<TPtrC8>& controllerBinaries = iRestoreController.ControllerBinaries(); |
880 ASSERT(controllerBinaries.Count() == iPlans.Count()); |
881 ASSERT(controllerBinaries.Count() == iPlans.Count()); |
881 DEBUG_PRINTF3(_L8("Restoring plan %d out of %d"), iPlanIndex, iPlans.Count()); |
882 DEBUG_PRINTF3(_L8("Restoring plan %d out of %d"), iPlanIndex, iPlans.Count()); |
882 const TDesC8& controllerBinary = *controllerBinaries[iPlanIndex]; |
883 const TDesC8& controllerBinary = *controllerBinaries[iPlanIndex]; |
|
884 |
|
885 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
886 /*During restore the controllers are processed sequentialy one by one, ecah controller has one CPlan object (which internally has |
|
887 CApplication object), we maintain the set of affected apps for each controller within its CPlan object(done while doning processing) |
|
888 and we use the same set of affected apps for the subsequent controllers. For example In case of SP over SA ,while processing the SA controller we will not have |
|
889 any affected apps as it is the first controller but for the second SP controller we will tahke the affected apps from the previously |
|
890 processed controller ie SA. |
|
891 */ |
|
892 RArray<TAppUpdateInfo> appInfo; |
|
893 CleanupClosePushL(appInfo); |
|
894 if(iPlanIndex > 0) |
|
895 { |
|
896 iPlans[iPlanIndex-1]->GetAffectedApps(appInfo); |
|
897 } |
|
898 #endif |
|
899 |
883 iProcessor = CRestoreProcessor::NewL(*(iPlans[iPlanIndex]), controllerBinary, iSecurityManager, |
900 iProcessor = CRestoreProcessor::NewL(*(iPlans[iPlanIndex]), controllerBinary, iSecurityManager, |
884 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
901 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
885 iStsSession, iRegistrySession, |
902 iStsSession, iRegistrySession, appInfo, |
886 #else |
903 #else |
887 iIntegrityServices, |
904 iIntegrityServices, |
888 #endif |
905 #endif |
889 iRestoreController.Verifiers(), baseSids, iMachine.Observer()); |
906 iRestoreController.Verifiers(), baseSids, iMachine.Observer()); |
|
907 |
|
908 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
909 CleanupStack::Pop(&appInfo); |
|
910 #endif |
890 iProcessor->ProcessPlanL(iStatus); |
911 iProcessor->ProcessPlanL(iStatus); |
891 CleanupStack::PopAndDestroy(&baseSids); |
912 CleanupStack::PopAndDestroy(&baseSids); |
892 |
913 |
893 SetActive(); |
914 SetActive(); |
894 } |
915 } |
1075 // Due to the fact that SCR allows only one transaction at a time (one writer, many readers), |
1096 // Due to the fact that SCR allows only one transaction at a time (one writer, many readers), |
1076 // the possibility of the registry commit (SCR commit) failing is less likely than an STS commit |
1097 // the possibility of the registry commit (SCR commit) failing is less likely than an STS commit |
1077 // failure - therefore we commit STS first and then the registry |
1098 // failure - therefore we commit STS first and then the registry |
1078 iStsSession.CommitL(); |
1099 iStsSession.CommitL(); |
1079 iRegistrySession.CommitTransactionL(); |
1100 iRegistrySession.CommitTransactionL(); |
|
1101 |
|
1102 CPlan* lastPlan = iPlans[iPlans.Count()-1]; |
|
1103 if (lastPlan) |
|
1104 { |
|
1105 RSisLauncherSession launcher; |
|
1106 CleanupClosePushL(launcher); |
|
1107 if (launcher.Connect() != KErrNone) |
|
1108 { |
|
1109 iMachine.Observer().CommitL(); |
|
1110 User::LeaveIfError(RProperty::Set(pubsubCategory, KUidSoftwareInstallKey, ESwisNone)); |
|
1111 iClientMessage.Complete(iStatus.Int()); |
|
1112 DEBUG_PRINTF(_L8("Install Machine - Failed to connect to SisLauncher")); |
|
1113 CleanupStack::Pop(&launcher); |
|
1114 launcher.Close(); |
|
1115 return; |
|
1116 } |
|
1117 //Notify apparc for the the change in the Applications |
|
1118 RArray<TAppUpdateInfo> affectedApps; |
|
1119 CleanupClosePushL(affectedApps); |
|
1120 lastPlan->GetAffectedApps(affectedApps); |
|
1121 #ifdef _DEBUG |
|
1122 for(TInt i = 0; i < affectedApps.Count(); i++) |
|
1123 { |
|
1124 DEBUG_PRINTF2(_L("Affected AppUid during restore is 0x%x"), affectedApps[i].iAppUid); |
|
1125 DEBUG_PRINTF2(_L("Action to be performed is %d"), affectedApps[i].iAction); |
|
1126 } |
|
1127 #endif |
|
1128 if (affectedApps.Count() > 0) |
|
1129 { |
|
1130 launcher.NotifyNewAppsL(affectedApps); |
|
1131 } |
|
1132 CleanupStack::PopAndDestroy(2, &launcher); |
|
1133 } |
|
1134 |
|
1135 |
1080 #else |
1136 #else |
1081 iIntegrityServices.CommitL(); |
1137 iIntegrityServices.CommitL(); |
1082 #endif |
1138 #endif |
1083 iMachine.Observer().CommitL(); |
1139 iMachine.Observer().CommitL(); |
1084 } |
1140 } |