1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
19 * This file contains additional function definitions for the CMmSecurityTsy class |
19 * This file contains additional function definitions for the CMmSecurityTsy class |
20 * in CTSY for use when the CTSY is used with the CTSY Dispatcher. |
20 * in CTSY for use when the CTSY is used with the CTSY Dispatcher. |
21 */ |
21 */ |
22 |
22 |
23 //INCLUDES |
23 //INCLUDES |
24 |
|
25 #include "OstTraceDefinitions.h" |
|
26 #ifdef OST_TRACE_COMPILER_IN_USE |
|
27 #include "cmmsecuritytsywithdispatcherTraces.h" |
|
28 #endif |
|
29 |
|
30 #include "cmmsecuritytsy.h" |
24 #include "cmmsecuritytsy.h" |
31 #include "cmmphonetsy.h" |
25 #include "cmmphonetsy.h" |
32 #include "cmmtsyreqhandlestore.h" |
26 #include "cmmtsyreqhandlestore.h" |
33 #include "cmmphoneextinterface.h" |
27 #include "cmmphoneextinterface.h" |
34 #include "CMmCustomSecurityTsy.h" |
28 #include "CMmCustomSecurityTsy.h" |
73 //check that the code is available |
67 //check that the code is available |
74 if ( 0 != codes->iCode.Length() ) |
68 if ( 0 != codes->iCode.Length() ) |
75 { |
69 { |
76 if ( RMobilePhone::ESecurityCodePin1 == *type ) |
70 if ( RMobilePhone::ESecurityCodePin1 == *type ) |
77 { |
71 { |
78 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSECURITYTSY_VERIFYSECURITYCODEL1_1, "TSY: CMmSecurityTsy::VerifySecurityCodeL - PIN VERIFY REQUESTED"); |
72 TFLOGSTRING("TSY: CMmSecurityTsy::VerifySecurityCodeL - PIN VERIFY REQUESTED"); |
79 iLastPinRequested = EPin1Requested; |
73 iLastPinRequested = EPin1Requested; |
80 } |
74 } |
81 if ( RMobilePhone::ESecurityCodePin2 == *type ) |
75 if ( RMobilePhone::ESecurityCodePin2 == *type ) |
82 { |
76 { |
83 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSECURITYTSY_VERIFYSECURITYCODEL1_2, "TSY: CMmSecurityTsy::VerifySecurityCodeL - PIN2 VERIFY REQUESTED"); |
77 TFLOGSTRING("TSY: CMmSecurityTsy::VerifySecurityCodeL - PIN2 VERIFY REQUESTED"); |
84 iLastPinRequested = EPin2Requested; |
78 iLastPinRequested = EPin2Requested; |
85 } |
79 } |
86 //This is to prevent unnecessary PIN1 request after PUK code |
80 //This is to prevent unnecessary PIN1 request after PUK code |
87 //request. Corrected at the same time with error TKEN-5WFJ7Y |
81 //request. Corrected at the same time with error TKEN-5WFJ7Y |
88 if ( ( ( RMobilePhone::ESecurityCodePuk1 == *type ) || |
82 if ( ( ( RMobilePhone::ESecurityCodePuk1 == *type ) || |
89 ( RMobilePhone::ESecurityCodePuk2 == *type ) ) && |
83 ( RMobilePhone::ESecurityCodePuk2 == *type ) ) && |
90 ( 0 < codes->iUnblockCode.Length() ) ) |
84 ( 0 < codes->iUnblockCode.Length() ) ) |
91 { |
85 { |
92 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSECURITYTSY_VERIFYSECURITYCODEL1_3, "TSY: CMmSecurityTsy::VerifySecurityCodeL - PUK VERIFY REQUESTED"); |
86 TFLOGSTRING("TSY: CMmSecurityTsy::VerifySecurityCodeL - PUK VERIFY REQUESTED"); |
93 iPukCodeVerify = ETrue; |
87 iPukCodeVerify = ETrue; |
94 } |
88 } |
95 //This is to prevent unnecessary PIN1 request after phone password |
89 //This is to prevent unnecessary PIN1 request after phone password |
96 //request (PYRA-5UBCLC) |
90 //request (PYRA-5UBCLC) |
97 if ( RMobilePhone::ESecurityCodePhonePassword == *type ) |
91 if ( RMobilePhone::ESecurityCodePhonePassword == *type ) |
98 { |
92 { |
99 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSECURITYTSY_VERIFYSECURITYCODEL1_4, "TSY: CMmSecurityTsy::VerifySecurityCodeL - PHONE PASSWORD VERIFY REQUESTED"); |
93 TFLOGSTRING("TSY: CMmSecurityTsy::VerifySecurityCodeL - PHONE PASSWORD VERIFY REQUESTED"); |
100 iPhonePasswordVerify = ETrue; |
94 iPhonePasswordVerify = ETrue; |
101 } |
95 } |
102 iMmPhoneTsy->iMmPhoneExtInterface->DeliverCode( *codes ); |
96 iMmPhoneTsy->iMmPhoneExtInterface->DeliverCode( *codes ); |
103 |
97 |
104 // CheckSecurityCode needs to set the lock as well, so pass the |
98 // CheckSecurityCode needs to set the lock as well, so pass the |
163 // --------------------------------------------------------------------------- |
157 // --------------------------------------------------------------------------- |
164 // |
158 // |
165 void CMmSecurityTsy::CompleteVerifySecurityCodeL( |
159 void CMmSecurityTsy::CompleteVerifySecurityCodeL( |
166 TInt aErrorCode ) |
160 TInt aErrorCode ) |
167 { |
161 { |
168 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSECURITYTSY_COMPLETEVERIFYSECURITYCODEL1_1, "TSY: CMmSecurityTsy::CompleteVerifySecurityCode - Error:%d", aErrorCode); |
162 TFLOGSTRING2("TSY: CMmSecurityTsy::CompleteVerifySecurityCode - Error:%d", aErrorCode); |
169 |
163 |
170 TTsyReqHandle reqHandle = iMmPhoneTsy->iTsyReqHandleStore-> |
164 TTsyReqHandle reqHandle = iMmPhoneTsy->iTsyReqHandleStore-> |
171 ResetTsyReqHandle( CMmPhoneTsy::EMultimodePhoneVerifySecurityCode ); |
165 ResetTsyReqHandle( CMmPhoneTsy::EMultimodePhoneVerifySecurityCode ); |
172 |
166 |
173 if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle ) |
167 if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle ) |
200 ( !iPhonePasswordVerify ) ) |
194 ( !iPhonePasswordVerify ) ) |
201 { |
195 { |
202 // IF PIN1 REQUESTED LAST |
196 // IF PIN1 REQUESTED LAST |
203 if ( iLastPinRequested == EPin1Requested ) |
197 if ( iLastPinRequested == EPin1Requested ) |
204 { |
198 { |
205 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSECURITYTSY_COMPLETEVERIFYSECURITYCODEL1_2, "TSY: CMmSecurityTsy::CompleteVerifySecurityCodeL - PIN VERIFICATION NEEDED"); |
199 TFLOGSTRING("TSY: CMmSecurityTsy::CompleteVerifySecurityCodeL - PIN VERIFICATION NEEDED"); |
206 CompleteNotifySecurityEventL( RMobilePhone::EPin1Required, |
200 CompleteNotifySecurityEventL( RMobilePhone::EPin1Required, |
207 KErrNone ); |
201 KErrNone ); |
208 iLastPinRequested = EPinUnknown; |
202 iLastPinRequested = EPinUnknown; |
209 } |
203 } |
210 // IF PIN2 REQUESTED LAST |
204 // IF PIN2 REQUESTED LAST |
211 if (iLastPinRequested == EPin2Requested) |
205 if (iLastPinRequested == EPin2Requested) |
212 { |
206 { |
213 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSECURITYTSY_COMPLETEVERIFYSECURITYCODEL1_3, "TSY: CMmSecurityTsy::CompleteVerifySecurityCodeL - PIN2"); |
207 TFLOGSTRING("TSY: CMmSecurityTsy::CompleteVerifySecurityCodeL - PIN2"); |
214 iLastPinRequested = EPinUnknown; |
208 iLastPinRequested = EPinUnknown; |
215 } |
209 } |
216 } |
210 } |
217 else if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != |
211 else if ( CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != |
218 phoneSetLockSettingHandle && EActiveCodeToUpinAskUpin == |
212 phoneSetLockSettingHandle && EActiveCodeToUpinAskUpin == |
219 iActiveCodeToUpinState ) |
213 iActiveCodeToUpinState ) |
220 { |
214 { |
221 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSECURITYTSY_COMPLETEVERIFYSECURITYCODEL1_4, "TSY: CMmSecurityTsy::CompleteVerifySecurityCodeL - iActiveCodeToUpinState = EActiveCodeToUpinAskPin"); |
215 TFLOGSTRING("TSY: CMmSecurityTsy::CompleteVerifySecurityCodeL - iActiveCodeToUpinState = EActiveCodeToUpinAskPin"); |
222 if ( KErrNone == aErrorCode ) |
216 if ( KErrNone == aErrorCode ) |
223 { |
217 { |
224 iActiveCodeToUpinState = EActiveCodeToUpinAskPin; |
218 iActiveCodeToUpinState = EActiveCodeToUpinAskPin; |
225 CompleteNotifySecurityEventL( |
219 CompleteNotifySecurityEventL( |
226 RMobilePhone::EPin1Required, KErrNone ); |
220 RMobilePhone::EPin1Required, KErrNone ); |