|
1 /* |
|
2 * Copyright (c) 2002 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 * Includes AoC's and CT's commonly needed functions, multi mode ETEL version. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <e32svr.h> |
|
22 |
|
23 #include <secui.h> |
|
24 #include <SecUiSecurityHandler.h> |
|
25 #include <SecUi.rsg> |
|
26 |
|
27 #include <exterror.h> |
|
28 |
|
29 #include "CLogsMMEAocUtil.h" |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 #ifdef __WINS__ |
|
34 // for message to user |
|
35 _LIT(KMissingImplementation,"AoC functionality missing"); |
|
36 // Aoc support variable |
|
37 const TInt KAocSupport = 1; // information service |
|
38 // currency / unit mode |
|
39 const TReal KCurrencyMode = 1.5; // currency mode |
|
40 // call cost limit |
|
41 const TInt KCallCostLimit = 0; // Off |
|
42 #endif |
|
43 |
|
44 |
|
45 // ================= MEMBER FUNCTIONS ======================= |
|
46 |
|
47 // Standard creation function. |
|
48 CLogsAocUtil* CLogsAocUtil::NewL( ) |
|
49 { |
|
50 CLogsAocUtil* self = new ( ELeave ) CLogsAocUtil( ); |
|
51 CleanupStack::PushL( self ); |
|
52 self->ConstructL(); |
|
53 CleanupStack::Pop(); // self |
|
54 return self; |
|
55 } |
|
56 |
|
57 // Destructor |
|
58 CLogsAocUtil::~CLogsAocUtil() |
|
59 { |
|
60 CloseEtelConnection(); |
|
61 //delete iCustomEtel; |
|
62 } |
|
63 |
|
64 void CLogsAocUtil::RunL() |
|
65 { |
|
66 if( iWait.IsStarted() ) |
|
67 { |
|
68 iWait.AsyncStop(); |
|
69 } |
|
70 } |
|
71 |
|
72 void CLogsAocUtil::DoCancel() |
|
73 { |
|
74 if( iCancelStatus != KErrNone ) |
|
75 { |
|
76 iPhone.CancelAsyncRequest( iCancelStatus ); |
|
77 } |
|
78 } |
|
79 |
|
80 // Default constructor |
|
81 void CLogsAocUtil::ConstructL() |
|
82 { |
|
83 //iCustomEtel = CLogsCustomEtel::NewL(); |
|
84 CActiveScheduler::Add( this ); |
|
85 } |
|
86 |
|
87 // Default constructor |
|
88 CLogsAocUtil::CLogsAocUtil( ) |
|
89 //: iAocSupport( KErrNotFound ) |
|
90 { |
|
91 } |
|
92 |
|
93 |
|
94 TInt CLogsAocUtil::AskSecCodeL() |
|
95 { |
|
96 TInt etelOk = OpenEtelConnection(); |
|
97 if( etelOk != KErrNone ) |
|
98 { |
|
99 return etelOk; |
|
100 } |
|
101 TBool rc(ETrue); |
|
102 TSecUi::InitializeLibL(); |
|
103 |
|
104 TInt err; |
|
105 TRAP( err, |
|
106 CSecurityHandler* handler = new (ELeave) CSecurityHandler( iPhone ); |
|
107 CleanupStack::PushL( handler ); |
|
108 rc = handler->AskSecCodeL( ); |
|
109 CleanupStack::PopAndDestroy(); // handler |
|
110 ); |
|
111 |
|
112 TSecUi::UnInitializeLib(); |
|
113 |
|
114 CloseEtelConnection(); |
|
115 if( !rc ) |
|
116 { |
|
117 return KErrCancel; |
|
118 } |
|
119 return KErrNone; |
|
120 |
|
121 } |
|
122 |
|
123 |
|
124 /***************************************************** |
|
125 * Series 60 Customer / ETel |
|
126 * Series 60 ETel API |
|
127 *****************************************************/ |
|
128 TInt CLogsAocUtil::GetAirTimeDuration( TTimeIntervalSeconds& /* aTime */ ) |
|
129 { |
|
130 TInt rc = KErrNone; |
|
131 /* |
|
132 #ifdef __WINS__ |
|
133 User::InfoPrint(KMissingImplementation); |
|
134 #endif |
|
135 aTime = 0; |
|
136 aTime = 0; |
|
137 TInt rc = OpenEtelConnection(); |
|
138 if( rc != KErrNone ) |
|
139 { |
|
140 return rc; |
|
141 } |
|
142 //rc = iPhone.GetAirTimeDuration( aTime ); |
|
143 CloseEtelConnection(); |
|
144 */ |
|
145 return rc; |
|
146 |
|
147 } |
|
148 |
|
149 // End of file |