|
1 /* |
|
2 * Copyright (c) 2006 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 CPEPcnParserProcedureHandler class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // ==================== INCLUDE FILES ==================== |
|
20 #include "cpepcnparserprocedurehandler.h" |
|
21 #include "mpephonemodelinternal.h" |
|
22 #include <mpedatastore.h> |
|
23 #include <SecUi.h> |
|
24 #include <SecUiManualSecuritySettings.h> |
|
25 #include <talogger.h> |
|
26 |
|
27 |
|
28 // ==================== LOCAL FUNCTIONS ==================== |
|
29 // None. |
|
30 |
|
31 // ================= MEMBER FUNCTIONS ======================= |
|
32 |
|
33 // C++ default constructor can NOT contain any code, that |
|
34 // might leave. |
|
35 // |
|
36 CPEPcnParserProcedureHandler::CPEPcnParserProcedureHandler |
|
37 ( |
|
38 CPEMessageHandler& aOwner, // The owner of this object. |
|
39 MPEPhoneModelInternal& aModel |
|
40 ) : iOwner( aOwner ), |
|
41 iModel( aModel ) |
|
42 { |
|
43 iSupplementaryServicesCommandInfo.action = EPESSActionUnspecified; |
|
44 iSupplementaryServicesCommandInfo.type = EPESSTypeUnspecified; |
|
45 iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified; |
|
46 TFLOGSTRING("PhoneEngine: PEPcnParserProcedureHandler::CPEPcnParserProcedureHandler complete"); |
|
47 } |
|
48 |
|
49 // Destructor |
|
50 CPEPcnParserProcedureHandler::~CPEPcnParserProcedureHandler |
|
51 ( |
|
52 // None. |
|
53 ) |
|
54 { |
|
55 if( iSecurityModel != NULL ) |
|
56 { |
|
57 iSecurityModel->CancelChangePin(); |
|
58 iSecurityModel->CancelUnblockPin(); |
|
59 delete iSecurityModel; |
|
60 TSecUi::UnInitializeLib(); |
|
61 } |
|
62 TFLOGSTRING("PhoneEngine: PEPcnParserProcedureHandler::~CPEPcnParserProcedureHandler complete"); |
|
63 } |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // CPEPcnParserProcedureHandler::NewL |
|
67 // Two-phased constructor. |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 CPEPcnParserProcedureHandler* CPEPcnParserProcedureHandler::NewL |
|
71 ( |
|
72 CPEMessageHandler& aOwner, // The owner of this object. |
|
73 MPEPhoneModelInternal& aModel |
|
74 ) |
|
75 { |
|
76 CPEPcnParserProcedureHandler* self = new ( ELeave ) CPEPcnParserProcedureHandler( |
|
77 aOwner, |
|
78 aModel ); |
|
79 |
|
80 CleanupStack::PushL( self ); |
|
81 self->ConstructL( ); |
|
82 CleanupStack::Pop( self ); |
|
83 |
|
84 TEFLOGSTRING( KTAOBJECT, "CPEPcnParserProcedureHandler::NewL" ); |
|
85 |
|
86 return self; |
|
87 } //NewL |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CPEPcnParserProcedureHandler::ConstructL |
|
91 // Symbian 2nd phase constructor can leave. |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 void CPEPcnParserProcedureHandler::ConstructL |
|
95 ( |
|
96 //None |
|
97 ) |
|
98 { |
|
99 TEFLOGSTRING( KTAOBJECT, "tape: CPEPcnParserProcedureHandler::ConstructL" ); |
|
100 } |
|
101 |
|
102 /* |
|
103 ----------------------------------------------------------------------------- |
|
104 |
|
105 Class: CPEPcnParserProcedureHandler |
|
106 |
|
107 Method: ProcessSimLock |
|
108 |
|
109 Description: Process SIM locking. |
|
110 |
|
111 Type: - |
|
112 |
|
113 Parameters: TDesC& aPassword, in coming value, accepted values are number strings, |
|
114 Password for change Sim lock status. |
|
115 TDesC& aType, in coming value, accepted values are 1-6, |
|
116 tell what Sim lock will be changed. |
|
117 |
|
118 Return Values: - |
|
119 |
|
120 Errors/Exceptions: - |
|
121 |
|
122 Status: Approved |
|
123 |
|
124 ----------------------------------------------------------------------------- |
|
125 */ |
|
126 void CPEPcnParserProcedureHandler::ProcessSimLockL( |
|
127 const TDesC& aPassword, |
|
128 const TDesC& aType ) |
|
129 { |
|
130 if( iSecurityModel == NULL ) |
|
131 { |
|
132 TSecUi::InitializeLibL(); |
|
133 iSecurityModel = CManualSecuritySettings::NewL(); |
|
134 TEFLOGSTRING( KTAOBJECT, |
|
135 "PE CPEPcnParserProcedureHandler::ProcessSimLockL > CManualSecuritySettings::NewL()" ); |
|
136 } |
|
137 iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest ); |
|
138 if( iSecurityModel->LockSimL( aPassword, aType ) ) |
|
139 { |
|
140 iSupplementaryServicesCommandInfo.action = EPESSActivation; |
|
141 iSupplementaryServicesCommandInfo.type = EPESimLock; |
|
142 iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified; |
|
143 iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo ); |
|
144 } |
|
145 iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest ); |
|
146 } |
|
147 |
|
148 /* |
|
149 ----------------------------------------------------------------------------- |
|
150 |
|
151 Class: CPEPcnParserProcedureHandler |
|
152 |
|
153 Method: ProcessSimUnlock |
|
154 |
|
155 Description: Process SIM locking. |
|
156 |
|
157 Type: - |
|
158 |
|
159 Parameters: TDesC& aPassword, in coming value, accepted values are number strings, |
|
160 Password for change Sim lock status. |
|
161 TDesC& aType, in coming value, accepted values are 1-6, |
|
162 tell what Sim lock will be changed. |
|
163 |
|
164 Return Values: - |
|
165 |
|
166 Errors/Exceptions: - |
|
167 |
|
168 Status: Approved |
|
169 |
|
170 ----------------------------------------------------------------------------- |
|
171 */ |
|
172 void CPEPcnParserProcedureHandler::ProcessSimUnlockL( |
|
173 const TDesC& aPassword, |
|
174 const TDesC& aType ) |
|
175 { |
|
176 if( iSecurityModel == NULL ) |
|
177 { |
|
178 TSecUi::InitializeLibL(); |
|
179 iSecurityModel = CManualSecuritySettings::NewL(); |
|
180 TEFLOGSTRING( KTAOBJECT, |
|
181 "PE CPEPcnParserProcedureHandler::ProcessSimUnlockL > CManualSecuritySettings::NewL()" ); |
|
182 } |
|
183 iModel.SendMessage( MEngineMonitor::EPEMessageIssuingSSRequest ); |
|
184 if( iSecurityModel->UnlockSimL( aPassword, aType ) ) |
|
185 { |
|
186 iSupplementaryServicesCommandInfo.action = EPESSDeactivation; |
|
187 iSupplementaryServicesCommandInfo.type = EPESimLock; |
|
188 iSupplementaryServicesCommandInfo.group = RMobilePhone::EServiceUnspecified; |
|
189 iModel.DataStore()->SetSSCommandInfo( iSupplementaryServicesCommandInfo ); |
|
190 } |
|
191 iModel.SendMessage( MEngineMonitor::EPEMessageIssuedSSRequest ); |
|
192 } |
|
193 |
|
194 // End of File |
|
195 |