24
|
1 |
/*
|
|
2 |
* Copyright (c) 2006-2009 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 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef CCUSTOMMMSECURITYTSY_H
|
|
21 |
#define CCUSTOMMMSECURITYTSY_H
|
|
22 |
|
|
23 |
// INCLUDES
|
|
24 |
#include "CMmCustomTsy.h"
|
|
25 |
#include "cmmtsyreqhandlestore.h"
|
|
26 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h>
|
|
27 |
#include <ctsy/serviceapi/cmmcustomsecuritytsyconstants.h>
|
|
28 |
|
|
29 |
// FORWARD DECLARATIONS
|
|
30 |
class CMmMessageManagerBase;
|
|
31 |
class CMmDataPackage;
|
|
32 |
|
|
33 |
|
|
34 |
// CLASS DECLARATION
|
|
35 |
|
|
36 |
/**
|
|
37 |
* CMmCustomSecurityTsy
|
|
38 |
*/
|
|
39 |
NONSHARABLE_CLASS( CMmCustomSecurityTsy ) : public CBase
|
|
40 |
{
|
|
41 |
|
|
42 |
public:
|
|
43 |
|
|
44 |
// TSecurityRequestType enumerates indexes to Security's request handle
|
|
45 |
// table. Request handles are stored there while waiting for
|
|
46 |
// completion of the request.
|
|
47 |
enum TSecurityRequestType
|
|
48 |
{
|
|
49 |
ESecurityTsyReqHandleUnknown,
|
|
50 |
ESecurityRequestTypeIsBlocked,
|
|
51 |
ESecurityRequestTypeCheckSecurityCode,
|
|
52 |
ESecurityRequestTypeDisablePhoneLock,
|
|
53 |
|
|
54 |
// Declare constant for those requests that need
|
|
55 |
// own request handle record in iTsyReqHandleStore above the
|
|
56 |
// following
|
|
57 |
ESecurityRequestTypeMaxNumOfRequests,
|
|
58 |
|
|
59 |
// Let the next literal be the last
|
|
60 |
ESecurityRequestTypeUndefined = 0xff
|
|
61 |
};
|
|
62 |
|
|
63 |
public: // Constructors and destructor
|
|
64 |
|
|
65 |
/**
|
|
66 |
* C++ default constructor.
|
|
67 |
*/
|
|
68 |
CMmCustomSecurityTsy();
|
|
69 |
|
|
70 |
/**
|
|
71 |
* Two-phased constructor.
|
|
72 |
*/
|
|
73 |
static CMmCustomSecurityTsy* NewL( CMmCustomTsy* aMmCustomTsy,
|
|
74 |
CMmPhoneTsy* aPhoneTsy );
|
|
75 |
|
|
76 |
/**
|
|
77 |
* Delivers password to extension for lock setting change
|
|
78 |
*
|
|
79 |
* @param aCodes
|
|
80 |
* @return KErrNone
|
|
81 |
*/
|
|
82 |
virtual TInt DeliverCodeL( RMobilePhone::TCodeAndUnblockCode aCodes );
|
|
83 |
|
|
84 |
/**
|
|
85 |
* Destructor.
|
|
86 |
*/
|
|
87 |
~CMmCustomSecurityTsy();
|
|
88 |
|
|
89 |
public:
|
|
90 |
|
|
91 |
/**
|
|
92 |
* Initialisation method
|
|
93 |
*
|
|
94 |
*/
|
|
95 |
void Init();
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Tells whether the object supports given IPC.
|
|
99 |
*
|
|
100 |
* @param aIpc Request's IPC value
|
|
101 |
* @return TBool ETrue if object supports given IPC
|
|
102 |
*/
|
|
103 |
TBool SupportingIPC( const TInt aIpc );
|
|
104 |
|
|
105 |
/**
|
|
106 |
* Handles extended client requests. Uses TRAP to ensure functioning
|
|
107 |
* on memory allocation failure.
|
|
108 |
*
|
|
109 |
* @param aTsyReqHandle Request handle
|
|
110 |
* @param aIpc Request's IPC value
|
|
111 |
* @param aPackage Reference to a data package
|
|
112 |
* @return Error value
|
|
113 |
*/
|
|
114 |
TInt DoExtFuncL( const TTsyReqHandle aTsyReqHandle,
|
|
115 |
const TInt aIpc,
|
|
116 |
const TDataPackage& aPackage );
|
|
117 |
|
|
118 |
/**
|
|
119 |
* Returns request mode for given IPC number.
|
|
120 |
*
|
|
121 |
* @param aIpc An interprocess communication command identifier
|
|
122 |
* @return The ReqMode corresponding to given IPC
|
|
123 |
*/
|
|
124 |
CTelObject::TReqMode ReqModeL( const TInt aIpc );
|
|
125 |
|
|
126 |
/**
|
|
127 |
* Returns number of slots to be used for given IPC.
|
|
128 |
*
|
|
129 |
* @param aIpc An interprocess communication command identifier
|
|
130 |
* @return The number of slots reserved for a given IPC
|
|
131 |
*/
|
|
132 |
TInt NumberOfSlotsL( const TInt aIpc );
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Cancels request of which IPC number and request handle are given
|
|
136 |
* in parameters.
|
|
137 |
*
|
|
138 |
* @param aIpc An interprocess communication command identifier
|
|
139 |
* @param aTsyReqHandle Request handle
|
|
140 |
* @return Error value
|
|
141 |
*/
|
|
142 |
TInt CancelService( const TInt aIpc,
|
|
143 |
const TTsyReqHandle aTsyReqHandle );
|
|
144 |
|
|
145 |
/**
|
|
146 |
* Register given notification.
|
|
147 |
*
|
|
148 |
* @param aIpc An interprocess communication command identifier
|
|
149 |
* @return KErrNotSupported
|
|
150 |
*/
|
|
151 |
TInt RegisterNotification( const TInt aIpc );
|
|
152 |
|
|
153 |
/**
|
|
154 |
* Deregister given notification.
|
|
155 |
*
|
|
156 |
* @param aIpc An interprocess communication command identifier
|
|
157 |
* @return KErrNotSupported
|
|
158 |
*/
|
|
159 |
TInt DeregisterNotification( const TInt aIpc );
|
|
160 |
|
|
161 |
public: // New functions
|
|
162 |
|
|
163 |
/**
|
|
164 |
* Completes the IsBlocked response message.
|
|
165 |
*
|
|
166 |
* @param aError Error value
|
|
167 |
* @param aIsBlocked
|
|
168 |
*/
|
|
169 |
void CompleteIsBlocked( TInt aError, TBool aIsBlocked );
|
|
170 |
|
|
171 |
/**
|
|
172 |
* Completes the CheckSecurityCode response message.
|
|
173 |
*
|
|
174 |
* @param aError Error value
|
|
175 |
*/
|
|
176 |
void CompleteCheckSecurityCode( TInt aError );
|
|
177 |
|
|
178 |
/**
|
|
179 |
* Completes the CheckSecurityCodeCancel response message.
|
|
180 |
*
|
|
181 |
*/
|
|
182 |
void CompleteCheckSecurityCodeCancel();
|
|
183 |
|
|
184 |
/**
|
|
185 |
* Completes the DisablePhoneLock request.
|
|
186 |
*
|
|
187 |
* @param aError Error value
|
|
188 |
*/
|
|
189 |
void CompleteDisablePhoneLock( TInt aError );
|
|
190 |
|
|
191 |
/**
|
|
192 |
* Change the information about the currently active PIN.
|
|
193 |
*
|
|
194 |
* @param aDataPackage Data package
|
|
195 |
*/
|
|
196 |
void SetActivePin( CMmDataPackage* aDataPackage );
|
|
197 |
|
|
198 |
|
|
199 |
#ifdef REQHANDLE_TIMER
|
|
200 |
/**
|
|
201 |
* Calls the needed complete method due the timer expiration
|
|
202 |
*
|
|
203 |
* @param aReqHandleType
|
|
204 |
* @param aError
|
|
205 |
*/
|
|
206 |
void Complete( TInt aReqHandleType, TInt aError );
|
|
207 |
#endif //REQHANDLE_TIMER
|
|
208 |
|
|
209 |
private:
|
|
210 |
|
|
211 |
/**
|
|
212 |
* By default EPOC constructor is private.
|
|
213 |
*/
|
|
214 |
void ConstructL( CMmCustomTsy* aMmCustomTsy, CMmPhoneTsy* aMmPhoneTsy );
|
|
215 |
|
|
216 |
/**
|
|
217 |
* Is Blocked
|
|
218 |
*
|
|
219 |
* @param aTsyReqHandle Request handle
|
|
220 |
* @param aCode Security code type
|
|
221 |
* @param aIsBlocked
|
|
222 |
* @return Error value
|
|
223 |
*/
|
|
224 |
TInt IsBlocked( const TTsyReqHandle aTsyReqHandle,
|
|
225 |
RMmCustomAPI::TSecurityCodeType* aCode,
|
|
226 |
TBool* aIsBlocked );
|
|
227 |
|
|
228 |
/**
|
|
229 |
* Check Security Code
|
|
230 |
*
|
|
231 |
* @param aTsyReqHandle Request handle
|
|
232 |
* @param aCode Security code type
|
|
233 |
* @return Error value
|
|
234 |
*/
|
|
235 |
TInt CheckSecurityCodeL( const TTsyReqHandle aTsyReqHandle,
|
|
236 |
RMmCustomAPI::TSecurityCodeType* aCode );
|
|
237 |
|
|
238 |
/**
|
|
239 |
* Cancel the CheckSecurityCode request
|
|
240 |
*
|
|
241 |
* @return KErrNone
|
|
242 |
*/
|
|
243 |
TInt CheckSecurityCodeCancelL();
|
|
244 |
|
|
245 |
/**
|
|
246 |
* Disable Phone Lock
|
|
247 |
*
|
|
248 |
* @param aTsyReqHandle Request handle
|
|
249 |
* @param aPassword Password for verify
|
|
250 |
* @return Error value
|
|
251 |
*/
|
|
252 |
TInt DisablePhoneLockL( const TTsyReqHandle aTsyReqHandle,
|
|
253 |
RMobilePhone::TMobilePassword* aPassword );
|
|
254 |
|
|
255 |
/**
|
|
256 |
* Gets the currently active PIN (PIN/UPIN) code
|
|
257 |
*
|
|
258 |
* @param aTsyReqHandle Request handle
|
|
259 |
* @param aActivePin
|
|
260 |
* @return KErrNone
|
|
261 |
*/
|
|
262 |
TInt GetActivePin( const TTsyReqHandle aTsyReqHandle,
|
|
263 |
RMobilePhone::TMobilePhoneSecurityCode* aActivePin );
|
|
264 |
|
|
265 |
#ifdef REQHANDLE_TIMER
|
|
266 |
/**
|
|
267 |
* Chooses the type of response, automatic or common
|
|
268 |
*
|
|
269 |
* @param aReqHandleType
|
|
270 |
* @param aTsyReqHandle
|
|
271 |
*/
|
|
272 |
void SetTypeOfResponse( const TInt aReqHandleType,
|
|
273 |
const TTsyReqHandle aTsyReqHandle );
|
|
274 |
#endif // REQHANDLE_TIMER
|
|
275 |
|
|
276 |
private: // Data
|
|
277 |
|
|
278 |
/**
|
|
279 |
* Pointer to CMmCustomTsy class
|
|
280 |
* Not Own.
|
|
281 |
*/
|
|
282 |
CMmCustomTsy* iMmCustomTsy;
|
|
283 |
|
|
284 |
/**
|
|
285 |
* Pointer to request handle store
|
|
286 |
* Own.
|
|
287 |
*/
|
|
288 |
CMmTsyReqHandleStore* iTsyReqHandleStore;
|
|
289 |
|
|
290 |
/**
|
|
291 |
* SIM CustomAPI request handle table
|
|
292 |
*/
|
|
293 |
TTsyReqHandle iSecReqHandles[ESecurityRequestTypeMaxNumOfRequests];
|
|
294 |
|
|
295 |
/**
|
|
296 |
* SIM CustomAPI request handle table
|
|
297 |
*/
|
|
298 |
TUint8 iTransId;
|
|
299 |
|
|
300 |
/**
|
|
301 |
* Saves temporarily last TSY request type
|
|
302 |
*/
|
|
303 |
TSecurityRequestType iReqHandleType;
|
|
304 |
|
|
305 |
/**
|
|
306 |
* Code: PIN, PIN2 or Security
|
|
307 |
*/
|
|
308 |
TUint8 iCodeID;
|
|
309 |
|
|
310 |
/**
|
|
311 |
* Pointer to client side data
|
|
312 |
* Not Own.
|
|
313 |
*/
|
|
314 |
TBool* iIsBlocked;
|
|
315 |
|
|
316 |
/**
|
|
317 |
* Variable for storing temporarily Security code
|
|
318 |
*/
|
|
319 |
RMobilePhone::TMobilePassword iSecCode;
|
|
320 |
|
|
321 |
/**
|
|
322 |
* Pointer to CMmPhoneTsy class
|
|
323 |
* Not Own.
|
|
324 |
*/
|
|
325 |
CMmPhoneTsy* iMmPhoneTsy;
|
|
326 |
|
|
327 |
/**
|
|
328 |
* Holding the information of the currently active PIN
|
|
329 |
*/
|
|
330 |
RMobilePhone::TMobilePhoneSecurityCode iActivePin;
|
|
331 |
|
|
332 |
};
|
|
333 |
|
|
334 |
#endif // CMMCUSTOMSECURITYTSY_H
|
|
335 |
|
|
336 |
// End of File
|