|
1 /* |
|
2 * Copyright (c) 2010 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: |
|
15 * Listens for changes in dial-up PDP context override P&S-key. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CONNMONDIALUPOVERRIDENOTIFIER_H |
|
20 #define CONNMONDIALUPOVERRIDENOTIFIER_H |
|
21 |
|
22 class CConnMonServer; |
|
23 |
|
24 /** |
|
25 * Stop requesting new notifications after this many consecutive errors. |
|
26 */ |
|
27 const TInt KConnMonPsEventErrorThreshold = 80; |
|
28 |
|
29 /** |
|
30 * Maximum time that dial-up PDP context override is allowed to stay on. |
|
31 */ |
|
32 const TUint KConnMonDialUpOverrideInterval = 45000000; // 45sec |
|
33 |
|
34 /** |
|
35 * Read policy for dial-up PDP context override key. |
|
36 */ |
|
37 _LIT_SECURITY_POLICY_PASS( KDialUpOverrideReadC0 ); |
|
38 |
|
39 /** |
|
40 * Write policy for dial-up PDP context override key. |
|
41 */ |
|
42 _LIT_SECURITY_POLICY_C2( KDialUpOverrideWriteC2, ECapabilityNetworkControl, ECapabilityNetworkServices ); |
|
43 |
|
44 /** |
|
45 * An active object to listen for changes in the dial-up PDP context override |
|
46 * P&S-key. Only used if the feature is enabled by the CenRep key |
|
47 * KDialUpOverride in CmManager repository (KCRUidCmManager). |
|
48 */ |
|
49 NONSHARABLE_CLASS( CConnMonDialUpOverrideNotifier ) : public CActive |
|
50 { |
|
51 public: |
|
52 static CConnMonDialUpOverrideNotifier* NewL( CConnMonServer* aServer ); |
|
53 static CConnMonDialUpOverrideNotifier* NewLC( CConnMonServer* aServer ); |
|
54 virtual ~CConnMonDialUpOverrideNotifier(); |
|
55 |
|
56 /** |
|
57 * Set the KDialUpConnection-property in Connection Monitor RProperty |
|
58 * category to the initial state of EConnMonReady. |
|
59 */ |
|
60 TInt ResetStatus(); |
|
61 |
|
62 private: |
|
63 CConnMonDialUpOverrideNotifier( CConnMonServer* aServer ); |
|
64 void ConstructL(); |
|
65 void RequestNotifications(); |
|
66 |
|
67 private: // Methods from base class |
|
68 void DoCancel(); |
|
69 void RunL(); |
|
70 |
|
71 private: |
|
72 // Pointer back to ConnMon server class. |
|
73 CConnMonServer* iServer; |
|
74 |
|
75 // Counter for notification errors. |
|
76 TInt iErrorCounter; |
|
77 |
|
78 // Dial-up PDP context override property. |
|
79 // Used to signal an incoming dial-up connection and the completion of |
|
80 // preparatory actions by ConnMon (Closing down internal PDP contexts). |
|
81 RProperty iDialUpProperty; |
|
82 }; |
|
83 |
|
84 #endif // CONNMONDIALUPOVERRIDENOTIFIER_H |
|
85 |
|
86 // End of file |