author | mikaruus <mika.a.ruuskanen@nokia.com> |
Thu, 14 Jan 2010 10:44:58 +0200 | |
changeset 5 | 8ccc39f9d787 |
parent 0 | 63b37f68c1ce |
child 7 | fa67e03b87df |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* Copyright (c) 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 the License "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: ?Description |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// INCLUDE FILES |
|
19 |
#include <etelmm.h> |
|
20 |
#include <tisi.h> |
|
21 |
#include <pn_const.h> |
|
22 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h> |
|
23 |
#include "cmmmessagerouter.h" |
|
24 |
#include "cmmphonebookoperationinit3G_adn.h" |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
25 |
#include "OstTraceDefinitions.h" |
0 | 26 |
#ifdef OST_TRACE_COMPILER_IN_USE |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
27 |
#include "cmmphonebookoperationinitTraces.h" |
0 | 28 |
#include "OstTraceDefinitions.h" |
29 |
#ifdef OST_TRACE_COMPILER_IN_USE |
|
30 |
#include "cmmphonebookoperationinit3g_adnTraces.h" |
|
31 |
#endif |
|
32 |
||
33 |
#endif |
|
34 |
||
35 |
// EXTERNAL DATA STRUCTURES |
|
36 |
// None |
|
37 |
||
38 |
// EXTERNAL FUNCTION PROTOTYPES |
|
39 |
// None |
|
40 |
||
41 |
// CONSTANTS |
|
42 |
||
43 |
// MACROS |
|
44 |
// None |
|
45 |
||
46 |
// LOCAL CONSTANTS AND MACROS |
|
47 |
// None |
|
48 |
||
49 |
// MODULE DATA STRUCTURES |
|
50 |
// None |
|
51 |
||
52 |
// LOCAL FUNCTION PROTOTYPES |
|
53 |
// None |
|
54 |
||
55 |
// ==================== LOCAL FUNCTIONS ===================================== |
|
56 |
// None |
|
57 |
||
58 |
||
59 |
// ================= MEMBER FUNCTIONS ======================================= |
|
60 |
||
61 |
// ----------------------------------------------------------------------------- |
|
62 |
// CMmPhoneBookOperationInit::CMmPhoneBookOperationInit |
|
63 |
// C++ default constructor can NOT contain any code, that |
|
64 |
// might leave. |
|
65 |
// ----------------------------------------------------------------------------- |
|
66 |
||
67 |
CMmPhoneBookOperationInit3G_adn::CMmPhoneBookOperationInit3G_adn |
|
68 |
( |
|
69 |
// None |
|
70 |
) |
|
71 |
{ |
|
72 |
TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::CMmPhoneBookOperationInit3G_adn"); |
|
73 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_CMMPHONEBOOKOPERATIONINIT3G_ADN, "CMmPhoneBookOperationInit3G_adn::CMmPhoneBookOperationInit3G_adn" ); |
|
74 |
||
75 |
} |
|
76 |
||
77 |
// ----------------------------------------------------------------------------- |
|
78 |
// CMmPhoneBookOperationInit::~CMmPhoneBookOperationInit |
|
79 |
// C++ destructor. |
|
80 |
// ----------------------------------------------------------------------------- |
|
81 |
// |
|
82 |
CMmPhoneBookOperationInit3G_adn::~CMmPhoneBookOperationInit3G_adn |
|
83 |
( |
|
84 |
// None |
|
85 |
) |
|
86 |
{ |
|
87 |
TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::CMmPhoneBookOperationInit3G_adn"); |
|
88 |
OstTrace0( TRACE_NORMAL, DUP1_CMMPHONEBOOKOPERATIONINIT3G_ADN_CMMPHONEBOOKOPERATIONINIT3G_ADN, "CMmPhoneBookOperationInit3G_adn::~CMmPhoneBookOperationInit3G_adn" ); |
|
89 |
||
90 |
} |
|
91 |
||
92 |
// ----------------------------------------------------------------------------- |
|
93 |
// CmmPhonebookOperatorInit::NewL |
|
94 |
// Two-phased constructor. |
|
95 |
// Creates a new CmmPhonebookOperatorInit object instance. |
|
96 |
// ----------------------------------------------------------------------------- |
|
97 |
||
98 |
CMmPhoneBookOperationInit3G_adn* CMmPhoneBookOperationInit3G_adn::NewL |
|
99 |
( |
|
100 |
CMmPhoneBookStoreMessHandler* aMmPhoneBookStoreMessHandler, |
|
101 |
CMmUiccMessHandler* aUiccMessHandler, |
|
102 |
const CMmDataPackage* aDataPackage // Data |
|
103 |
) |
|
104 |
{ |
|
105 |
TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::NewL"); |
|
106 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_NEWL, "CMmPhoneBookOperationInit3G_adn::NewL" ); |
|
107 |
||
108 |
||
109 |
TName phonebookTypeName; |
|
110 |
||
111 |
CMmPhoneBookOperationInit3G_adn* mmPhoneBookOperationInit3G_adn = |
|
112 |
new( ELeave ) CMmPhoneBookOperationInit3G_adn(); |
|
113 |
||
114 |
CleanupStack::PushL( mmPhoneBookOperationInit3G_adn ); |
|
115 |
||
116 |
const CPhoneBookDataPackage* phoneBookData = |
|
117 |
static_cast<const CPhoneBookDataPackage*>( aDataPackage ); |
|
118 |
||
119 |
phoneBookData->GetPhoneBookName( phonebookTypeName ); |
|
120 |
// Store phonebook name |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
121 |
mmPhoneBookOperationInit3G_adn->iPhoneBookTypeName = phonebookTypeName; |
0 | 122 |
|
123 |
if( 0 == phonebookTypeName.CompareF( KInternalPhoneBookType ) ) |
|
124 |
{ |
|
125 |
mmPhoneBookOperationInit3G_adn->iIniPhase = EPBIniPhase_Internal; |
|
126 |
} |
|
127 |
else // Full construction is not needed in case of internal initilization |
|
128 |
{ |
|
129 |
mmPhoneBookOperationInit3G_adn->ConstructL(); |
|
130 |
} |
|
131 |
mmPhoneBookOperationInit3G_adn->iMmPhoneBookStoreMessHandler = |
|
132 |
aMmPhoneBookStoreMessHandler; |
|
133 |
||
134 |
mmPhoneBookOperationInit3G_adn->iMmUiccMessHandler = aUiccMessHandler; |
|
135 |
||
136 |
// set to false by default. Will be set as true once after |
|
137 |
// initialization req has been generated. |
|
138 |
mmPhoneBookOperationInit3G_adn->iInternalInit = EFalse; |
|
139 |
||
140 |
||
141 |
CleanupStack::Pop( mmPhoneBookOperationInit3G_adn ); |
|
142 |
||
143 |
return mmPhoneBookOperationInit3G_adn; |
|
144 |
} |
|
145 |
||
146 |
||
147 |
||
148 |
||
149 |
// ----------------------------------------------------------------------------- |
|
150 |
// CMmPhoneBookOperationInit::ConstructL |
|
151 |
// Initialises object attributes. |
|
152 |
// ----------------------------------------------------------------------------- |
|
153 |
// |
|
154 |
void CMmPhoneBookOperationInit3G_adn::ConstructL |
|
155 |
( |
|
156 |
// None |
|
157 |
) |
|
158 |
{ |
|
159 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::ConstructL" ); |
|
160 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_CONSTRUCTL, "CMmPhoneBookOperationInit3G_adn::ConstructL" ); |
|
161 |
||
162 |
iPBStoreInfoData = new( ELeave ) CStorageInfoData(); |
|
163 |
||
164 |
iIniPhase = 0; |
|
165 |
iServiceType = 0; |
|
166 |
iNumOfPBRRecords = 0; |
|
167 |
||
168 |
||
169 |
||
170 |
#ifdef INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS |
|
171 |
TFLOGSTRING("TSY: CMmPhoneBookStoreMessHandler. \ |
|
172 |
INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS is ON."); |
|
173 |
||
174 |
iMmPhoneBookStoreMessHandler->SetMaxNumOfAasEntries( 0 ); |
|
175 |
iMmPhoneBookStoreMessHandler->SetMaxNumberOfGAS( 0 ); |
|
176 |
#else |
|
177 |
TFLOGSTRING("TSY: CMmPhoneBookStoreMessHandler. \ |
|
178 |
INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS is OFF."); |
|
179 |
#endif // INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS |
|
180 |
||
181 |
||
182 |
} |
|
183 |
||
184 |
||
185 |
||
186 |
// ----------------------------------------------------------------------------- |
|
187 |
// CMmPhoneBookOperationInit3G_adn::UICCCreateReq |
|
188 |
// For USIM Separate different request to correct function |
|
189 |
// ----------------------------------------------------------------------------- |
|
190 |
// |
|
191 |
TInt CMmPhoneBookOperationInit3G_adn::UICCCreateReq |
|
192 |
( |
|
193 |
TInt aIpc, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
194 |
const CMmDataPackage* /*aDataPackage*/, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
195 |
TUint8 aTransId |
0 | 196 |
) |
197 |
{ |
|
198 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::UICCCreateReq" ); |
|
199 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_UICCCREATEREQ, "CMmPhoneBookOperationInit3G_adn::UICCCreateReq" ); |
|
200 |
||
201 |
TInt ret( KErrNotSupported ); |
|
202 |
||
203 |
switch( aIpc ) |
|
204 |
{ |
|
205 |
case EMmTsyPhoneBookStoreInitIPC: |
|
206 |
{ |
|
207 |
if( !iInternalInit ) |
|
208 |
{ |
|
209 |
// no internal init ongoing |
|
210 |
if ( EPBIniPhase_Internal == iIniPhase ) |
|
211 |
{ |
|
212 |
// Initialization is starting. Turn the flag on. |
|
213 |
iInternalInit = ETrue; |
|
214 |
||
215 |
} |
|
216 |
||
217 |
iServiceType = UICC_APPL_FILE_INFO; |
|
218 |
||
219 |
// Start Initialization for ADN phonebook 3G |
|
220 |
iIniPhase = EPBInitPhase_3GADN_PBR; |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
221 |
ret = UICCInitializeReq3GADN( aTransId ); |
0 | 222 |
} |
223 |
else // else for if internalInit goign on |
|
224 |
{ |
|
225 |
// Simultaneous initializations are not allowed. |
|
226 |
ret = KErrInUse; |
|
227 |
} |
|
228 |
break; |
|
229 |
} |
|
230 |
default: |
|
231 |
{ |
|
232 |
// Nothing to do here |
|
233 |
TFLOGSTRING2( "TSY: CMmPhoneBookOperationInit3G_adn::UICCCreateReq - \ |
|
234 |
Unknown IPC: %d", aIpc ); |
|
235 |
OstTrace1( TRACE_NORMAL, DUP1_CMMPHONEBOOKOPERATIONINIT3G_ADN_UICCCREATEREQ, "CMmPhoneBookOperationInit3G_adn::UICCCreateReq;Unknown IPC =%d", aIpc ); |
|
236 |
||
237 |
break; |
|
238 |
} |
|
239 |
} // switch-case ends |
|
240 |
return ret; |
|
241 |
} |
|
242 |
||
243 |
||
244 |
||
245 |
||
246 |
// ----------------------------------------------------------------------------- |
|
247 |
// CMmPhoneBookOperationInit3G_adn::UICCCreateReq |
|
248 |
// For USIM Separate different request to correct function |
|
249 |
// ----------------------------------------------------------------------------- |
|
250 |
// |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
251 |
TInt CMmPhoneBookOperationInit3G_adn::UICCInitializeReq3GADN( TUint8 aTransId) |
0 | 252 |
{ |
253 |
TInt ret(KErrNone); |
|
254 |
||
255 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::UICCInitializeReq3GADN" ); |
|
256 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_UICCINITIALIZEREQ3GADN, "CMmPhoneBookOperationInit3G_adn::UICCInitializeReq3GADN" ); |
|
257 |
||
258 |
TInt appFileID( APPL_FILE_ID ); |
|
259 |
TUiccReadLinearFixed cmdParams; |
|
260 |
cmdParams.messHandlerPtr = |
|
261 |
static_cast<MUiccOperationBase*>( iMmPhoneBookStoreMessHandler ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
262 |
cmdParams.trId = static_cast<TUiccTrId>( aTransId ); |
0 | 263 |
|
264 |
cmdParams.filePath.Append( static_cast<TUint8>( MF_FILE >> 8 )); |
|
265 |
cmdParams.filePath.Append( static_cast<TUint8>( MF_FILE )); |
|
266 |
cmdParams.filePath.Append( appFileID>>8 ); |
|
267 |
cmdParams.filePath.Append( appFileID ); |
|
268 |
cmdParams.filePath.Append( static_cast<TUint8>( DF_PHONEBOOK >> 8 )); |
|
269 |
cmdParams.filePath.Append( static_cast<TUint8>( DF_PHONEBOOK )); |
|
270 |
||
271 |
switch( iIniPhase ) |
|
272 |
{ |
|
273 |
case EPBInitPhase_3GADN_PBR: |
|
274 |
{ |
|
275 |
// Send Request to UICC Server to Read file Info of PBR file |
|
276 |
// No. of records in PBR file |
|
277 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::UICCInitializeReq3GADN - \ |
|
278 |
File Info Read Request for EF-PBR " ); |
|
279 |
OstTrace0( TRACE_NORMAL, DUP1_CMMPHONEBOOKOPERATIONINIT3G_ADN_UICCINITIALIZEREQ3GADN, "CMmPhoneBookOperationInit3G_adn::UICCInitializeReq3GADN - File Info Read Request for EF-PBR" ); |
|
280 |
||
281 |
cmdParams.fileId = PB_PBR_FID; |
|
282 |
cmdParams.serviceType = iServiceType; |
|
283 |
cmdParams.record = 0; |
|
284 |
break; |
|
285 |
} |
|
286 |
case EPBInitPhase_3GADN_Type1: |
|
287 |
{ |
|
288 |
// read Type 1 Files File descriptor, File Data and Extension File data |
|
289 |
ret = CreateReqFetchTypeFile( cmdParams, UICC_TYPE1_FILE ); |
|
290 |
break; |
|
291 |
} |
|
292 |
case EPBInitPhase_3GADN_Type2: |
|
293 |
{ |
|
294 |
// read Type 2 Files File descriptor, File Data and Extension File data |
|
295 |
ret = CreateReqFetchTypeFile( cmdParams, UICC_TYPE2_FILE ); |
|
296 |
break; |
|
297 |
} |
|
298 |
case EPBInitPhase_3GADN_Type3: |
|
299 |
{ |
|
300 |
// read Type 3 Files File descriptor, File Data and Extension File data |
|
301 |
ret = CreateReqFetchTypeFile( cmdParams, UICC_TYPE3_FILE ); |
|
302 |
break; |
|
303 |
} |
|
304 |
default: |
|
305 |
{ |
|
306 |
break; |
|
307 |
} |
|
308 |
} |
|
309 |
||
310 |
// if intialization for USIM ADN phonebook has not been completed till now then send the |
|
311 |
// request for the correct phase |
|
312 |
||
313 |
if( EPBIniPhase_3GADNDone != iIniPhase ) |
|
314 |
{ |
|
315 |
ret = iMmPhoneBookStoreMessHandler->UiccMessHandler()-> |
|
316 |
CreateUiccApplCmdReq( cmdParams ); |
|
317 |
TFLOGSTRING2( "TSY: CreateUiccApplCmdReq returns %d", ret ); |
|
318 |
} |
|
319 |
||
320 |
return ret; |
|
321 |
} |
|
322 |
||
323 |
||
324 |
||
325 |
// ----------------------------------------------------------------------------- |
|
326 |
// CmmPhonebookOperationInit::CreateReqFetchTypeFile |
|
327 |
// Creates data to fetch EF of type 1, Type2 and Type3 in PBR file TLV for File |
|
328 |
//Info or File Data |
|
329 |
// ----------------------------------------------------------------------------- |
|
330 |
// |
|
331 |
||
332 |
||
333 |
TInt CMmPhoneBookOperationInit3G_adn::CreateReqFetchTypeFile( |
|
334 |
TUiccReadLinearFixed & aparams, |
|
335 |
const TUint8 aFileType) |
|
336 |
{ |
|
337 |
TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::CreateReqFetchTypeFile"); |
|
338 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_CREATEREQFETCHTYPEFILE, "CMmPhoneBookOperationInit3G_adn::CreateReqFetchTypeFile" ); |
|
339 |
||
340 |
||
341 |
TInt ret( KErrNone ); |
|
342 |
TUint16 fileFID ( 0 ); |
|
343 |
TUint8 fileSFI ( 0 ); |
|
344 |
||
345 |
switch( aFileType ) |
|
346 |
{ |
|
347 |
case UICC_TYPE1_FILE: |
|
348 |
{ |
|
349 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::CreateReqFetchTypeFile - Create req for Type 1 File " ); |
|
350 |
OstTrace0( TRACE_NORMAL, DUP1_CMMPHONEBOOKOPERATIONINIT3G_ADN_CREATEREQFETCHTYPEFILE, "CMmPhoneBookOperationInit3G_adn::CreateReqFetchTypeFile - Create req for Type 1 File " ); |
|
351 |
||
352 |
fileFID = iType1FileArray[iCurrentArrayCounter].tagFID; |
|
353 |
fileSFI = iType1FileArray[iCurrentArrayCounter].tagSFI; |
|
354 |
} |
|
355 |
break; |
|
356 |
case UICC_TYPE2_FILE: |
|
357 |
{ |
|
358 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::CreateReqFetchTypeFile - Create req for Type 2 File " ); |
|
359 |
OstTrace0( TRACE_NORMAL, DUP3_CMMPHONEBOOKOPERATIONINIT3G_ADN_CREATEREQFETCHTYPEFILE, "CMmPhoneBookOperationInit3G_adn::CreateReqFetchTypeFile - Create req for Type 2 File " ); |
|
360 |
||
361 |
fileFID = iType2FileArray[iCurrentArrayCounter].tagFID; |
|
362 |
fileSFI = iType2FileArray[iCurrentArrayCounter].tagSFI; |
|
363 |
} |
|
364 |
break; |
|
365 |
case UICC_TYPE3_FILE: |
|
366 |
{ |
|
367 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::CreateReqFetchTypeFile - Create req for Type 3 File " ); |
|
368 |
OstTrace0( TRACE_NORMAL, DUP2_CMMPHONEBOOKOPERATIONINIT3G_ADN_CREATEREQFETCHTYPEFILE, "CMmPhoneBookOperationInit3G_adn::CreateReqFetchTypeFile - Create req for Type 3 File " ); |
|
369 |
||
370 |
fileFID = iType3FileArray[iCurrentArrayCounter].tagFID; |
|
371 |
fileSFI = iType3FileArray[iCurrentArrayCounter].tagSFI; |
|
372 |
} |
|
373 |
break; |
|
374 |
default: |
|
375 |
{ |
|
376 |
break; |
|
377 |
} |
|
378 |
} |
|
379 |
||
380 |
// FCP req for EFadn |
|
381 |
aparams.fileId = fileFID; |
|
382 |
aparams.fileIdSfi = fileSFI; |
|
383 |
aparams.serviceType = iServiceType; |
|
384 |
aparams.record = 0; |
|
385 |
||
386 |
return ret; |
|
387 |
} |
|
388 |
||
389 |
||
390 |
// ----------------------------------------------------------------------------- |
|
391 |
// CmmPhonebookOperationInit::HandleUICCPbRespL |
|
392 |
// HAndle response for all phase init response in USIM |
|
393 |
// ----------------------------------------------------------------------------- |
|
394 |
// |
|
395 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
396 |
TBool CMmPhoneBookOperationInit3G_adn::HandleUICCPbRespL |
0 | 397 |
( |
398 |
TInt aStatus, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
399 |
TUint8 /*aDetails*/, |
0 | 400 |
const TDesC8 &aFileData, |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
401 |
TInt aTransId |
0 | 402 |
) |
403 |
{ |
|
404 |
TInt ret( KErrNone ); |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
405 |
TBool complete( EFalse ); |
0 | 406 |
|
407 |
// break immediatelly in case of internal init |
|
408 |
if ( iInternalInit ) |
|
409 |
{ |
|
410 |
TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::HandleUICCPbRespL. Internal Init->Break"); |
|
411 |
OstTrace0( TRACE_NORMAL, DUP1_CMMPHONEBOOKOPERATIONINIT3G_ADN_HANDLEUICCPBRESPL, "CMmPhoneBookOperationInit3G_adn::HandleUICCPbRespL. Internal Init-> Break" ); |
|
412 |
||
413 |
||
414 |
iIniPhase = EPBIniPhase_Unknown; |
|
415 |
||
416 |
iInternalInit = EFalse; |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
417 |
complete = ETrue; |
0 | 418 |
return KErrNone; |
419 |
} |
|
420 |
||
421 |
switch(iIniPhase) |
|
422 |
{ |
|
423 |
case EPBInitPhase_3GADN_PBR: |
|
424 |
case EPBInitPhase_3GADN_Type1: |
|
425 |
case EPBInitPhase_3GADN_Type2: |
|
426 |
case EPBInitPhase_3GADN_Type3: |
|
427 |
{ |
|
428 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::HandleUICCPbRespL. USIM ADN PhoneBook Init" ); |
|
429 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_HANDLEUICCPBRESPL, "CMmPhoneBookOperationInit3G_adn::HandleUICCPbRespL. USIM ADN Phonebook init" ); |
|
430 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
431 |
ret = HandleUICCPbResp3GADN( aFileData, aStatus, aTransId ); |
0 | 432 |
} |
433 |
break; |
|
434 |
case EPBInitPhaseFDN: |
|
435 |
case EPBInitPhaseSDN: |
|
436 |
case EPBInitPhaseMBDN: |
|
437 |
case EPBInitPhaseMSISDN: |
|
438 |
{ |
|
439 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit::HandleUICCPbRespL. Other PhoneBook Init" ); |
|
440 |
OstTrace0( TRACE_NORMAL, DUP2_CMMPHONEBOOKOPERATIONINIT3G_ADN_HANDLEUICCPBRESPL, "CMmPhoneBookOperationInit3G_adn::HandleUICCPbRespL. Other Phonebook Init" ); |
|
441 |
||
442 |
// For all other phoenbook handling is same as 2g Phonebook |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
443 |
ret = HandlePBRespL( aFileData, aStatus, aTransId ); |
0 | 444 |
} |
445 |
break; |
|
446 |
default: |
|
447 |
// Not to handle anything if card type is not available |
|
448 |
break; |
|
449 |
||
450 |
} |
|
451 |
||
452 |
// Complete, if phonebook initalization is complete or there is some error in UICC server |
|
453 |
if ( KErrNone != ret || EPBIniPhase_PBInitialized == iIniPhase ) |
|
454 |
{ |
|
455 |
CPhoneBookDataPackage phoneBookData; |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
456 |
phoneBookData.SetPhoneBookName( iPhoneBookTypeName ); |
0 | 457 |
phoneBookData.PackData( iPBStoreInfoData ); |
458 |
||
459 |
if ( UICC_STATUS_OK != aStatus ) |
|
460 |
{ |
|
461 |
ret = CMmStaticUtility::UICCCSCauseToEpocError( aStatus ); |
|
462 |
} |
|
463 |
||
464 |
iMmPhoneBookStoreMessHandler->MessageRouter()->Complete( |
|
465 |
EMmTsyPhoneBookStoreInitIPC, |
|
466 |
&phoneBookData, |
|
467 |
ret ); |
|
468 |
||
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
469 |
complete = ETrue; |
0 | 470 |
} |
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
471 |
return complete; |
0 | 472 |
|
473 |
} |
|
474 |
// ----------------------------------------------------------------------------- |
|
475 |
// CmmPhonebookOperationInit::HandleUICCPbResp3GADN |
|
476 |
// Handle response for ADN phone book init in USIM |
|
477 |
// ----------------------------------------------------------------------------- |
|
478 |
// |
|
479 |
TInt CMmPhoneBookOperationInit3G_adn::HandleUICCPbResp3GADN |
|
480 |
( |
|
481 |
const TDesC8& aFileData, |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
482 |
TInt aStatus, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
483 |
TUint8 aTransId ) |
0 | 484 |
{ |
485 |
TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::HandleUICCPbResp3GADN"); |
|
486 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_HANDLEUICCPBRESP3GADN, "CMmPhoneBookOperationInit3G_adn::HandleUICCPbResp3GADN" ); |
|
487 |
||
488 |
TInt ret( KErrNone ); |
|
489 |
||
490 |
switch(iIniPhase) |
|
491 |
{ |
|
492 |
case EPBInitPhase_3GADN_PBR: |
|
493 |
{ |
|
494 |
if(UICC_STATUS_OK == aStatus) |
|
495 |
{ |
|
496 |
TInt offSet( 0 ); |
|
497 |
// For File Info , get the no of records in PBR file to get the total no of entries in 3G ADN phonebook |
|
498 |
if( UICC_APPL_FILE_INFO == iServiceType ) |
|
499 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
500 |
TFci fci( aFileData ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
501 |
iNumOfPBRRecords = fci.GetNumberOfRecords(); |
0 | 502 |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
503 |
ret = KErrNone; |
0 | 504 |
iServiceType = UICC_APPL_READ_LINEAR_FIXED; |
505 |
} |
|
506 |
else if( UICC_APPL_READ_LINEAR_FIXED == iServiceType ) |
|
507 |
{ |
|
508 |
// Get the offset for Type 1 file tag "KTagConstructedTagA8" |
|
509 |
offSet = aFileData.Find( &KTagConstructedTagA8, 1 ); |
|
510 |
if( offSet != KErrNotFound ) |
|
511 |
{ |
|
512 |
// Fetch Type 1 files and store fileId , File tag, and SFI value in iType1FileArray |
|
513 |
ret = FetchType1FileFromPBR( aFileData ); |
|
514 |
} |
|
515 |
||
516 |
// Get the offset for type 2 Files |
|
517 |
offSet = aFileData.Find( &KTagConstructedTagA9, 1 ); |
|
518 |
if( offSet != KErrNotFound ) |
|
519 |
{ |
|
520 |
// Fetch Type2 files and store fileId , File tag, and SFI value in iType2FileArray |
|
521 |
ret = FetchType2FileFromPBR( aFileData ); |
|
522 |
} |
|
523 |
||
524 |
// Get the offset for type 3 Files |
|
525 |
offSet = aFileData.Find( &KTagConstructedTagAA, 1 ); |
|
526 |
if( offSet != KErrNotFound ) |
|
527 |
{ |
|
528 |
// Fetch Type 3 files and store fileId , File tag, and SFI value in iType3FileArray |
|
529 |
ret = FetchType3FileFromPBR( aFileData ); |
|
530 |
} |
|
531 |
||
532 |
// Consistency check for File ids and if there is same file IDs then remove those File Ids |
|
533 |
ret = CheckForFileId(); |
|
534 |
||
535 |
// Consistency Check for Type 1 file should not be type 2 or type3 |
|
536 |
ret = CheckForSameType1AndType2Files(); |
|
537 |
||
538 |
iServiceType = UICC_APPL_FILE_INFO; |
|
539 |
iIniPhase = EPBInitPhase_3GADN_Type1; |
|
540 |
} |
|
541 |
} |
|
542 |
else |
|
543 |
{ |
|
544 |
iADNPbInitilized = EFalse; |
|
545 |
GetNextPhoneBookInitPhase(iIniPhase); |
|
546 |
} |
|
547 |
} |
|
548 |
break; |
|
549 |
case EPBInitPhase_3GADN_Type1: |
|
550 |
{ |
|
551 |
HandleType1FileResp( aFileData, aStatus ); |
|
552 |
} |
|
553 |
break; |
|
554 |
case EPBInitPhase_3GADN_Type2: |
|
555 |
{ |
|
556 |
HandleType2FileResp( aFileData, aStatus ); |
|
557 |
} |
|
558 |
break; |
|
559 |
case EPBInitPhase_3GADN_Type3: |
|
560 |
{ |
|
561 |
HandleType3FileResp( aFileData, aStatus ); |
|
562 |
} |
|
563 |
break; |
|
564 |
default: |
|
565 |
break; |
|
566 |
} |
|
567 |
||
568 |
if(KErrNone == ret) |
|
569 |
{ |
|
570 |
if( iIniPhase == EPBIniPhase_3GADNDone ) |
|
571 |
{ |
|
572 |
// Call Create requuest for otyher phone books |
|
573 |
// Check for FDN enabled or disabled |
|
574 |
if( iMmUiccMessHandler->GetServiceStatus(UICC_FDN_SERVICE_NUM) ) |
|
575 |
iIniPhase = EPBInitPhaseFDN; |
|
576 |
else |
|
577 |
{ |
|
578 |
// get the next Phone book available in UST OR SST Table (for 2G)table |
|
579 |
iIniPhase = GetNextAvailablePbUicc( UICC_FDN_SERVICE_NUM ); |
|
580 |
} |
|
581 |
iServiceType = UICC_APPL_FILE_INFO; |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
582 |
ret = UICCInitializeReq( aTransId ); |
0 | 583 |
} |
584 |
else |
|
585 |
{ |
|
586 |
// Call Create request for next phase |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
587 |
ret = UICCInitializeReq3GADN( aTransId ); |
0 | 588 |
} |
589 |
} |
|
590 |
||
591 |
return ret; |
|
592 |
} |
|
593 |
||
594 |
||
595 |
// ----------------------------------------------------------------------------- |
|
596 |
// CmmPhonebookOperationInit::FetchType1FileFromPBR |
|
597 |
// Fetch Type 1 File ID data and store that data in iType1FileArray |
|
598 |
// ----------------------------------------------------------------------------- |
|
599 |
// |
|
600 |
TInt CMmPhoneBookOperationInit3G_adn::FetchType1FileFromPBR( const TDesC8 &aFileData ) |
|
601 |
{ |
|
602 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::FetchType1FileFromPBR" ); |
|
603 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_FETCHTYPE1FILEFROMPBR, "CMmPhoneBookOperationInit3G_adn::FetchType1FileFromPBR" ); |
|
604 |
||
605 |
TInt ret( KErrNone ); |
|
606 |
TPrimitiveTag primTag; |
|
607 |
||
608 |
// Get the type 1 file Tag offset |
|
609 |
TInt offset = aFileData.Find( &KTagConstructedTagA8, 1 ); |
|
610 |
||
611 |
// Get the Type 1 File Tag Length |
|
612 |
TUint8 aTagLength = aFileData[offset + 1]; |
|
613 |
||
614 |
// Offset+2 to get offset for first File tag |
|
615 |
offset = offset+2; |
|
616 |
||
617 |
// Store Type 1 file data in iType1FileArray array |
|
618 |
for( TInt i = 0; i < aTagLength; ) |
|
619 |
{ |
|
620 |
// Get the Tag name |
|
621 |
primTag.tagValue = aFileData[offset + i]; |
|
622 |
||
623 |
// get the File ID which is 2byte long |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
624 |
primTag.tagFID = CMmStaticUtility::Get16Bit( aFileData, ( offset+i+2 )); |
0 | 625 |
|
626 |
// if file Tag length is 3 the SFI is available and if file tag length is 2 the only File ID is present |
|
627 |
if(KLengthWithSFI == aFileData[offset + i+1]) |
|
628 |
{ |
|
629 |
primTag.tagSFI = aFileData[offset+i+4]; |
|
630 |
// get the offset for next file tag |
|
631 |
i = i+5; |
|
632 |
} |
|
633 |
else if(KLengthWithOutSFI == aFileData[offset+i+1]) |
|
634 |
{ |
|
635 |
primTag.tagSFI = 0; |
|
636 |
// get the offset for next file tag |
|
637 |
i = i+4; |
|
638 |
} |
|
639 |
else |
|
640 |
{ |
|
641 |
ret = KErrGeneral; |
|
642 |
break; |
|
643 |
} |
|
644 |
iType1FileArray.Append( primTag ); |
|
645 |
} |
|
646 |
return ret; |
|
647 |
} |
|
648 |
||
649 |
||
650 |
||
651 |
// ----------------------------------------------------------------------------- |
|
652 |
// CmmPhonebookOperationInit::FetchType2FileFromPBR |
|
653 |
// Fetch Type 2 File ID data and store that data in iType2FileArray |
|
654 |
// ----------------------------------------------------------------------------- |
|
655 |
// |
|
656 |
TInt CMmPhoneBookOperationInit3G_adn::FetchType2FileFromPBR(const TDesC8 &aFileData) |
|
657 |
{ |
|
658 |
TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::FetchType2FileFromPBR"); |
|
659 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_FETCHTYPE2FILEFROMPBR, "CMmPhoneBookOperationInit3G_adn::FetchType2FileFromPBR" ); |
|
660 |
||
661 |
||
662 |
TInt ret( KErrNone ); |
|
663 |
TPrimitiveTag primTag; |
|
664 |
||
665 |
// Get the type 1 file Tag offset |
|
666 |
TInt offset = aFileData.Find( &KTagConstructedTagA9,1 ); |
|
667 |
// Get the Type 1 File Tag Length |
|
668 |
TUint8 aTagLength = aFileData[offset+1]; |
|
669 |
||
670 |
offset = offset + 2; |
|
671 |
||
672 |
// Store Type 1 file data in iType1FileArray array |
|
673 |
for( TInt i = 0; i < aTagLength; ) |
|
674 |
{ |
|
675 |
// Get the Tag name |
|
676 |
primTag.tagValue = aFileData[offset+i]; |
|
677 |
// get the File ID which is 2byte long |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
678 |
primTag.tagFID = CMmStaticUtility::Get16Bit( aFileData, ( offset+i+2 )); |
0 | 679 |
|
680 |
// if file Tag length is 3 the SFI is available and if file tag length is 2 the only File ID is present |
|
681 |
if(KLengthWithSFI == aFileData[offset+i+1]) |
|
682 |
{ |
|
683 |
primTag.tagSFI = aFileData[offset+i+4]; |
|
684 |
// get the offset for next file tag |
|
685 |
i = i+5; |
|
686 |
} |
|
687 |
else if(KLengthWithOutSFI == aFileData[offset+i+1]) |
|
688 |
{ |
|
689 |
primTag.tagSFI = 0; |
|
690 |
// get the offset for next file tag |
|
691 |
i = i+4; |
|
692 |
} |
|
693 |
else |
|
694 |
{ |
|
695 |
ret = KErrGeneral; |
|
696 |
break; |
|
697 |
} |
|
698 |
iType2FileArray.Append( primTag ); |
|
699 |
} |
|
700 |
return ret; |
|
701 |
} |
|
702 |
||
703 |
||
704 |
||
705 |
// ----------------------------------------------------------------------------- |
|
706 |
// CmmPhonebookOperationInit::FetchType3FileFromPBR |
|
707 |
// Fetch Type 3 File ID data and store that data in iType3FileArray |
|
708 |
// ----------------------------------------------------------------------------- |
|
709 |
// |
|
710 |
TInt CMmPhoneBookOperationInit3G_adn::FetchType3FileFromPBR(const TDesC8& aFileData) |
|
711 |
{ |
|
712 |
TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::FetchType3FileFromPBR"); |
|
713 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_FETCHTYPE3FILEFROMPBR, "CMmPhoneBookOperationInit3G_adn::FetchType3FileFromPBR" ); |
|
714 |
||
715 |
TInt ret( KErrNone ); |
|
716 |
TPrimitiveTag primTag; |
|
717 |
||
718 |
// Get the type 1 file Tag offset |
|
719 |
TInt offset = aFileData.Find( &KTagConstructedTagAA,1 ); |
|
720 |
||
721 |
// Get the Type 1 File Tag Length |
|
722 |
TUint8 aTagLength = aFileData[offset+1]; |
|
723 |
||
724 |
// To get the offset fot first File tag value |
|
725 |
offset = offset + 2; |
|
726 |
||
727 |
// Store Type 1 file data in iType1FileArray array |
|
728 |
for( TInt i=0; i < aTagLength; ) |
|
729 |
{ |
|
730 |
// Get the Tag name |
|
731 |
primTag.tagValue = aFileData[offset+i]; |
|
732 |
||
733 |
// get the File ID which is 2byte long |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
734 |
primTag.tagFID = CMmStaticUtility::Get16Bit( aFileData, |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
735 |
( offset + i + 2 )); |
0 | 736 |
|
737 |
// if file Tag length is 3 the SFI is available and if file tag length is 2 the only File ID is present |
|
738 |
if(KLengthWithSFI == aFileData[offset+i+1]) |
|
739 |
{ |
|
740 |
primTag.tagSFI = aFileData[offset+i+4]; |
|
741 |
i = i+5; |
|
742 |
} |
|
743 |
else if(KLengthWithOutSFI == aFileData[offset+i+1]) |
|
744 |
{ |
|
745 |
primTag.tagSFI = 0; |
|
746 |
i = i+4; |
|
747 |
} |
|
748 |
else |
|
749 |
{ |
|
750 |
ret = KErrGeneral; |
|
751 |
break; |
|
752 |
} |
|
753 |
iType3FileArray.Append( primTag ); |
|
754 |
} |
|
755 |
return ret; |
|
756 |
||
757 |
} |
|
758 |
||
759 |
||
760 |
||
761 |
// ----------------------------------------------------------------------------- |
|
762 |
// CmmPhonebookOperationInit::HandleType1FileResp |
|
763 |
// HAndles Data for type 1 File response |
|
764 |
// ----------------------------------------------------------------------------- |
|
765 |
// |
|
766 |
||
767 |
||
768 |
void CMmPhoneBookOperationInit3G_adn::HandleType1FileResp( const TDesC8 &aFileData, TInt aStatus ) |
|
769 |
{ |
|
770 |
TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::HandleType1FileResp"); |
|
771 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_HANDLETYPE1FILERESP, "CMmPhoneBookOperationInit3G_adn::HandleType1FileResp" ); |
|
772 |
||
773 |
TInt ret( KErrNone ); |
|
774 |
TInt recordLength( 0 ); |
|
775 |
TInt noOfRecords(0); |
|
776 |
||
777 |
// Get the Tag Value from Type1 File Array |
|
778 |
TUint8 tagValue = iType1FileArray[iCurrentArrayCounter].tagValue; |
|
779 |
||
780 |
if( UICC_STATUS_OK == aStatus ) |
|
781 |
{ |
|
782 |
// Get the Record length for all linear fixed and circular EF's |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
783 |
TFci fci( aFileData ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
784 |
recordLength = fci.GetRecordLength(); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
785 |
noOfRecords = fci.GetNumberOfRecords(); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
786 |
|
0 | 787 |
// Check for No of records in Type 1 file |
788 |
if( UICC_EF_ADN_TAG != tagValue ) |
|
789 |
{ |
|
790 |
ret = CheckForNoOfRecords( noOfRecords ); |
|
791 |
} |
|
792 |
} |
|
793 |
||
794 |
||
795 |
if( iCurrentArrayCounter < iType1FileArray.Count() ) |
|
796 |
{ |
|
797 |
if( UICC_STATUS_OK == aStatus ) |
|
798 |
{ |
|
799 |
switch( tagValue ) |
|
800 |
{ |
|
801 |
case UICC_EF_ADN_TAG: |
|
802 |
{ |
|
803 |
// get total no of entries in all PBR records |
|
804 |
iPBStoreInfoData->iADNNumOfEntries = noOfRecords* iNumOfPBRRecords; |
|
805 |
||
806 |
iPBStoreInfoData->iADNTextLengthMax = ( recordLength - 14 ); |
|
807 |
||
808 |
// To get the total length of number, need to read Ext1 file |
|
809 |
iPBStoreInfoData->iADNNumberLengthMax = UICC_NO_EXT_MAX_NUM_LEN; |
|
810 |
iADNPbInitilized = ETrue; |
|
811 |
} |
|
812 |
break; |
|
813 |
case UICC_EF_ANR_TAG: |
|
814 |
{ |
|
815 |
// Check for if No of records for this File is same as ADN phonebook no of records |
|
816 |
if(KErrNone == ret) |
|
817 |
{ |
|
818 |
// Check for fixed size record length |
|
819 |
ret = CheckRecordSizeForFixedLength( 1, UICC_EF_ANR_TAG,recordLength ); |
|
820 |
if( KErrNone == ret ) |
|
821 |
{ |
|
822 |
// total no of entries in all ANR files |
|
823 |
iPBStoreInfoData->iANRNumOfEntries = ( noOfRecords* iNumOfPBRRecords ); |
|
824 |
// For this need to know about the ext files |
|
825 |
iPBStoreInfoData->iANRNumLengthMax = UICC_NO_EXT_MAX_NUM_LEN; |
|
826 |
// No of entries in every EF |
|
827 |
iPBStoreInfoData->iANRNumOfEntriesPerEntry = noOfRecords; |
|
828 |
// no ot ANR file per ADN phonebook |
|
829 |
iType1ANRFiles++; |
|
830 |
} |
|
831 |
} |
|
832 |
} |
|
833 |
break; |
|
834 |
case UICC_EF_EMAIL_TAG: |
|
835 |
{ |
|
836 |
if(KErrNone == ret) |
|
837 |
{ |
|
838 |
// get the total no of records in Email EF |
|
839 |
iPBStoreInfoData->iEmailNumOfEntries = ( noOfRecords* iNumOfPBRRecords ); |
|
840 |
||
841 |
// get record Length from filedata, In Type1 file case email text length will be same as record length |
|
842 |
iPBStoreInfoData->iEmailTextLengthMax = recordLength; |
|
843 |
||
844 |
iPBStoreInfoData->iEmailNumOfEntriesPerEntry = noOfRecords; |
|
845 |
||
846 |
// no of type1 email files per ADN Phonebook |
|
847 |
iType1EmailFiles++; |
|
848 |
} |
|
849 |
} |
|
850 |
break; |
|
851 |
case UICC_EF_GRP_TAG: |
|
852 |
{ |
|
853 |
if(KErrNone == ret) |
|
854 |
{ |
|
855 |
// get the record record no from file info data |
|
856 |
iPBStoreInfoData->iGRPNumOfEntriesPerEntry = noOfRecords; |
|
857 |
} |
|
858 |
} |
|
859 |
break; |
|
860 |
case UICC_EF_IAP_TAG: |
|
861 |
{ |
|
862 |
// This File is mandatory only when there are Type 2 Files |
|
863 |
if( iType2FileArray.Count()== 0 ) |
|
864 |
ret = KErrGeneral; |
|
865 |
} |
|
866 |
break; |
|
867 |
case UICC_EF_PBC_TAG: |
|
868 |
{ |
|
869 |
if( KErrNone == ret ) |
|
870 |
{ |
|
871 |
if( KErrNone != CheckRecordSizeForFixedLength(1, UICC_EF_PBC_TAG,recordLength) ) |
|
872 |
{ |
|
873 |
// remove this entry from Array |
|
874 |
iType1FileArray[iCurrentArrayCounter].tagFID = 0x00; |
|
875 |
iType1FileArray[iCurrentArrayCounter].tagSFI = 0x00; |
|
876 |
iType1FileArray[iCurrentArrayCounter].tagValue = 0x00; |
|
877 |
} |
|
878 |
} |
|
879 |
} |
|
880 |
break; |
|
881 |
case UICC_EF_SNE_TAG: |
|
882 |
{ |
|
883 |
if( KErrNone == ret ) |
|
884 |
{ |
|
885 |
iPBStoreInfoData->iSNENumOfEntries = noOfRecords * iNumOfPBRRecords; |
|
886 |
iPBStoreInfoData->iSNENumOfEntriesPerEntry = noOfRecords; |
|
887 |
iPBStoreInfoData->iSNETextLengthMax = recordLength; |
|
888 |
// Get the no of Type 1 SNE Files per ADN phonebook |
|
889 |
iType1SNEFiles++; |
|
890 |
} |
|
891 |
} |
|
892 |
break; |
|
893 |
case UICC_EF_UID_TAG: |
|
894 |
break; |
|
895 |
default: |
|
896 |
break; |
|
897 |
} |
|
898 |
||
899 |
// Check if error is there then remove that file ID and tag from iType1FileArray |
|
900 |
if( KErrNone != ret ) |
|
901 |
{ |
|
902 |
iType1FileArray.Remove(iCurrentArrayCounter); |
|
903 |
} |
|
904 |
else |
|
905 |
{ |
|
906 |
iCurrentArrayCounter++; |
|
907 |
} |
|
908 |
} |
|
909 |
else |
|
910 |
{ |
|
911 |
// Check if the fail is for EF adn then phonebook is not valid |
|
912 |
if( UICC_EF_ADN_TAG == tagValue) |
|
913 |
{ |
|
914 |
iADNPbInitilized = EFalse; |
|
915 |
// ADN phonebook is not valid and check for other phonebooks parameters |
|
916 |
iIniPhase = EPBIniPhase_3GADNDone; |
|
917 |
return; |
|
918 |
} |
|
919 |
iCurrentArrayCounter++; |
|
920 |
} |
|
921 |
||
922 |
||
923 |
// Check for next Phase |
|
924 |
if( iCurrentArrayCounter == iType1FileArray.Count() ) |
|
925 |
{ |
|
926 |
iCurrentArrayCounter = 0; |
|
927 |
||
928 |
// Change Phase to read other Files |
|
929 |
if( 0 != iType2FileArray.Count() ) |
|
930 |
iIniPhase = EPBInitPhase_3GADN_Type2; |
|
931 |
||
932 |
if( 0 != iType3FileArray.Count() ) |
|
933 |
iIniPhase = EPBInitPhase_3GADN_Type3; |
|
934 |
else |
|
935 |
iIniPhase = EPBIniPhase_3GADNDone; |
|
936 |
} |
|
937 |
} // End of Type 1 file array handling |
|
938 |
} |
|
939 |
||
940 |
||
941 |
// ----------------------------------------------------------------------------- |
|
942 |
// CmmPhonebookOperationInit::HandleType2FileResp |
|
943 |
// HAndles Data for Type 2 file Response |
|
944 |
// ----------------------------------------------------------------------------- |
|
945 |
// |
|
946 |
||
947 |
||
948 |
void CMmPhoneBookOperationInit3G_adn::HandleType2FileResp(const TDesC8 &aFileData, TInt aStatus) |
|
949 |
{ |
|
950 |
TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::HandleType2FileResp"); |
|
951 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_HANDLETYPE2FILERESP, "CMmPhoneBookOperationInit3G_adn::HandleType2FileResp" ); |
|
952 |
||
953 |
TInt ret(KErrNone); |
|
954 |
TInt recordLength( 0 ); |
|
955 |
TInt noOfRecords(0); |
|
956 |
||
957 |
if( UICC_STATUS_OK == aStatus ) |
|
958 |
{ |
|
959 |
// Get the Record length for all linear fixed and circular EF's |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
960 |
TFci fci( aFileData ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
961 |
recordLength = fci.GetRecordLength(); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
962 |
noOfRecords = fci.GetNumberOfRecords(); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
963 |
} |
0 | 964 |
|
965 |
// Get the tag value for current File |
|
966 |
TUint tagValue = iType2FileArray[iCurrentArrayCounter].tagValue; |
|
967 |
||
968 |
if( iCurrentArrayCounter < iType2FileArray.Count() ) |
|
969 |
{ |
|
970 |
if( UICC_STATUS_OK == aStatus ) |
|
971 |
{ |
|
972 |
switch(tagValue) |
|
973 |
{ |
|
974 |
case UICC_EF_ANR_TAG: |
|
975 |
{ |
|
976 |
ret = CheckRecordSizeForFixedLength( 2, UICC_EF_PBC_TAG,recordLength ); |
|
977 |
||
978 |
if(KErrNone == ret) |
|
979 |
{ |
|
980 |
// total no of entries in all ANR files |
|
981 |
iPBStoreInfoData->iANRNumOfEntries = noOfRecords* iNumOfPBRRecords; |
|
982 |
// For this need to know about the ext files |
|
983 |
iPBStoreInfoData->iANRNumLengthMax = UICC_NO_EXT_MAX_NUM_LEN; |
|
984 |
// No of entries in every EF |
|
985 |
iPBStoreInfoData->iANRNumOfEntriesPerEntry = noOfRecords; |
|
986 |
// no of ANR Files type2 per ADN phonebook |
|
987 |
iType2ANRFiles++; |
|
988 |
} |
|
989 |
} |
|
990 |
break; |
|
991 |
case UICC_EF_EMAIL_TAG: |
|
992 |
{ |
|
993 |
// get the total no of entries in all EF in PBR Files |
|
994 |
iPBStoreInfoData->iEmailNumOfEntries = noOfRecords * iNumOfPBRRecords; |
|
995 |
// get no of entries per Email EF |
|
996 |
iPBStoreInfoData->iEmailNumOfEntriesPerEntry = noOfRecords; |
|
997 |
||
998 |
// get record Length from filedata, In Type2 and type3 files case email text length will be 2 less than record length |
|
999 |
iPBStoreInfoData->iEmailTextLengthMax = recordLength - 2; |
|
1000 |
||
1001 |
// get the no of type2 email files in every ADN Phonebook |
|
1002 |
iType2EmailFiles++; |
|
1003 |
} |
|
1004 |
break; |
|
1005 |
case UICC_EF_SNE_TAG: |
|
1006 |
{ |
|
1007 |
iPBStoreInfoData->iSNENumOfEntries = noOfRecords * iNumOfPBRRecords; |
|
1008 |
iPBStoreInfoData->iSNENumOfEntriesPerEntry = noOfRecords; |
|
1009 |
||
1010 |
// get record Length from filedata, In Type2 and type 3 file case SNE text length will be 2 less than record length |
|
1011 |
iPBStoreInfoData->iSNETextLengthMax = recordLength - 2; |
|
1012 |
||
1013 |
// Get the no of Type 2 SNE Files per ADN phonebook |
|
1014 |
iType2SNEFiles++; |
|
1015 |
} |
|
1016 |
break; |
|
1017 |
default: |
|
1018 |
break; |
|
1019 |
} |
|
1020 |
if(KErrNone != ret) |
|
1021 |
{ |
|
1022 |
iType2FileArray.Remove(iCurrentArrayCounter); |
|
1023 |
} |
|
1024 |
else |
|
1025 |
{ |
|
1026 |
iCurrentArrayCounter++; |
|
1027 |
} |
|
1028 |
} |
|
1029 |
else |
|
1030 |
{ |
|
1031 |
iCurrentArrayCounter++; |
|
1032 |
} |
|
1033 |
||
1034 |
// Check for next Phase |
|
1035 |
if( iCurrentArrayCounter == iType2FileArray.Count() ) |
|
1036 |
{ |
|
1037 |
iCurrentArrayCounter = 0; |
|
1038 |
if( 0 != iType3FileArray.Count() ) |
|
1039 |
iIniPhase = EPBInitPhase_3GADN_Type3; |
|
1040 |
else |
|
1041 |
iIniPhase = EPBIniPhase_3GADNDone; |
|
1042 |
} |
|
1043 |
} |
|
1044 |
||
1045 |
} |
|
1046 |
||
1047 |
||
1048 |
// ----------------------------------------------------------------------------- |
|
1049 |
// CmmPhonebookOperationInit::HandleType3FileResp |
|
1050 |
// HAndles Data received for Type 3 file request |
|
1051 |
// ----------------------------------------------------------------------------- |
|
1052 |
// |
|
1053 |
||
1054 |
||
1055 |
void CMmPhoneBookOperationInit3G_adn::HandleType3FileResp(const TDesC8 &aFileData, TInt aStatus) |
|
1056 |
{ |
|
1057 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::HandleType3FileResp" ); |
|
1058 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_HANDLETYPE3FILERESP, "CMmPhoneBookOperationInit3G_adn::HandleType3FileResp" ); |
|
1059 |
||
1060 |
||
1061 |
TInt ret( KErrNone ); |
|
1062 |
TInt recordLength( 0 ); |
|
1063 |
TInt noOfRecords(0); |
|
1064 |
||
1065 |
||
1066 |
if( UICC_STATUS_OK == aStatus ) |
|
1067 |
{ |
|
5
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1068 |
TFci fci( aFileData ); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1069 |
recordLength = fci.GetRecordLength(); |
8ccc39f9d787
New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents:
0
diff
changeset
|
1070 |
noOfRecords = fci.GetNumberOfRecords(); |
0 | 1071 |
} |
1072 |
||
1073 |
// Get the tag value for current File |
|
1074 |
TUint tagValue ( iType3FileArray[iCurrentArrayCounter].tagValue ); |
|
1075 |
||
1076 |
if( iCurrentArrayCounter < iType3FileArray.Count() ) |
|
1077 |
{ |
|
1078 |
if( UICC_STATUS_OK == aStatus ) |
|
1079 |
{ |
|
1080 |
switch( tagValue ) |
|
1081 |
{ |
|
1082 |
case UICC_EF_AAS_TAG: |
|
1083 |
break; |
|
1084 |
case UICC_EF_EXT1_TAG: |
|
1085 |
{ |
|
1086 |
// Check for Fixed record length |
|
1087 |
ret = CheckRecordSizeForFixedLength( 3, UICC_EF_EXT1_TAG,recordLength ); |
|
1088 |
||
1089 |
// check for Error if Length doesn'nt match |
|
1090 |
if( KErrNone == ret ) |
|
1091 |
{ |
|
1092 |
// Get the file file length for extension data only (remove record type and Identifier 2 bytes) |
|
1093 |
TInt fileLength ( ( recordLength - 2 ) * noOfRecords ); |
|
1094 |
iPBStoreInfoData->iADNNumberLengthMax = UICC_NO_EXT_MAX_NUM_LEN+(2*fileLength); |
|
1095 |
||
1096 |
// Check file is not invalid |
|
1097 |
if( UICC_NO_EXT_MAX_NUM_LEN == iPBStoreInfoData->iANRNumLengthMax ) |
|
1098 |
{ |
|
1099 |
iPBStoreInfoData->iANRNumLengthMax = UICC_NO_EXT_MAX_NUM_LEN+(2*fileLength); |
|
1100 |
} |
|
1101 |
} |
|
1102 |
break; |
|
1103 |
} |
|
1104 |
case UICC_EF_GAS_TAG: |
|
1105 |
break; |
|
1106 |
case UICC_EF_CCP1_TAG: |
|
1107 |
break; |
|
1108 |
default: |
|
1109 |
break; |
|
1110 |
} |
|
1111 |
} |
|
1112 |
||
1113 |
||
1114 |
if( KErrNone != ret ) |
|
1115 |
{ |
|
1116 |
// remove from teh Array |
|
1117 |
iType3FileArray.Remove(iCurrentArrayCounter); |
|
1118 |
} |
|
1119 |
else |
|
1120 |
{ |
|
1121 |
iCurrentArrayCounter++; |
|
1122 |
} |
|
1123 |
||
1124 |
// Check for next Phase |
|
1125 |
if( iCurrentArrayCounter == iType3FileArray.Count() ) |
|
1126 |
{ |
|
1127 |
iCurrentArrayCounter = 0; |
|
1128 |
iIniPhase = EPBIniPhase_3GADNDone; |
|
1129 |
} |
|
1130 |
} |
|
1131 |
} |
|
1132 |
||
1133 |
||
1134 |
||
1135 |
||
1136 |
// ----------------------------------------------------------------------------- |
|
1137 |
// CmmPhonebookOperationInit::CheckForFileId |
|
1138 |
// Check for no any 2 file id scould be same in any type 1, Type2 and tyoe3 files |
|
1139 |
// ----------------------------------------------------------------------------- |
|
1140 |
// |
|
1141 |
||
1142 |
TInt CMmPhoneBookOperationInit3G_adn::CheckForFileId() |
|
1143 |
{ |
|
1144 |
TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::CheckForFileId"); |
|
1145 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_CHECKFORFILEID, "CMmPhoneBookOperationInit3G_adn::CheckForFileId" ); |
|
1146 |
||
1147 |
||
1148 |
TInt ret( KErrNone ); |
|
1149 |
||
1150 |
// Check for Type1 File Id's with all Type1 , Type2 and Type3 file Id's |
|
1151 |
for( TInt j=0; j< iType1FileArray.Count(); j++ ) |
|
1152 |
{ |
|
1153 |
// Check for Type 1 files |
|
1154 |
for( TInt i = (j+1); i< (iType1FileArray.Count()-j); i++ ) |
|
1155 |
{ |
|
1156 |
if( iType1FileArray[i].tagFID == iType1FileArray[j].tagFID ) |
|
1157 |
{ |
|
1158 |
// Check if it is a ADN EF then it will be a failure case |
|
1159 |
if( iType1FileArray[i].tagValue == UICC_ADN_PRIM_TAG ) |
|
1160 |
ret = KErrGeneral; |
|
1161 |
else |
|
1162 |
{ |
|
1163 |
// remove Entry |
|
1164 |
iType1FileArray.Remove(i); |
|
1165 |
iType1FileArray.Remove(j); |
|
1166 |
} |
|
1167 |
} |
|
1168 |
} |
|
1169 |
// Check for Type2 file id's |
|
1170 |
for(TInt i=0; i<iType2FileArray.Count(); i++) |
|
1171 |
{ |
|
1172 |
if( iType2FileArray[i].tagFID == iType1FileArray[j].tagFID ) |
|
1173 |
{ |
|
1174 |
// Check for ADN file |
|
1175 |
if( iType1FileArray[j].tagValue == UICC_ADN_PRIM_TAG ) |
|
1176 |
ret = KErrGeneral; |
|
1177 |
else |
|
1178 |
{ |
|
1179 |
// remove thise Entries |
|
1180 |
iType1FileArray.Remove(j); |
|
1181 |
iType2FileArray.Remove(i); |
|
1182 |
} |
|
1183 |
} |
|
1184 |
} |
|
1185 |
// Check for Type 3 File Id's |
|
1186 |
for( TInt i=0; i<iType3FileArray.Count(); i++ ) |
|
1187 |
{ |
|
1188 |
if( iType3FileArray[i].tagFID == iType1FileArray[j].tagFID ) |
|
1189 |
// Check for ADN file |
|
1190 |
if( iType1FileArray[j].tagValue == UICC_ADN_PRIM_TAG ) |
|
1191 |
ret = KErrGeneral; |
|
1192 |
else |
|
1193 |
{ |
|
1194 |
// remove those entries |
|
1195 |
iType1FileArray.Remove(j); |
|
1196 |
iType3FileArray.Remove(i); |
|
1197 |
} |
|
1198 |
} |
|
1199 |
} |
|
1200 |
||
1201 |
// Check for Type2 File Id's with all Type2 and Type3 file Id's |
|
1202 |
for( TInt j=0; j< iType2FileArray.Count(); j++ ) |
|
1203 |
{ |
|
1204 |
// Check for Type 2 files |
|
1205 |
for( TInt i = (j+1); i< ( iType2FileArray.Count()-j ); i++ ) |
|
1206 |
{ |
|
1207 |
if( iType2FileArray[i].tagFID == iType2FileArray[j].tagFID) |
|
1208 |
{ |
|
1209 |
iType2FileArray.Remove(j); |
|
1210 |
iType2FileArray.Remove(i); |
|
1211 |
} |
|
1212 |
} |
|
1213 |
// Check for Type 3 File Id's |
|
1214 |
for( TInt i=0; i<iType3FileArray.Count(); i++ ) |
|
1215 |
{ |
|
1216 |
if( iType3FileArray[i].tagFID == iType2FileArray[j].tagFID ) |
|
1217 |
{ |
|
1218 |
iType2FileArray.Remove(j); |
|
1219 |
iType3FileArray.Remove(i); |
|
1220 |
} |
|
1221 |
} |
|
1222 |
} |
|
1223 |
||
1224 |
//Check for Type3 File Id's with all other Type3 file Id's |
|
1225 |
||
1226 |
for( TInt j=0; j< iType3FileArray.Count(); j++ ) |
|
1227 |
{ |
|
1228 |
// Check for Type 2 files |
|
1229 |
for( TInt i = (j+1); i< (iType3FileArray.Count()-j); i++ ) |
|
1230 |
{ |
|
1231 |
if( iType3FileArray[i].tagFID == iType3FileArray[j].tagFID ) |
|
1232 |
{ |
|
1233 |
iType3FileArray.Remove(j); |
|
1234 |
iType3FileArray.Remove(i); |
|
1235 |
||
1236 |
} |
|
1237 |
} |
|
1238 |
} |
|
1239 |
||
1240 |
return ret; |
|
1241 |
} |
|
1242 |
||
1243 |
// ----------------------------------------------------------------------------- |
|
1244 |
// CmmPhonebookOperationInit::CheckForNoOfRecords |
|
1245 |
// check for no of record for type1 file should be same as ADN file |
|
1246 |
// ----------------------------------------------------------------------------- |
|
1247 |
// |
|
1248 |
||
1249 |
TInt CMmPhoneBookOperationInit3G_adn::CheckForNoOfRecords( TInt aNoOfRecord ) |
|
1250 |
{ |
|
1251 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::CheckForNoOfRecords" ); |
|
1252 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_CHECKFORNOOFRECORDS, "CMmPhoneBookOperationInit3G_adn::CheckForNoOfRecords" ); |
|
1253 |
||
1254 |
||
1255 |
TInt ret( KErrNone ); |
|
1256 |
||
1257 |
if( iPBStoreInfoData->iADNNumOfEntries != aNoOfRecord ) |
|
1258 |
ret = KErrGeneral; |
|
1259 |
return ret; |
|
1260 |
} |
|
1261 |
||
1262 |
||
1263 |
// ----------------------------------------------------------------------------- |
|
1264 |
// CmmPhonebookOperationInit::CheckForSameType1AndType2Files |
|
1265 |
// Check for no any type 1 file should be type define in PBR file |
|
1266 |
// ----------------------------------------------------------------------------- |
|
1267 |
// |
|
1268 |
||
1269 |
TInt CMmPhoneBookOperationInit3G_adn::CheckForSameType1AndType2Files() |
|
1270 |
{ |
|
1271 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::CheckForSameType1AndType2Files" ); |
|
1272 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_CHECKFORSAMETYPE1ANDTYPE2FILES, "CMmPhoneBookOperationInit3G_adn::CheckForSameType1AndType2Files" ); |
|
1273 |
||
1274 |
TInt ret( KErrNone ); |
|
1275 |
||
1276 |
// Check for No any File can be both Type1 and Type2 |
|
1277 |
||
1278 |
for( TInt i=0; i<iType1FileArray.Count();i++ ) |
|
1279 |
{ |
|
1280 |
for( TInt j=0; j<iType2FileArray.Count(); j++ ) |
|
1281 |
{ |
|
1282 |
if( iType2FileArray[j].tagValue == iType1FileArray[i].tagValue ) |
|
1283 |
{ |
|
1284 |
// Check for if it is ADN File |
|
1285 |
if( iType1FileArray[i].tagValue == UICC_ADN_PRIM_TAG ) |
|
1286 |
ret = KErrGeneral; |
|
1287 |
else |
|
1288 |
{ |
|
1289 |
iType1FileArray.Remove(i); |
|
1290 |
iType2FileArray.Remove(j); |
|
1291 |
} |
|
1292 |
} |
|
1293 |
} |
|
1294 |
} |
|
1295 |
return ret; |
|
1296 |
} |
|
1297 |
||
1298 |
||
1299 |
||
1300 |
// ----------------------------------------------------------------------------- |
|
1301 |
// CmmPhonebookOperationInit::CheckRecordSizeForFixedLength |
|
1302 |
//Check for if Fixed length file correct or not |
|
1303 |
// ----------------------------------------------------------------------------- |
|
1304 |
// |
|
1305 |
||
1306 |
TInt CMmPhoneBookOperationInit3G_adn::CheckRecordSizeForFixedLength( TInt aFileType, TInt aFileId, TInt aRecordLength) |
|
1307 |
{ |
|
1308 |
TFLOGSTRING( "TSY: CMmPhoneBookOperationInit3G_adn::CheckRecordSizeForFixedLength" ); |
|
1309 |
OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_CHECKRECORDSIZEFORFIXEDLENGTH, "CMmPhoneBookOperationInit3G_adn::CheckRecordSizeForFixedLength" ); |
|
1310 |
||
1311 |
TInt ret( KErrNone ); |
|
1312 |
||
1313 |
// Check for Record Size for Fixed length record size |
|
1314 |
switch( aFileId ) |
|
1315 |
{ |
|
1316 |
case UICC_EF_ANR_TAG: |
|
1317 |
{ |
|
1318 |
if(( 1 == aFileType ) && ( 15 != aRecordLength )) |
|
1319 |
ret = KErrGeneral; |
|
1320 |
else |
|
1321 |
{ |
|
1322 |
if(( 2== aFileType )&& ( 17!=aRecordLength )) |
|
1323 |
ret =KErrNone; |
|
1324 |
} |
|
1325 |
break; |
|
1326 |
} |
|
1327 |
case UICC_EF_PBC_TAG: |
|
1328 |
{ |
|
1329 |
if( 2!=aRecordLength ) |
|
1330 |
ret = KErrGeneral; |
|
1331 |
break; |
|
1332 |
} |
|
1333 |
case UICC_EF_UID_TAG: |
|
1334 |
{ |
|
1335 |
if( 2!= aRecordLength ) |
|
1336 |
ret = KErrGeneral; |
|
1337 |
break; |
|
1338 |
} |
|
1339 |
case UICC_EF_EXT1_TAG: |
|
1340 |
{ |
|
1341 |
if( 13 != aRecordLength ) |
|
1342 |
ret = KErrGeneral; |
|
1343 |
break; |
|
1344 |
} |
|
1345 |
} |
|
1346 |
return ret; |
|
1347 |
} |
|
1348 |
||
1349 |
||
1350 |