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