1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2007-2010 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 @internalComponent - Internal Symbian test code |
19 @internalComponent - Internal Symbian test code |
20 */ |
20 */ |
21 |
21 |
22 #include "testpinnotifierplugin.h" |
22 #include "testpinnotifierplugin.h" |
23 #include <ssm/ssmuiproviderdll.h> |
23 #include <ssm/ssmuiproviderdll.h> |
24 #include <techview/eikdialg.h> |
24 #include <eikdialg.h> |
25 #include <testpinnotifier.rsg> |
25 #include <testpinnotifier.rsg> |
26 #include <bautils.h> |
26 #include <bautils.h> |
27 #include <eikenv.h> |
27 #include <eikenv.h> |
28 #include <uikon.hrh> |
28 #include <uikon.hrh> |
29 #include <ecom/implementationproxy.h> |
29 #include <ecom/implementationproxy.h> |
30 #include <techview/eikseced.h> |
30 #include <eikseced.h> |
31 #include <e32property.h> |
31 #include <e32property.h> |
32 |
32 |
33 const TUint KCustomcmdServerPropertyKey = 0x0012AC; |
33 const TUint KCustomcmdServerPropertyKey = 0x0012AC; |
34 const TUid KCustomcmdServerSID={0x2000D75B}; // tcustomcmd_server SID = KSsmServerName SID (changed in tcustomcmd_server.mmp file) |
34 const TUid KCustomcmdServerSID={0x2000D75B}; // tcustomcmd_server SID = KSsmServerName SID (changed in tcustomcmd_server.mmp file) |
35 |
35 |
36 _LIT(KPinNotifierResFileNameAndPath,"\\resource\\apps\\testpinnotifier.rsc"); |
36 _LIT(KPinNotifierResFileNameAndPath,"\\resource\\apps\\testpinnotifier.rsc"); |
37 _LIT(KPinNotifierTitle,"Security Check"); |
37 _LIT(KPinNotifierTitle,"Security Check"); |
38 |
38 |
39 //Hardcoding security pin code. |
|
40 _LIT(KPinCode,","); |
|
41 |
39 |
42 CArrayPtr<MEikSrvNotifierBase2>* NotifierArrayL() |
40 CArrayPtr<MEikSrvNotifierBase2>* NotifierArrayL() |
43 { |
41 { |
44 CArrayPtrFlat<MEikSrvNotifierBase2>* subjects=new (ELeave)CArrayPtrFlat<MEikSrvNotifierBase2>(10); |
42 CArrayPtrFlat<MEikSrvNotifierBase2>* subjects=new (ELeave)CArrayPtrFlat<MEikSrvNotifierBase2>(10); |
45 CleanupStack::PushL(subjects); |
43 CleanupStack::PushL(subjects); |
67 delete this; |
65 delete this; |
68 } |
66 } |
69 |
67 |
70 CSecurityPinNotifier::TNotifierInfo CSecurityPinNotifier::RegisterL() |
68 CSecurityPinNotifier::TNotifierInfo CSecurityPinNotifier::RegisterL() |
71 { |
69 { |
72 iInfo.iUid = CSsmUiSpecific::SecurityPinNotifierUid(); |
70 const TUid KSecurityPinNotifierUid = {0x2000E667}; |
73 iInfo.iChannel = CSsmUiSpecific::ScreenOutputChannelUid(); |
71 iInfo.iUid = KSecurityPinNotifierUid; |
|
72 |
|
73 const TUid KScreenOutputChannel = {0x10009D48}; |
|
74 iInfo.iChannel = KScreenOutputChannel; |
|
75 |
74 iInfo.iPriority = ENotifierPriorityVHigh; |
76 iInfo.iPriority = ENotifierPriorityVHigh; |
75 return iInfo; |
77 return iInfo; |
76 } |
78 } |
77 |
79 |
78 CSecurityPinNotifier::TNotifierInfo CSecurityPinNotifier::Info() const |
80 CSecurityPinNotifier::TNotifierInfo CSecurityPinNotifier::Info() const |
158 { |
160 { |
159 TPckgBuf<TInt> securityResultBuffer; |
161 TPckgBuf<TInt> securityResultBuffer; |
160 securityResultBuffer = KErrGeneral; |
162 securityResultBuffer = KErrGeneral; |
161 if (iMessage != RMessagePtr2()) |
163 if (iMessage != RMessagePtr2()) |
162 { |
164 { |
163 TBuf<5> newPINValueVerify; |
165 securityResultBuffer = KErrNone; |
164 |
|
165 //Get pinter for the secret editor control |
|
166 CEikSecretEditor* pinEditor = static_cast<CEikSecretEditor*>(Control(0)); |
|
167 pinEditor->GetText(newPINValueVerify); |
|
168 |
|
169 //Verify the entered pin number |
|
170 if(0 == newPINValueVerify.Compare(KPinCode)) |
|
171 { |
|
172 securityResultBuffer = KErrNone; |
|
173 } |
|
174 |
|
175 pinEditor->Reset(); |
|
176 iMessage.Write(iReplySlot,securityResultBuffer); |
166 iMessage.Write(iReplySlot,securityResultBuffer); |
177 iMessage.Complete(KErrNone); |
167 iMessage.Complete(KErrNone); |
178 // Set this swp to indicate to stop the active schaduler |
168 // Set this swp to indicate to stop the active schaduler |
179 const TInt KSwpValForOnOkStopScheduler = 88; |
169 const TInt KSwpValForOnOkStopScheduler = 88; |
180 TInt err = RProperty::Set(KCustomcmdServerSID, KCustomcmdServerPropertyKey, KSwpValForOnOkStopScheduler); |
170 TInt err = RProperty::Set(KCustomcmdServerSID, KCustomcmdServerPropertyKey, KSwpValForOnOkStopScheduler); |