|
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 * Initial Contributors: |
|
9 * Nokia Corporation - initial contribution. |
|
10 * |
|
11 * Contributors: |
|
12 * Description : |
|
13 * |
|
14 */ |
|
15 |
|
16 #include "securityeventhandler.h" |
|
17 |
|
18 #include "clckcommandhandler.h" |
|
19 #include "debug.h" |
|
20 |
|
21 /** |
|
22 * AO class for monitoring security events |
|
23 */ |
|
24 CSecurityEventHandler* CSecurityEventHandler::NewL(CCLCKCommandHandler* aCLCKHandler, RMobilePhone& aPhone) |
|
25 { |
|
26 TRACE_FUNC_ENTRY |
|
27 CSecurityEventHandler* self = new(ELeave) CSecurityEventHandler(aCLCKHandler,aPhone); |
|
28 TRACE_FUNC_EXIT |
|
29 return self; |
|
30 } |
|
31 |
|
32 CSecurityEventHandler::CSecurityEventHandler(CCLCKCommandHandler* aCLCKHandler, RMobilePhone& aPhone) : |
|
33 CActive(EPriorityNormal), |
|
34 iCLCKHandler(aCLCKHandler), |
|
35 iPhone(aPhone) |
|
36 { |
|
37 TRACE_FUNC_ENTRY |
|
38 CActiveScheduler::Add(this); |
|
39 TRACE_FUNC_EXIT |
|
40 } |
|
41 |
|
42 CSecurityEventHandler::~CSecurityEventHandler() |
|
43 { |
|
44 Cancel(); |
|
45 } |
|
46 |
|
47 void CSecurityEventHandler::Start() |
|
48 { |
|
49 TRACE_FUNC_ENTRY |
|
50 iPhone.NotifySecurityEvent(iStatus, iSecurityEvent); |
|
51 SetActive(); |
|
52 TRACE_FUNC_EXIT |
|
53 } |
|
54 |
|
55 void CSecurityEventHandler::RunL() |
|
56 { |
|
57 TRACE_FUNC_ENTRY |
|
58 Trace(KDebugPrintD, "iStatus.Int(): ", iStatus.Int()); |
|
59 Trace(KDebugPrintD, "iSecurityEvent: ", iSecurityEvent); |
|
60 |
|
61 iCLCKHandler->HandleSecurityEvent(iStatus.Int(), iSecurityEvent); |
|
62 TRACE_FUNC_EXIT |
|
63 } |
|
64 |
|
65 void CSecurityEventHandler::DoCancel() |
|
66 { |
|
67 TRACE_FUNC_ENTRY |
|
68 iPhone.CancelAsyncRequest(EMobilePhoneVerifySecurityCode); |
|
69 TRACE_FUNC_EXIT |
|
70 } |
|
71 |