1 /* |
1 /* |
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2004-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". |
29 #include <e32cmn.h> |
29 #include <e32cmn.h> |
30 #include <swi/msisuihandlers.h> |
30 #include <swi/msisuihandlers.h> |
31 #include <usif/scr/scr.h> |
31 #include <usif/scr/scr.h> |
32 #include <usif/scr/screntries.h> |
32 #include <usif/scr/screntries.h> |
33 #include <usif/sts/sts.h> |
33 #include <usif/sts/sts.h> |
34 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
35 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
34 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
36 #include "stsrecovery.h" |
35 #include "stsrecovery.h" |
37 #include "screntries_internal.h" |
36 #include "screntries_internal.h" |
38 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
37 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
39 #endif //SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
40 #include <swi/swiobserverclient.h> |
38 #include <swi/swiobserverclient.h> |
41 #include "sisregistryclientserver.h" |
39 #include "sisregistryclientserver.h" |
42 #include "sisregistryserver.h" |
40 #include "sisregistryserver.h" |
43 #include "sisregistrylog.h" |
41 #include "sisregistrylog.h" |
44 #include "sisregistrypackage.h" |
42 #include "sisregistrypackage.h" |
86 void PanicClient(const RMessagePtr2& aMessage, TSisRegistryPanic aPanic); |
84 void PanicClient(const RMessagePtr2& aMessage, TSisRegistryPanic aPanic); |
87 void GetAugmentationDetailsL(const TUid& aUid, RPointerArray<CSisRegistryPackage>& aPackagesArray, Usif::TComponentId aBaseComponentId); |
85 void GetAugmentationDetailsL(const TUid& aUid, RPointerArray<CSisRegistryPackage>& aPackagesArray, Usif::TComponentId aBaseComponentId); |
88 TInt GetAugmentationCountL(const TUid& aUid); |
86 TInt GetAugmentationCountL(const TUid& aUid); |
89 TBool IdentifyControllerL(Usif::TComponentId aComponentId, const TDesC& aFileName); // Used by CSisRegistrySubSession |
87 TBool IdentifyControllerL(Usif::TComponentId aComponentId, const TDesC& aFileName); // Used by CSisRegistrySubSession |
90 |
88 |
|
89 CSisRegistrySession(TSecureId aClientSid); |
|
90 |
91 private: |
91 private: |
92 ~CSisRegistrySession(); |
92 ~CSisRegistrySession(); |
93 |
93 |
94 // Returns ETrue if this is the first run of SWIRegistry server ever (or after firmware upgrade) |
94 // Returns ETrue if this is the first run of SWIRegistry server ever (or after firmware upgrade) |
95 TBool IsFirstInvocationL(); |
95 TBool IsFirstInvocationL(); |
116 void PackageExistsInRomL(const RMessage2& aMessage); |
116 void PackageExistsInRomL(const RMessage2& aMessage); |
117 void RequestStubFileEntriesL(const RMessage2& aMessage); |
117 void RequestStubFileEntriesL(const RMessage2& aMessage); |
118 void RequestRegistryEntryL(const RMessage2& aMessage); |
118 void RequestRegistryEntryL(const RMessage2& aMessage); |
119 void IsFileRegisteredL(const RMessage2& aMessage); |
119 void IsFileRegisteredL(const RMessage2& aMessage); |
120 void GetComponentIdForUidL(const RMessage2& aMessage); |
120 void GetComponentIdForUidL(const RMessage2& aMessage); |
121 |
121 void AddAppRegInfoL(const RMessage2& aMessage); |
|
122 void RemoveAppRegInfoL(const RMessage2& aMessage); |
|
123 void ValidateAndParseAppRegFileL(const TDesC& aRegFileName, Usif::CApplicationRegistrationData*& aAppRegData, TBool aInternal); |
|
124 void ReRegisterAppRegFileL(const TDesC& aRegFileDrivePath, const TUid& aAppUid); |
|
125 |
122 // Subsession handling |
126 // Subsession handling |
123 void OpenRegistryUidEntryL(const RMessage2& aMessage); |
127 void OpenRegistryUidEntryL(const RMessage2& aMessage); |
124 void OpenRegistryPackageEntryL(const RMessage2& aMessage); |
128 void OpenRegistryPackageEntryL(const RMessage2& aMessage); |
125 void OpenRegistryNamesEntryL(const RMessage2& aMessage); |
129 void OpenRegistryNamesEntryL(const RMessage2& aMessage); |
126 void CloseRegistryEntryL(const RMessage2& aMessage); |
130 void CloseRegistryEntryL(const RMessage2& aMessage); |
134 void CreateTransactionL(const RMessage2& aMessage); |
138 void CreateTransactionL(const RMessage2& aMessage); |
135 void CommitTransactionL(const RMessage2& aMessage); |
139 void CommitTransactionL(const RMessage2& aMessage); |
136 void RollbackTransactionL(const RMessage2& aMessage); |
140 void RollbackTransactionL(const RMessage2& aMessage); |
137 |
141 |
138 void RegisterEntryL(const RMessage2& aMessage, TBool aNewEntry, TBool aRegisterSoftwareTypes); |
142 void RegisterEntryL(const RMessage2& aMessage, TBool aNewEntry, TBool aRegisterSoftwareTypes); |
|
143 void AppRegInfoEntryL(const RMessage2& aMessage); |
|
144 |
|
145 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
146 void RegisterAllAppL(RBuf& aApparcRegFolder); |
|
147 void GetComponentIdForPackageL(const RMessage2& aMessage); |
|
148 void GetAppUidsForComponentL(const RMessage2& aMessage); |
|
149 void GetComponentIdsForUidL(const RMessage2& aMessage); |
|
150 #endif |
|
151 |
139 void DeleteEntryL(const RMessage2& aMessage); |
152 void DeleteEntryL(const RMessage2& aMessage); |
|
153 void DeleteEntryL(const CSisRegistryObject& aObject, TInt64 aTransactionId, TBool aCleanupRequired = ETrue); |
140 void AddSoftwareTypeL(const RMessage2& aMessage); |
154 void AddSoftwareTypeL(const RMessage2& aMessage); |
141 void AddDriveL(const RMessage2& aMessage); |
155 void AddDriveL(const RMessage2& aMessage); |
142 |
156 |
143 /// Updates the trust status of the base package identified by uid |
157 /// Updates the trust status of the base package identified by uid |
144 void UpdateTrustStatusL(const TUid& aUid, const TSisTrustStatus& aTrustStatus); |
158 void UpdateTrustStatusL(const TUid& aUid, const TSisTrustStatus& aTrustStatus); |
150 |
164 |
151 void LoggingFileInfoL(const RMessage2& aMessage); |
165 void LoggingFileInfoL(const RMessage2& aMessage); |
152 |
166 |
153 //sets a particular component's state to the requested value |
167 //sets a particular component's state to the requested value |
154 void SetComponentStateL(const RMessage2& aMessage); |
168 void SetComponentStateL(const RMessage2& aMessage); |
|
169 void SetComponentPresenceL(const RMessage2& aMessage); |
155 |
170 |
156 // Helper methods |
171 // Helper methods |
157 TBool IsRegisteredL(const TUid& aUid); |
172 TBool IsRegisteredL(const TUid& aUid); |
158 TBool IsRegisteredL(const CHashContainer& aHashContainer); |
173 TBool IsRegisteredL(const CHashContainer& aHashContainer); |
159 TBool IsRegisteredL(const TUid& aUid, const TDesC& aPackageName); |
174 TBool IsRegisteredL(const TUid& aUid, const TDesC& aPackageName); |
160 |
175 |
|
176 void RemoveEntryL(const Usif::TComponentId aCompId); |
161 void RemoveEntryL(const CSisRegistryPackage& aPackage); |
177 void RemoveEntryL(const CSisRegistryPackage& aPackage); |
162 void RemoveCleanupInfrastructureL(const CSisRegistryObject& aObject, Usif::RStsSession& aStsSession); |
178 void RemoveCleanupInfrastructureL(const CSisRegistryObject& aObject, Usif::RStsSession& aStsSession); |
163 TBool RemoveControllerL(const CSisRegistryObject& aObject, Usif::RStsSession& aStsSession, TInt aDrive); |
179 TBool RemoveControllerL(const CSisRegistryObject& aObject, Usif::RStsSession& aStsSession, TInt aDrive); |
164 void ControllerDriveListL(const CSisRegistryObject& aObject, RArray<TInt>& aDriveList); |
180 void ControllerDriveListL(const CSisRegistryObject& aObject, RArray<TInt>& aDriveList); |
165 TUint FixedDrivesL() const; |
181 TUint FixedDrivesL() const; |
166 Usif::TComponentId AddRegistryEntryL(CSisRegistryObject& aObject, Usif::RStsSession& aStsSession, const TDesC8& aController, Usif::TScrComponentOperationType aOpType); |
182 Usif::TComponentId AddRegistryEntryL(CSisRegistryObject& aObject, Usif::RStsSession& aStsSession, const TDesC8& aController, Usif::TScrComponentOperationType aOpType); |
167 Usif::TComponentId AddEntryL(CSisRegistryObject& aObject, Usif::TScrComponentOperationType aOpType); |
183 Usif::TComponentId AddEntryL(CSisRegistryObject& aObject, Usif::TScrComponentOperationType aOpType); |
|
184 void AddAppsFromStubL(Usif::TComponentId aCompId, const TDesC& aFileName); |
168 void AddControllerL(const CSisRegistryObject& aObject, Usif::RStsSession& aStsSession, const TDesC8& aBuffer, const TInt aDrive); |
185 void AddControllerL(const CSisRegistryObject& aObject, Usif::RStsSession& aStsSession, const TDesC8& aBuffer, const TInt aDrive); |
169 void AddCleanupInfrastructureL(CSisRegistryObject& aObject, Usif::RStsSession& aStsSession, const TDesC8& aControllerBuffer); |
186 void AddCleanupInfrastructureL(CSisRegistryObject& aObject, Usif::RStsSession& aStsSession, const TDesC8& aControllerBuffer); |
170 TUint CreateSubsessionHandleL(const TUid& aPackageUid); |
187 TUint CreateSubsessionHandleL(const TUid& aPackageUid); |
171 TUint CreateSubsessionHandleL(const CSisRegistryPackage& aPackage); |
188 TUint CreateSubsessionHandleL(const CSisRegistryPackage& aPackage); |
172 TUint CreateSubsessionHandleL(const TDesC& aPackageName, const TDesC& aVendorName); |
189 TUint CreateSubsessionHandleL(const TDesC& aPackageName, const TDesC& aVendorName); |
175 CSisRegistrySubSession& SubsessionL(TUint aSubsessionId); |
192 CSisRegistrySubSession& SubsessionL(TUint aSubsessionId); |
176 TUint OpenedPackageIndexL(TUint aSubsessionId); |
193 TUint OpenedPackageIndexL(TUint aSubsessionId); |
177 void ProcessRemovableDriveL(TInt aDrive); |
194 void ProcessRemovableDriveL(TInt aDrive); |
178 void DiscoverControllersL(const TDesC& aRegistryPath, const TDesC& aDirectoryName); |
195 void DiscoverControllersL(const TDesC& aRegistryPath, const TDesC& aDirectoryName); |
179 void ExecuteUninstallLogL(const TDesC& aUninstallLogFile, const TDesC& aControllerFile); |
196 void ExecuteUninstallLogL(const TDesC& aUninstallLogFile, const TDesC& aControllerFile); |
180 void GetCompIdAndCompSidIndexL(const TUid& aSid, Usif::TComponentId& aComponentId, TInt& aIndex, TInt aExpectedDrive = -1); |
197 void GetComponentIdsForSidL(TUid aSid, RArray<Usif::TComponentId>& aComponentIds); |
|
198 HBufC* SidToFileNameL(TUid aSid, Usif::TComponentId& aComponentId, TInt aExpectedDrive); |
181 TBool ModifiableL(const TDesC& aFileName); |
199 TBool ModifiableL(const TDesC& aFileName); |
182 CHashContainer* HashL(const TDesC& aFileName); |
200 CHashContainer* HashL(const TDesC& aFileName); |
183 void RemovablePackageListL(RPointerArray<CSisRegistryPackage>& aPackages); |
201 void RemovablePackageListL(RPointerArray<CSisRegistryPackage>& aPackages); |
184 void ProcessRomDriveL(); |
202 void ProcessRomDriveL(); |
185 void RegisterInRomControllerL(const TDesC& aFileName); |
203 void RegisterInRomControllerL(const TDesC& aFileName); |
186 void RegisterSoftwareTypesL(Usif::TComponentId aComponentId, const RMessage2& aMessage); |
204 void RegisterSoftwareTypesL(Usif::TComponentId aComponentId, const RMessage2& aMessage); |
187 void UnregisterSoftwareTypesL(Usif::TComponentId aComponentId); |
205 void UnregisterSoftwareTypesL(Usif::TComponentId aComponentId); |
188 |
206 |
189 |
207 void ProcessRomStubsL(); |
190 TBool IsFirmwareUpdatedL(); |
208 void ProcessApplicationsL(); |
191 |
209 TBool IsFirmwareUpdatedL(); |
192 void UpdateRecentFWVersionL(); |
210 void UpdateRecentFWVersionL(); |
193 |
211 void GetStubFileInfoL(TUid aUid, TStubExtractionMode aMode, TInt aStartingFileNo, TInt& aFileCount, RPointerArray<HBufC>& aFileNames); |
|
212 void GetStubFilesL(const TDesC& aFileName, RPointerArray<HBufC>& aFileNames); |
|
213 void DriveFormatDetectedL(TDriveUnit aDrive); |
|
214 |
194 private: |
215 private: |
195 friend class CSisRevocationManager; |
216 friend class CSisRevocationManager; |
196 |
217 |
197 // File system session which is used to make all requests to file server |
218 // File system session which is used to make all requests to file server |
198 RFs iFs; |
219 RFs iFs; |