|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of fotaserver component |
|
15 * This is part of fotaapplication. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef __FMS_AOB_H__ |
|
20 #define __FMS_AOB_H__ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32std.h> |
|
24 #include <e32property.h> |
|
25 #include <rconnmon.h> |
|
26 #include <etel.h> |
|
27 #include <fotaengine.h> |
|
28 #include "fmsserver.h" |
|
29 #include "fmsdebug.h" |
|
30 |
|
31 class CFMSServer; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 class CFMSInterruptAob : public CActive,private MConnectionMonitorObserver |
|
35 { |
|
36 friend class CFMSServer; |
|
37 |
|
38 public: |
|
39 /** |
|
40 * Default constructor |
|
41 */ |
|
42 CFMSInterruptAob(); |
|
43 |
|
44 /** |
|
45 * second phase constructor |
|
46 */ |
|
47 void ConstructL(); |
|
48 |
|
49 /** |
|
50 * Logs the new request/interrupt to be monitored |
|
51 * @param aType, interrupt reason |
|
52 * @return None |
|
53 */ |
|
54 void StartL(TOmaDLInterruptReason aType); |
|
55 |
|
56 /** |
|
57 * Starts Active object to monitor for the update interrupt in case of USB charger support |
|
58 * @param aType, Interrupt reason |
|
59 * @return None |
|
60 */ |
|
61 void StartBatteryMonitoringL(TOmaUpdInterruptReason aType, TUint aLevel); |
|
62 |
|
63 /** |
|
64 * Sets the memory size member variable to be monitored |
|
65 * for the current interrupt |
|
66 * @param aSize, Memory space required |
|
67 * @param aDrive, Drive used for download |
|
68 * @return None |
|
69 */ |
|
70 void MemoryToMonitorL(TInt aSize, TDriveNumber aDrive); |
|
71 |
|
72 /** |
|
73 * Sets the network type for the current interrupt |
|
74 * @param aBearer |
|
75 * @return None |
|
76 */ |
|
77 void NetworkTypeL(TInt aBearer); |
|
78 /** |
|
79 * Launches FOTA install notifier |
|
80 * @param None |
|
81 * @return None |
|
82 */ |
|
83 void LaunchFotaScheduleUpdate(); |
|
84 |
|
85 /* |
|
86 * Destructor |
|
87 */ |
|
88 virtual ~CFMSInterruptAob(); |
|
89 |
|
90 /** |
|
91 * Starts monitor for active call end |
|
92 * @param aType, Reason to be monitored |
|
93 * @return None |
|
94 */ |
|
95 void StartCallEndMonitoringL(TOmaUpdInterruptReason aType); |
|
96 |
|
97 private: |
|
98 |
|
99 /** |
|
100 * From CActive |
|
101 * Called by Active scheduler when the asynchronous |
|
102 * request completed |
|
103 * @param None |
|
104 * @return None |
|
105 */ |
|
106 void RunL(); |
|
107 |
|
108 /** |
|
109 * From CActive |
|
110 * Called when a pending request has to be cancelled |
|
111 * @param None |
|
112 * @return None |
|
113 */ |
|
114 void DoCancel(); |
|
115 |
|
116 /** |
|
117 * From CActive |
|
118 * Handle a leave occurred in the RunL(). |
|
119 * Note: If RunError function pointer is not given in construction, |
|
120 * the leave error is to be propagated back to the active scheduler! |
|
121 * |
|
122 * @since S60 v3.2 |
|
123 * @param aError the error code of leave |
|
124 */ |
|
125 TInt RunError( TInt aError ); |
|
126 |
|
127 /** |
|
128 * Checks the package size is more than warning level of memory |
|
129 * @param aCritical to set EFalse/ETrue |
|
130 * @return TInt |
|
131 */ |
|
132 TInt IsPkgSizeMoreThanWL(TBool& aCritical); |
|
133 |
|
134 /** |
|
135 * Starts network notification registry |
|
136 * @param None |
|
137 * @return None |
|
138 */ |
|
139 TBool CheckNetworkL(); |
|
140 |
|
141 /** |
|
142 * Starts network notification registry |
|
143 * @param None |
|
144 * @return None |
|
145 */ |
|
146 void LaunchFotaEngineL(); |
|
147 |
|
148 /** |
|
149 * Starts network notification registry |
|
150 * @param None |
|
151 * @return None |
|
152 */ |
|
153 TBool CheckGlobalRFStateL(); |
|
154 |
|
155 /** |
|
156 * Stops the FMS Server |
|
157 * @param None |
|
158 * @return None |
|
159 */ |
|
160 void StopServer(); |
|
161 |
|
162 /** |
|
163 * Checks the memory size to be monitored |
|
164 * after adding the warning level |
|
165 * @param None |
|
166 * @return None |
|
167 */ |
|
168 void CheckMemSizeL(); |
|
169 |
|
170 public: |
|
171 |
|
172 /** |
|
173 * Starts network notification registry |
|
174 * @param None |
|
175 * @return None |
|
176 */ |
|
177 void NotifyL() ; |
|
178 |
|
179 /** |
|
180 * Stops network notifications. |
|
181 * @param None |
|
182 * @return None |
|
183 */ |
|
184 void StopNotify() ; |
|
185 |
|
186 /** |
|
187 * sets n/w to 3G. |
|
188 * @param None |
|
189 * @return None |
|
190 */ |
|
191 void SetWcdma() ; |
|
192 |
|
193 /** |
|
194 * Starts n/w registry check in Hard reeboot case |
|
195 * uses CPeriodic variable to call static method |
|
196 * @param None |
|
197 * @return None |
|
198 */ |
|
199 void StartNetworkRegistryCheckL(); |
|
200 |
|
201 /** |
|
202 * checks n/w registry in Hard reeboot case |
|
203 * and destroys the CPeriodic if connection is there |
|
204 * and triggers fota engine |
|
205 * @param None |
|
206 * @return None |
|
207 */ |
|
208 void NetworkRegistryCheckL(); |
|
209 |
|
210 /** |
|
211 * Launches Fota update note |
|
212 * @param aPkgId, package Id of FOTA Update |
|
213 * @param aProfilleId, Profile ID of FOTA |
|
214 * @return None |
|
215 */ |
|
216 void LaunchFotaUpdate(TInt& aPkgId, TInt& aProfilleId); |
|
217 |
|
218 private : |
|
219 |
|
220 /** |
|
221 * From MConnectionMonitorObserver |
|
222 * Method involed by connection monitor with current event. |
|
223 * This method handles the events |
|
224 * @param aConnMonEvent says about the event |
|
225 * @return None |
|
226 */ |
|
227 void EventL( const CConnMonEventBase& aConnMonEvent ) ; |
|
228 |
|
229 /** |
|
230 *CheckNetworkstatus and takes action based on that |
|
231 * @param none |
|
232 * @return None |
|
233 */ |
|
234 void CheckNetworkStatusL(); |
|
235 /** |
|
236 * HandleAboveCriticallevel handle memory interrupt when it is above critical level |
|
237 * @param None |
|
238 * @return None |
|
239 */ |
|
240 void HandleAboveCriticallevelL(); |
|
241 |
|
242 /** |
|
243 * HandleChargingInterruptL handle charging interrupt when it is above critical level |
|
244 * @param None |
|
245 * @return None |
|
246 */ |
|
247 |
|
248 void HandleChargingInterruptL(); |
|
249 |
|
250 private: |
|
251 |
|
252 RConnectionMonitor iConnMon; |
|
253 RFs iFs; |
|
254 RProperty iProperty; |
|
255 TInt iConnStatus; |
|
256 TInt iSize; |
|
257 TDriveNumber iDrive; |
|
258 TInt iBearer; |
|
259 TBool iWlanAvailable; |
|
260 TBool iGPRSAvail; |
|
261 TOmaDLInterruptReason iInterruptType; |
|
262 TOmaUpdInterruptReason iUpdInterruptType; |
|
263 CFMSServer* iServer; |
|
264 RFotaEngineSession iFotaEngine; |
|
265 CPeriodic* iPeriodicNwCheck; |
|
266 TBool iWcdma; |
|
267 |
|
268 /** |
|
269 * RTelServer object used to keep an asynchronous request |
|
270 * for phone call end monitoring |
|
271 */ |
|
272 RTelServer iTelServer; |
|
273 |
|
274 /** |
|
275 * RPhone object used to keep an asynchronous request |
|
276 * for phone call end monitoring |
|
277 */ |
|
278 RPhone iPhone; |
|
279 |
|
280 /** |
|
281 * RLine object used to keep an asynchronous request |
|
282 * for phone call end monitoring |
|
283 */ |
|
284 RLine iLine; |
|
285 |
|
286 /** |
|
287 * To get hodl of current call status |
|
288 */ |
|
289 RCall::TStatus iCallStatus; |
|
290 |
|
291 TInt iChargeToMonitor; |
|
292 |
|
293 }; |
|
294 |
|
295 |
|
296 #endif |