|
1 /* |
|
2 * Copyright (c) 2004-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: MPM Server class definition |
|
15 * |
|
16 */ |
|
17 |
|
18 /** |
|
19 @file mpmserver.h |
|
20 Mobility Policy Manager server class definitions. |
|
21 */ |
|
22 |
|
23 #ifndef MPMSERVER_H |
|
24 #define MPMSERVER_H |
|
25 |
|
26 // INCLUDES |
|
27 #include <e32base.h> |
|
28 #include <rconnmon.h> |
|
29 #include <etel.h> // RTelServer |
|
30 #include <etelmm.h> // RMobilePhone |
|
31 #include <etelpckt.h> // RPacketService |
|
32 |
|
33 #include "mpmcommon.h" |
|
34 #include "rmpm.h" |
|
35 #include "mpmroamingwatcher.h" |
|
36 |
|
37 |
|
38 class CMPMCommsDatAccess; |
|
39 class CMpmCsIdWatcher; |
|
40 |
|
41 // CONSTANTS |
|
42 _LIT( KMPMPanicCategory, "Mobility Policy Manager Server" ); |
|
43 |
|
44 const TInt KPhoneRetryCount = 7; |
|
45 // 0.1 seconds |
|
46 // |
|
47 const TInt KPhoneRetryTimeout = 100000; |
|
48 |
|
49 // The granularity with which iDisconnectQueue will allocate memory chunks. |
|
50 // If set to two there will be space for two instances of CMPMDisconnectDlg |
|
51 // before new memory will be allocated. |
|
52 const TInt KGranularity = 2; |
|
53 |
|
54 // Security policy definitions |
|
55 |
|
56 //Total number of ranges |
|
57 const TUint KMPMPolicyRangeCount = 2; |
|
58 |
|
59 //Definition of the ranges of IPC numbers |
|
60 const TInt KMPMPolicyRanges[KMPMPolicyRangeCount] = |
|
61 { |
|
62 0, // 0 -> 19 ; EMPMServerChooseIap, |
|
63 // EMPMServerCancelRequest, |
|
64 // EMPMServerApplicationLeavesConnection, |
|
65 // EMPMServerIapConnectionStopped, |
|
66 // EMPMServerProcessError, |
|
67 // EMPMServerRegisterPrefIAPNotif, |
|
68 // EMPMServerUnregisterPrefIAPNotif, |
|
69 // EMPMServerWaitNotification, |
|
70 // EMPMServerSortSNAP, |
|
71 // EMPMServerApplicationJoinsConnection, |
|
72 // EMPMServerIapConnectionActivated, |
|
73 // EMPMServerIapConnectionStarted, |
|
74 // EMPMServerApplicationConnectionEnds, |
|
75 // EMPMServerApplicationMigratesToCarrier, |
|
76 // EMPMServerApplicationIgnoredTheCarrier, |
|
77 // EMPMServerApplicationAcceptedTheCarrier, |
|
78 // EMPMServerApplicationRejectedTheCarrier, |
|
79 // EMPMServerEasyWlanSsid, |
|
80 // EMPMServerReselectIap |
|
81 #ifndef _DEBUG |
|
82 19 // 19 up ; non implemented function end of range check ; ENotSupported |
|
83 #else |
|
84 600 // 20 up ; non implemented function end of range check ; ENotSupported |
|
85 #endif |
|
86 }; |
|
87 |
|
88 //Policy to implement for each of the above ranges |
|
89 const TUint8 KMPMPolicyElementsIndex[KMPMPolicyRangeCount] = |
|
90 { |
|
91 0, //applies to 0th range |
|
92 CPolicyServer::ENotSupported //applies to 1st range (out of range IPC) |
|
93 }; |
|
94 |
|
95 //Specific capability checks |
|
96 const CPolicyServer::TPolicyElement KMPMPolicyElements[] = |
|
97 { |
|
98 //policy "0"; fail call if NetworkControl not present |
|
99 {_INIT_SECURITY_POLICY_C1(ECapabilityNetworkControl), |
|
100 CPolicyServer::EFailClient |
|
101 } |
|
102 }; |
|
103 |
|
104 //Package all the above together into a policy |
|
105 const CPolicyServer::TPolicy KMPMPolicy = |
|
106 { |
|
107 0, //specifies policy "0" for connect attempts |
|
108 KMPMPolicyRangeCount, //number of ranges |
|
109 KMPMPolicyRanges, //ranges array |
|
110 KMPMPolicyElementsIndex, //elements<->ranges index |
|
111 KMPMPolicyElements, //array of elements |
|
112 }; |
|
113 |
|
114 // DATA TYPES |
|
115 // Connection state types |
|
116 enum TConnectionState |
|
117 { |
|
118 EIdle = 0, |
|
119 EStarting, |
|
120 EStarted, |
|
121 ERoaming |
|
122 }; |
|
123 |
|
124 // Which component initiated sending preferred IAP notifications |
|
125 enum TPrefIAPNotifCaller |
|
126 { |
|
127 EConnMon = 0, |
|
128 EBearerMan, |
|
129 EConfirmDlgRoaming, |
|
130 EConfirmDlgStarting |
|
131 }; |
|
132 |
|
133 // Blacklisting expires when connection is terminated (user/application) |
|
134 // or when connection error is no longer a problem (IapConnectionStarted). |
|
135 // |
|
136 enum TBlacklistCategory |
|
137 { |
|
138 EConnectionLifetime = 0, |
|
139 ETemporary |
|
140 }; |
|
141 |
|
142 // Types of callback to be used after wlan scan has been completed |
|
143 enum TWlanScanCallback |
|
144 { |
|
145 EWlanScanCallbackNone, |
|
146 EWlanScanCallbackChooseIap, |
|
147 EWlanScanCallbackProcessErr, |
|
148 EWlanScanCallbackCarrierRejected, |
|
149 EWlanScanCallbackSortSnap, |
|
150 EWlanScanCallbackGenerateEvent |
|
151 }; |
|
152 |
|
153 // Enums used with active connection selection |
|
154 enum TMPMBearerType |
|
155 { |
|
156 // Set to none when there are no active connections |
|
157 EMPMBearerTypeNone, |
|
158 // VPN bearer |
|
159 EMPMBearerTypeVpn, |
|
160 // WLAN bearer |
|
161 EMPMBearerTypeWlan, |
|
162 // Packet data bearer |
|
163 EMPMBearerTypePacketData, |
|
164 // Something else than previous ones |
|
165 EMPMBearerTypeOther |
|
166 }; |
|
167 |
|
168 // FUNCTION PROTOTYPES |
|
169 void PanicServer( TInt aPanic ); |
|
170 |
|
171 // FORWARD DECLARATIONS |
|
172 class CMPMConnMonEvents; |
|
173 class CMPMServerSession; |
|
174 class CMPMDtmWatcher; |
|
175 class CMPMDisconnectDlg; |
|
176 class CMPMConfirmDlgRoaming; |
|
177 class CMPMConfirmDlgStarting; |
|
178 class CMPMDefaultConnection; |
|
179 class CMPMWlanQueryDialog; |
|
180 class CMPMDialog; |
|
181 |
|
182 // CLASS DECLARATION |
|
183 /** |
|
184 * Class structure to associate Connection Id |
|
185 * and the list of blacklisted IAPs |
|
186 * |
|
187 * @since 3.1 |
|
188 */ |
|
189 class TMPMBlackListConnId |
|
190 { |
|
191 public: |
|
192 void Append( TUint32 aIap, TBlacklistCategory aCategory ); |
|
193 void Remove( TInt index ); |
|
194 void Close(); |
|
195 TInt Count() const; |
|
196 inline TUint32 Iap( TInt aIndex) const; |
|
197 inline TBlacklistCategory Category( TInt aIndex) const; |
|
198 |
|
199 public: |
|
200 TConnectionId iConnId; |
|
201 private: |
|
202 RArray<TUint32> iBlackListIap; |
|
203 RArray<TBlacklistCategory> iCategory; |
|
204 }; |
|
205 |
|
206 // CLASS DECLARATION |
|
207 /** |
|
208 * Class structure containing application information. |
|
209 * |
|
210 * @since 3.1 |
|
211 */ |
|
212 class TConnectionInfo |
|
213 { |
|
214 public: |
|
215 TConnectionInfo(); |
|
216 static TBool MatchId( const TConnectionInfo& aFirst, |
|
217 const TConnectionInfo& aSecond ); |
|
218 |
|
219 static TBool MatchIdSnap( const TConnectionInfo& aFirst, |
|
220 const TConnectionInfo& aSecond ); |
|
221 public: |
|
222 TConnectionId iConnId; |
|
223 TUint32 iSnap; |
|
224 TUint32 iIapId; |
|
225 TConnectionState iState; |
|
226 TUint32 iAppUid; |
|
227 }; |
|
228 |
|
229 // CLASS DECLARATION |
|
230 /** |
|
231 * Class structure to associate IAP with |
|
232 * the list of application information. |
|
233 * Used for book-keeping of active BM connections. |
|
234 * |
|
235 * @since 3.1 |
|
236 */ |
|
237 class TActiveBMConn |
|
238 { |
|
239 public: |
|
240 TActiveBMConn(); |
|
241 static TBool MatchIapId( const TActiveBMConn& aFirst, |
|
242 const TActiveBMConn& aSecond ); |
|
243 |
|
244 static TBool MatchConnInfo( const TActiveBMConn& aFirst, |
|
245 const TActiveBMConn& aSecond ); |
|
246 public: |
|
247 TConnectionInfo iConnInfo; |
|
248 }; |
|
249 |
|
250 // CLASS DECLARATION |
|
251 /** |
|
252 * MPM Server class definition. |
|
253 * |
|
254 * @lib MPMServer.exe |
|
255 * @since 3.0 |
|
256 */ |
|
257 class CMPMServer : public CPolicyServer |
|
258 { |
|
259 public: // Constructors and destructor |
|
260 |
|
261 /** |
|
262 * Two-phased constructor. |
|
263 */ |
|
264 static CMPMServer* NewL(); |
|
265 |
|
266 /** |
|
267 * Destructor. |
|
268 */ |
|
269 virtual ~CMPMServer(); |
|
270 |
|
271 public: // New functions |
|
272 |
|
273 /** |
|
274 * Panics the client thread in case of a wrong client request. |
|
275 * @since 3.0 |
|
276 * @param aPanic Panic code |
|
277 */ |
|
278 void PanicClient( const TInt aPanic ) const; |
|
279 |
|
280 /** |
|
281 * Adding info about active BM connection. |
|
282 * @since 3.1 |
|
283 * @param aConnId Connection Id |
|
284 * @param aSnap Snap Id of the connection |
|
285 * @param aIapId IAP Id of the connection |
|
286 * @param aState State of the connection |
|
287 * @param aSession Handle to session class |
|
288 */ |
|
289 void AppendBMConnection( const TConnectionId aConnId, |
|
290 const TUint32 aSnap, |
|
291 const TUint32 aIapId, |
|
292 TConnectionState aState, |
|
293 CMPMServerSession& aSession ); |
|
294 |
|
295 /** |
|
296 * Reset the Iap Id as zero and update connection state as EIdle. |
|
297 * @since 3.2 |
|
298 * @param aConnId Connection Id |
|
299 * @param aIapId IAP Id of the connection |
|
300 * @param aSession Handle to session class |
|
301 */ |
|
302 void ResetBMConnection( const TConnectionId aConnId, |
|
303 const TUint32 aIapId, |
|
304 CMPMServerSession& aSession ); |
|
305 |
|
306 /** |
|
307 * Removing info about an active BM connection. |
|
308 * @since 3.1 |
|
309 * @param aConnId Connection Id |
|
310 * @param aSession Handle to session class |
|
311 */ |
|
312 void RemoveBMConnection( const TConnectionId aConnId, |
|
313 CMPMServerSession& aSession ); |
|
314 |
|
315 /** |
|
316 * Getting Iap Id of an active BM connection. |
|
317 * @since 3.1 |
|
318 * @param aConnId Connection Id |
|
319 * @return Iap Id if connection found, else 0 |
|
320 */ |
|
321 TUint32 GetBMIap( const TConnectionId aConnId ); |
|
322 |
|
323 /** |
|
324 * Getting SNAP of an active BM connection. |
|
325 * @since 3.1 |
|
326 * @param aConnId Connection Id |
|
327 * @return SNAP if connection found, else 0 |
|
328 */ |
|
329 TUint32 GetBMSnap( const TConnectionId aConnId ); |
|
330 |
|
331 /** |
|
332 * Getting the connection state for the Connection Id. |
|
333 * @since 3.2 |
|
334 * @param aConnId Connection Id |
|
335 * @param aState State of the connection |
|
336 */ |
|
337 void GetConnectionState( const TConnectionId aConnId, |
|
338 TConnectionState& aState ); |
|
339 |
|
340 /** |
|
341 * Checks if the connection is started for the Iap Id. |
|
342 * @since 3.2 |
|
343 * @param aIapId IAP Id of the connection |
|
344 */ |
|
345 TBool CheckIfStarted( const TUint32 aIapId ); |
|
346 |
|
347 /** |
|
348 * Checks if a connection is started with wlan iap. |
|
349 * @since 3.2 |
|
350 * @param aCdbAccess |
|
351 */ |
|
352 TUint32 IsWlanConnectionStartedL( const CMPMCommsDatAccess* aCdbAccess ); |
|
353 |
|
354 /** |
|
355 * Appending the whole IAP info about an active BM connection. |
|
356 * @since 3.2 |
|
357 * @param aIapId IAP Id of the connection |
|
358 * @param aConnId Connection Id |
|
359 * @param aSession Handle to session class |
|
360 */ |
|
361 void AppendBMIAPConnectionL( const TUint32 aIapId, |
|
362 const TConnectionId aConnId, |
|
363 CMPMServerSession& aSession ); |
|
364 |
|
365 /** |
|
366 * Removing the whole IAP info about an active BM connection. |
|
367 * @since 3.1 |
|
368 * @param aIapId IAP Id of the connection |
|
369 * @param aConnId Connection Id |
|
370 * @param aSession Handle to session class |
|
371 */ |
|
372 void RemoveBMIAPConnection( const TUint32 aIapId, |
|
373 const TConnectionId aConnId, |
|
374 CMPMServerSession& aSession ); |
|
375 |
|
376 /** |
|
377 * Adding info about active BM preferred IAP notification registration. |
|
378 * @since 3.1 |
|
379 * @param aConnId Connection Id |
|
380 * @param aSnap Snap Id of the connection |
|
381 * @param aCurrentIapId IAP Id of the connection |
|
382 */ |
|
383 void AppendBMPrefIAP( const TConnectionId aConnId, |
|
384 const TUint32 aSnap, |
|
385 const TUint32 aCurrentIapId ); |
|
386 |
|
387 /** |
|
388 * Removing info about active BM preferred IAP notification |
|
389 * registration. |
|
390 * @since 3.1 |
|
391 * @param aConnId Connection Id |
|
392 */ |
|
393 void RemoveBMPrefIAP( const TConnectionId aConnId ); |
|
394 |
|
395 /** |
|
396 * Resets current IAP Id info of an active BM preferred IAP |
|
397 * notification registration. |
|
398 * @since 3.2 |
|
399 * @param aConnId Connection Id |
|
400 */ |
|
401 void ResetBMPrefIAP( const TConnectionId aConnId ); |
|
402 |
|
403 /** |
|
404 * Checks whether given connection has registered for |
|
405 * preferred IAP notifications. |
|
406 * @since 3.2 |
|
407 * @param aConnId Connection Id |
|
408 */ |
|
409 TBool RegisteredForBMPrefIAP( const TConnectionId aConnId ); |
|
410 |
|
411 /** |
|
412 * Sets last notified IAP for BMPrefIAPNotif related to a connection |
|
413 * |
|
414 * @since 3.2 |
|
415 * @param aConnId Connection Id |
|
416 * @param aIapId Last notified IAP id. |
|
417 * @return KErrNone if successfull. otherwise one of the system wide error |
|
418 * codes |
|
419 */ |
|
420 TInt SetConnectionBMPrefLastNotifedIap( TConnectionId aConnId, TUint32 aIapId ); |
|
421 |
|
422 /** |
|
423 * Adding session pointer. |
|
424 * @since 3.2 |
|
425 * @param aSession Pointer to session |
|
426 */ |
|
427 void AppendSessionL(const CMPMServerSession* aSession); |
|
428 |
|
429 /** |
|
430 * Removing session pointer. |
|
431 * @since 3.2 |
|
432 * @param aSession Pointer to session |
|
433 */ |
|
434 void RemoveSession( const CMPMServerSession* aSession ); |
|
435 |
|
436 /** |
|
437 * Notify each session about IAP availability change. |
|
438 * @since 3.1 |
|
439 * @param aIapInfo Info about available IAPs |
|
440 */ |
|
441 void NotifyBMPrefIapL( const TConnMonIapInfo& aIapInfo ); |
|
442 |
|
443 /** |
|
444 * Update Connection dialog of each session |
|
445 * @since 3.2 |
|
446 */ |
|
447 void UpdateSessionConnectionDlgL(); |
|
448 |
|
449 /** |
|
450 * Handling of blacklisting certain IAP and the presumed IAP for |
|
451 * the certain connection. |
|
452 * @since 3.1 |
|
453 * @param aConnId Connection Id |
|
454 * @param aIapId IAP Id of the connection. |
|
455 * @param aCategory Either connection lifetime or temporary. |
|
456 * @return KErrNone if successful, otherwise one of the |
|
457 * system-wide error codes |
|
458 */ |
|
459 TInt HandleServerBlackListIap( const TConnectionId aConnId, |
|
460 TUint32 aIapId, |
|
461 TBlacklistCategory aCategory ); |
|
462 |
|
463 /** |
|
464 * Handling of blacklisting certain IAP for the certain connection. |
|
465 * @since 3.1 |
|
466 * @param aConnId Connection Id |
|
467 * @param aIapId IAP Id of the connection. |
|
468 * @param aCategory Either connection lifetime or temporary. |
|
469 * @return KErrNone if successful, otherwise one of the |
|
470 * system-wide error codes |
|
471 */ |
|
472 TInt BlackListIap( const TConnectionId aConnId, |
|
473 TUint32 aIapId, |
|
474 TBlacklistCategory aCategory ); |
|
475 |
|
476 /** |
|
477 * Handling of unblacklisting certain IAP or all IAPs |
|
478 * for the certain connection. |
|
479 * @since 3.1 |
|
480 * @param aConnId Connection Id |
|
481 * @param aIapId IAP Id of the connection. |
|
482 * @return KErrNone if successful, otherwise one of the |
|
483 * system-wide error codes |
|
484 */ |
|
485 TInt HandleServerUnblackListIap( const TConnectionId aConnId, |
|
486 TUint32 aIapId ); |
|
487 |
|
488 /** |
|
489 * Handling of unblacklisting all IAPs for certain category. |
|
490 * @since 3.2 |
|
491 * @param aConnId Connection Id |
|
492 * @param aCategory Either connection lifetime or temporary. |
|
493 * @return KErrNone if successful, otherwise one of the |
|
494 * system-wide error codes |
|
495 */ |
|
496 TInt HandleServerUnblackListIap( const TConnectionId aConnId, |
|
497 TBlacklistCategory aCategory ); |
|
498 |
|
499 /** |
|
500 * Handling of unblacklisting all IAPs for certain category. |
|
501 * @since 3.2 |
|
502 * @param aCategory Either connection lifetime or temporary. |
|
503 */ |
|
504 void HandleServerUnblackListIap( TBlacklistCategory aCategory ); |
|
505 |
|
506 /** |
|
507 * Get blacklisted iap based on the Connection Id. |
|
508 * @since 3.1 |
|
509 * @param aConnId Connection Id |
|
510 * @param aBlacklistedIAP returns blacklisted iaps. |
|
511 * @return KErrNone if successful. |
|
512 */ |
|
513 TInt GetBlacklistedIAP( TConnectionId aConnId, |
|
514 RArray<TUint32> &aBlacklistedIAP ); |
|
515 |
|
516 /** |
|
517 * Get all blacklisted IAPs. |
|
518 * @since 3.2 |
|
519 * @param aBlacklistedIAP returns blacklisted iaps. |
|
520 * @return KErrNone if successful. |
|
521 */ |
|
522 TInt GetBlacklistedIAP( RArray<TUint32> &aBlacklistedIAP ); |
|
523 |
|
524 /** |
|
525 * Set the ConnMonEvents object. |
|
526 * @since 3.1 |
|
527 * @param aEvents Pointer to the ConnMonEvents object. |
|
528 */ |
|
529 inline void SetEvents( CMPMConnMonEvents* aEvents ); |
|
530 |
|
531 /** |
|
532 * Get the ConnMonEvents object. |
|
533 * @since 3.1 |
|
534 * @return Pointer to the ConnMonEvents object. |
|
535 */ |
|
536 inline CMPMConnMonEvents* Events(); |
|
537 |
|
538 /** |
|
539 * Find the correct Connection Id from the list of blacklisted |
|
540 * Connection Id's. |
|
541 * @since 3.1 |
|
542 * @param aConnId Connection Id |
|
543 * @param aIndex returns index of Connection Id in the list. |
|
544 * @return ETrue if successful. |
|
545 */ |
|
546 TBool FindBlacklistedConnIndex( const TConnectionId aConnId, TInt &aIndex ); |
|
547 |
|
548 /** |
|
549 * Checks if voice call is active or not. |
|
550 * @since 3.1 |
|
551 * @return ETrue if voice call is active, otherwise EFalse. |
|
552 */ |
|
553 TBool IsVoiceCallActiveL() const; |
|
554 |
|
555 /** |
|
556 * Checks if mode is GSM or not. |
|
557 * @since 3.1 |
|
558 * @return ETrue if mode is GSM, otherwise EFalse. |
|
559 */ |
|
560 TBool IsModeGSM() const; |
|
561 |
|
562 /** |
|
563 * Checks if phone supports Dual Transfer Mode or not. |
|
564 * @since 3.1 |
|
565 * @return ETrue if phone supports DTM, otherwise EFalse. |
|
566 */ |
|
567 TBool IsDTMSupported() const; |
|
568 |
|
569 /** |
|
570 * Dump array of active connections to log in order to support |
|
571 * testing. |
|
572 * @since 3.2 |
|
573 */ |
|
574 void DumpActiveBMConns(); |
|
575 |
|
576 /** |
|
577 * Sets WLAN scan required On/Off. |
|
578 * @since 3.2 |
|
579 * @param aValue True or false. |
|
580 */ |
|
581 inline void SetWLANScanRequired( const TBool aValue ); |
|
582 |
|
583 /** |
|
584 * Checks if there is a need to scan WLAN networks. |
|
585 * @since 3.2 |
|
586 * @return ETrue if yes, otherwise EFalse. |
|
587 */ |
|
588 inline TBool IsWLANScanRequired() const; |
|
589 |
|
590 /** |
|
591 * Get the DisconnectQueue. |
|
592 * @since 3.2 |
|
593 * @return Pointer to the DisconnectQueue. |
|
594 */ |
|
595 inline CArrayPtrFlat<CMPMDisconnectDlg>* DisconnectQueue(); |
|
596 |
|
597 /** |
|
598 * Get the RoamingQueue. |
|
599 * @since 3.2 |
|
600 * @return Pointer to the RoamingQueue. |
|
601 */ |
|
602 inline CArrayPtrFlat<CMPMConfirmDlgRoaming>* RoamingQueue(); |
|
603 |
|
604 /** |
|
605 * Get the StartingQueue. |
|
606 * @since 3.2 |
|
607 * @return Pointer to the StartingQueue. |
|
608 */ |
|
609 inline CArrayPtrFlat<CMPMConfirmDlgStarting>* StartingQueue(); |
|
610 |
|
611 /** |
|
612 * Appends aDlg to the iWlanQueryQueue. |
|
613 * @since 3.2 |
|
614 * @param aDlg Pointer to the CMPMConfirmDlgWlanQuery object. |
|
615 */ |
|
616 void AppendWlanQueryQueueL( CMPMWlanQueryDialog* aDlg ); |
|
617 |
|
618 /** |
|
619 * Removes the first item from the iWlanQueryQueue. |
|
620 * @since 3.2 |
|
621 */ |
|
622 inline void RemoveFromWlanQueryQueue( CMPMWlanQueryDialog* aDlg ); |
|
623 |
|
624 /** |
|
625 * Get the WlanQueryQueue. |
|
626 * @since 3.2 |
|
627 * @return Pointer to the WlanQueryQueue. |
|
628 */ |
|
629 inline CArrayPtrFlat<CMPMWlanQueryDialog>* WlanQueryQueue(); |
|
630 |
|
631 /** |
|
632 * Get the first item in iWlanQueryQueue. |
|
633 * @since 3.2 |
|
634 * @return Pointer to the first item in iWlanQueryQueue. |
|
635 */ |
|
636 inline CMPMWlanQueryDialog* FirstInWlanQueryQueue(); |
|
637 |
|
638 /** |
|
639 * Get the ConnectDialogQueue. |
|
640 * @since 3.2 |
|
641 * @return Pointer to the CMPMDialogQueue. |
|
642 */ |
|
643 inline CArrayPtrFlat<CMPMDialog>* ConnectDialogQueue(); |
|
644 |
|
645 /** |
|
646 * Get the Default Connection object. |
|
647 * @since 3.2 |
|
648 * @return Pointer to the Default Connection object. |
|
649 */ |
|
650 CMPMDefaultConnection* DefaultConnection(); |
|
651 |
|
652 /** |
|
653 * Returns true if there is a started connection |
|
654 * |
|
655 * @since 3.2 |
|
656 * @param aIapId Optional searched IapId. If it doesn't exist, |
|
657 * returns first found and started connection iapid |
|
658 * @return IapId, KErrNotFound if doesn't exist |
|
659 */ |
|
660 TInt StartedConnectionExists( TInt aIapId = KErrNotFound ); |
|
661 |
|
662 /** |
|
663 * Increments connection count. |
|
664 * @since 3.2 |
|
665 */ |
|
666 inline void IncrementConnections(); |
|
667 |
|
668 /** |
|
669 * Decrements connection count. |
|
670 * @since 3.2 |
|
671 */ |
|
672 inline void DecrementConnections(); |
|
673 |
|
674 /** |
|
675 * Returns connection count. |
|
676 * @since 3.2 |
|
677 * @return Connection count. |
|
678 */ |
|
679 inline TUint ConnectionCounter(); |
|
680 |
|
681 /** |
|
682 * Sets connection count. |
|
683 * @since 3.2 |
|
684 * @param aValue Connection count value. |
|
685 */ |
|
686 inline void SetConnectionCounter( const TUint aValue ); |
|
687 |
|
688 /** |
|
689 * Returns array of dedicated clients. |
|
690 * |
|
691 * @since 5.0 |
|
692 * @return Reference to array of dedicated clients. |
|
693 */ |
|
694 inline RArray<TUint32>& DedicatedClients(); |
|
695 |
|
696 /** |
|
697 * Returns the Commsdat access instance |
|
698 * |
|
699 * @since 3.2 |
|
700 */ |
|
701 inline CMPMCommsDatAccess* CommsDatAccess(); |
|
702 |
|
703 /** |
|
704 * Starts forced roaming sequence to wlan |
|
705 * |
|
706 * @param aIapInfo Info about available IAPs |
|
707 * @since 5.2 |
|
708 */ |
|
709 void StartForcedRoamingToWlanL( const TConnMonIapInfo& aIapInfo ); |
|
710 |
|
711 /** |
|
712 * Starts forced roaming sequence from WLAN if necessary |
|
713 * |
|
714 * @param aIapInfo Info about available IAPs |
|
715 * @since 5.2 |
|
716 */ |
|
717 void StartForcedRoamingFromWlanL( const TConnMonIapInfo& aIapInfo ); |
|
718 |
|
719 /** |
|
720 * Checks whether phone is in visitor network. |
|
721 * |
|
722 * @since 5.2 |
|
723 */ |
|
724 TBool IsVisitorNetwork() const; |
|
725 |
|
726 /** |
|
727 * Returns the RoamingWatcher pointer |
|
728 * |
|
729 * @since 5.2 |
|
730 */ |
|
731 inline CMPMRoamingWatcher* RoamingWatcher() const; |
|
732 |
|
733 |
|
734 |
|
735 public: // Functions from base classes |
|
736 |
|
737 /** |
|
738 * From CServer2. Creates a new session for a client. |
|
739 * @since 3.0 |
|
740 * @param aVersion Version information |
|
741 * @param aMessage Not really used here |
|
742 * @return Pointer to the new client session |
|
743 */ |
|
744 CSession2* NewSessionL( const TVersion& aVersion, |
|
745 const RMessage2& aMessage) const; |
|
746 |
|
747 // Stops connection of certain IAP, zero for all connections |
|
748 void StopConnections( TInt aIapId = 0 ); |
|
749 |
|
750 public: |
|
751 |
|
752 /** |
|
753 * Mark that there is an active user connection. |
|
754 * @since 5.1 |
|
755 */ |
|
756 inline void SetUserConnection(); |
|
757 |
|
758 /** |
|
759 * Mark that user connection is not active |
|
760 * @since 5.1 |
|
761 */ |
|
762 inline void ClearUserConnection(); |
|
763 |
|
764 /** |
|
765 * Check if user connection is active |
|
766 * @since 5.1 |
|
767 * @return ETrue if user connection is active. |
|
768 */ |
|
769 inline TBool UserConnection() const; |
|
770 |
|
771 /** |
|
772 * Set connection preferences used by user connection |
|
773 * @since 5.1 |
|
774 * @param aUserConnPref User connection prefernces. |
|
775 */ |
|
776 inline void SetUserConnPref( const TMpmConnPref& aUserConnPref ); |
|
777 |
|
778 /** |
|
779 * Returns connection preferences used by user connection |
|
780 * @since 5.1 |
|
781 * @return User connection preferences. |
|
782 */ |
|
783 inline const TMpmConnPref* UserConnPref() const; |
|
784 |
|
785 /** |
|
786 * Checks whether user connection is in internet snap. |
|
787 * @since 5.1 |
|
788 * @return ETrue if user connection is in internet snap |
|
789 */ |
|
790 TBool UserConnectionInInternet() const; |
|
791 |
|
792 /** |
|
793 * Handle to central repository watcher |
|
794 * @since 5.1 |
|
795 * @return Pointer to watcher object. |
|
796 */ |
|
797 inline CMpmCsIdWatcher* CsIdWatcher(); |
|
798 |
|
799 /** |
|
800 * Change state of the P&S keys according to active connection. |
|
801 * @since 5.0 |
|
802 * @param aSession Handle to session used by connection. |
|
803 */ |
|
804 void UpdateActiveConnectionL( CMPMServerSession& aSession ); |
|
805 |
|
806 /** |
|
807 * Map bearer type between MPM and commsdat. |
|
808 * @since 5.0 |
|
809 * @param aBearerType Bearer type used by MPM for active connection selection. |
|
810 * @return Bearer type used by commsdat |
|
811 */ |
|
812 TUint32 MapBearerType( TMPMBearerType aBearerType ); |
|
813 |
|
814 /** |
|
815 * Writes new active connection to the P&S keys |
|
816 * @since 5.0 |
|
817 */ |
|
818 void PublishActiveConnection(); |
|
819 |
|
820 /** |
|
821 * Returns number of active connections. |
|
822 * @since 5.0 |
|
823 * @return Number of active connections |
|
824 */ |
|
825 TInt NumberOfActiveConnections(); |
|
826 |
|
827 private: |
|
828 |
|
829 /** |
|
830 * C++ default constructor. |
|
831 */ |
|
832 CMPMServer(); |
|
833 |
|
834 /** |
|
835 * 2nd phase constructor. |
|
836 */ |
|
837 void ConstructL(); |
|
838 |
|
839 /** |
|
840 * Send error notification with KErrDisconnect error code. |
|
841 * @since 5.2 |
|
842 * @param aConnIndex Active connection index |
|
843 * @param aAvailWlanIapIds Array of available wlan iap ids |
|
844 * @param aIapList Array of all available iap ids |
|
845 * @param aCheckForBestIap Whether check if current iap is already |
|
846 * the best should be done |
|
847 * @param aDestinationBearerType Destination iap bearer type |
|
848 */ |
|
849 void NotifyDisconnectL( TInt aConnIndex, |
|
850 RArray<TUint32>& aAvailWlanIapIds, |
|
851 RAvailableIAPList& aIapList, |
|
852 TBool aCheckForBestIap, |
|
853 TMPMBearerType aDestinationBearerType ); |
|
854 |
|
855 /** |
|
856 * Returns server session instance that corresponds to given |
|
857 * connection id. |
|
858 * @since 5.2 |
|
859 * @param aConnId Id of the connection. The id must belong to an |
|
860 * existing server session. |
|
861 * @return Server session instance |
|
862 */ |
|
863 CMPMServerSession* GetServerSession( TConnectionId aConnId ) const; |
|
864 |
|
865 private: // Data |
|
866 // Pointer to the ConnMonEvents object |
|
867 CMPMConnMonEvents* iEvents; |
|
868 |
|
869 // Array of active connections requested by BM |
|
870 RArray<TActiveBMConn> iActiveBMConns; |
|
871 |
|
872 // Array of all sessions |
|
873 // |
|
874 RPointerArray<CMPMServerSession> iSessions; |
|
875 |
|
876 // Array of blacklisted IAPs |
|
877 // |
|
878 RArray<TMPMBlackListConnId> iBlackListIdList; |
|
879 |
|
880 // Handle to the telephony server |
|
881 RTelServer iTelServer; |
|
882 |
|
883 // RMobilePhone handle |
|
884 RMobilePhone iMobilePhone; |
|
885 |
|
886 // Handle to the packet service |
|
887 RPacketService iPacketService; |
|
888 |
|
889 // True if mmtsy is loaded |
|
890 TBool iTSYLoaded; |
|
891 |
|
892 // True if packet services are loaded |
|
893 TBool iPacketServLoaded; |
|
894 |
|
895 // Dual Transfer Mode watcher |
|
896 CMPMDtmWatcher* iDtmWatcher; |
|
897 |
|
898 //Cellular network roaming watcher |
|
899 CMPMRoamingWatcher* iRoamingWatcher; |
|
900 |
|
901 // Is WLAN scan required or not before displaying Connection Dialog |
|
902 TBool iWLANScanRequired; |
|
903 |
|
904 // Solves problem with overlapping Disconnect Dialogs |
|
905 CArrayPtrFlat<CMPMDisconnectDlg>* iDisconnectQueue; |
|
906 |
|
907 // Solves problem with overlapping Roaming Dialogs |
|
908 CArrayPtrFlat<CMPMConfirmDlgRoaming>* iRoamingQueue; |
|
909 |
|
910 // Solves problem with overlapping Starting Dialogs |
|
911 CArrayPtrFlat<CMPMConfirmDlgStarting>* iStartingQueue; |
|
912 |
|
913 // Solves problem with overlapping Wlan Queries |
|
914 CArrayPtrFlat<CMPMWlanQueryDialog>* iWlanQueryQueue; |
|
915 |
|
916 // Solves problem with overlapping Connection Dialogs |
|
917 CArrayPtrFlat<CMPMDialog>* iConnectDialogQueue; |
|
918 |
|
919 // Handles Default Connection selection |
|
920 CMPMDefaultConnection* iDefaultConnection; |
|
921 |
|
922 // Keeps track of the number of connections |
|
923 TUint iConnectionCounter; |
|
924 |
|
925 // Set when there is user connection exist |
|
926 TBool iUserConnection; |
|
927 |
|
928 // Preferences selected for the user connection |
|
929 TMpmConnPref iUserConnPref; |
|
930 |
|
931 // Set when user connection in internet snap |
|
932 TBool iUserConnectionInInternet; |
|
933 |
|
934 /** |
|
935 * Handle to central repository watcher |
|
936 * Own. |
|
937 */ |
|
938 CMpmCsIdWatcher* iMpmCsIdWatcher; |
|
939 |
|
940 // Iap id of the active connection |
|
941 TUint32 iActiveIapId; |
|
942 |
|
943 // Snap id of the active connection |
|
944 TUint32 iActiveSnapId; |
|
945 |
|
946 // Bearer type of the active connection |
|
947 TMPMBearerType iActiveBearerType; |
|
948 |
|
949 // Dedicated clients |
|
950 RArray<TUint32> iDedicatedClients; |
|
951 |
|
952 // Used for commsdat related functionalities |
|
953 CMPMCommsDatAccess* iCommsDatAccess; |
|
954 }; |
|
955 |
|
956 #include "mpmserver.inl" |
|
957 |
|
958 |
|
959 #endif // MPMSERVER_H |
|
960 |
|
961 // End of File |