24
|
1 |
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// This file contains the implementation for the Simulator Phone class 'CSimPhone'
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
*/
|
|
21 |
|
|
22 |
#include <testconfigfileparser.h>
|
|
23 |
#include "CSimPhone.h"
|
|
24 |
#include "CSimCall.h"
|
|
25 |
#include "csimsmsmess.h"
|
|
26 |
#include "CSimPhBkStore.h"
|
|
27 |
#include "CSimPhBkUsimStore.h"
|
|
28 |
#include "CSimONStore.h"
|
|
29 |
#include "CSimSignalStrength.h"
|
|
30 |
#include "CSimNetworkStatus.h"
|
|
31 |
#include "CSimDtmf.h"
|
|
32 |
#include "CSimIndicator.h"
|
|
33 |
#include "utils.h"
|
|
34 |
#include "Simlog.h"
|
|
35 |
#include "CSimPacketService.h"
|
|
36 |
#include "CSimSat.h"
|
|
37 |
#include "CSimBatteryCharger.h"
|
|
38 |
#include "CSimCallBarring.h"
|
|
39 |
#include "CSimCallForwarding.h"
|
|
40 |
#include "CSimCallWaiting.h"
|
|
41 |
#include "CSimPhoneInitialise.h"
|
|
42 |
#include "CSimPhoneIMSAuth.h"
|
|
43 |
#include "CSimTsyMode.h"
|
|
44 |
#include "csimsmartcardauth.h"
|
|
45 |
#include "csimsmartcardeap.h"
|
|
46 |
|
|
47 |
#include "simtsyglobalproperties.h"
|
|
48 |
#include "et_struct.h"
|
|
49 |
|
|
50 |
|
|
51 |
#define PDD_NAME _L("ECDRV") // < Name of the WINS Serial Physical Device Driver
|
|
52 |
#define LDD_NAME _L("ECOMM") // < Name of the WINS Serial Logical Device Driver
|
|
53 |
|
|
54 |
const TInt KPhBkUSimStoreGranularity=5; // < The granularity of the phonebook store list array.
|
|
55 |
const TInt KPhonebookStoreGranularity=2; // < The granularity of the phonebook store list array.
|
|
56 |
|
|
57 |
GLDEF_C void SimPanic(TSimPanic aPanicNumber, TInt aLineNumber)
|
|
58 |
{
|
|
59 |
LOGPHONE3("SMS.TSY Panic %d Line %d", aPanicNumber, aLineNumber);
|
|
60 |
(void) aLineNumber;
|
|
61 |
_LIT(panicText,"SIM.TSY");
|
|
62 |
User::Panic(panicText,aPanicNumber);
|
|
63 |
}
|
|
64 |
|
|
65 |
//
|
|
66 |
// CSimPhone
|
|
67 |
//
|
|
68 |
void CSimPhone::CloseObj(TAny* aObj)
|
|
69 |
/**
|
|
70 |
* A utility function for cleaning up the stack.
|
|
71 |
*
|
|
72 |
* @param aObj a pointer to the CObject to close
|
|
73 |
*/
|
|
74 |
{
|
|
75 |
((CObject*)aObj)->Close();
|
|
76 |
}
|
|
77 |
|
|
78 |
CSimPhone* CSimPhone::NewL(CPhoneBase*& aPhoneBaseRef)
|
|
79 |
/**
|
|
80 |
* Standard two phase constructor.
|
|
81 |
*
|
|
82 |
* @return CSimPhone pointer to the phone object created
|
|
83 |
* @leave Leaves if no memory or object is not created for any reason
|
|
84 |
*/
|
|
85 |
{
|
|
86 |
CSimPhone* phone=new(ELeave) CSimPhone(aPhoneBaseRef);
|
|
87 |
TCleanupItem newPhoneClose(CloseObj,phone);
|
|
88 |
CleanupStack::PushL(newPhoneClose);
|
|
89 |
phone->ConstructL();
|
|
90 |
CleanupStack::Pop();
|
|
91 |
|
|
92 |
aPhoneBaseRef = phone;
|
|
93 |
|
|
94 |
return phone;
|
|
95 |
}
|
|
96 |
|
|
97 |
CSimPhone::CSimPhone(CPhoneBase*& aPhoneBaseRef)
|
|
98 |
: iPhoneBaseRef(aPhoneBaseRef),
|
|
99 |
iAPNServiceOffset(4),
|
|
100 |
iUSIMServiceTable(NULL),
|
|
101 |
iUSIMEnabledServiceTable(NULL),
|
|
102 |
iSIMServiceTable(NULL),
|
|
103 |
iModemDetection(RPhone::EDetectedPresent),
|
|
104 |
iMode(RPhone::EModeIdle),
|
|
105 |
iNtwkMode(RMobilePhone::ENetworkModeUnknown)
|
|
106 |
{
|
|
107 |
iPhoneId.iError = KErrNotSupported;
|
|
108 |
}
|
|
109 |
|
|
110 |
/**
|
|
111 |
* A utility function for reading the service tables and setting them up
|
|
112 |
*
|
|
113 |
* @param aMaxSupported size of table supported by etelmm
|
|
114 |
* @param aLookup config file reference to the table to be looked up
|
|
115 |
* @param pTable pointer to the table to be constructed for the config file table
|
|
116 |
* @return void does not return anything
|
|
117 |
*/
|
|
118 |
void CSimPhone::PopulateServiceTableL( TInt aMaxSupported,
|
|
119 |
const TDesC8& aLookup,
|
|
120 |
RMobilePhone::TMobilePhoneServiceTableV1** aTable)
|
|
121 |
{
|
|
122 |
|
|
123 |
RMobilePhone::TMobilePhoneServiceTableV1* pTable = NULL;
|
|
124 |
pTable = new(ELeave) RMobilePhone::TMobilePhoneServiceTableV1();
|
|
125 |
|
|
126 |
// USIM Supported entry's
|
|
127 |
const CTestConfigItem* item=CfgFile()->Item(aLookup);
|
|
128 |
if (item)
|
|
129 |
{
|
|
130 |
TInt count = CTestConfig::CountElements(item->Value(),KStdDelimiter);
|
|
131 |
for (TInt i= 0; i< count; i++)
|
|
132 |
{
|
|
133 |
TInt entry = 0;
|
|
134 |
TUint8* pTableEntry = &(pTable->iServices1To8);
|
|
135 |
|
|
136 |
TInt ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,entry);
|
|
137 |
if(ret == KErrNone && entry < (aMaxSupported+1)) // This is the maximum supported services by etelmm.h
|
|
138 |
{
|
|
139 |
TUint8 basic = 0x01;
|
|
140 |
pTableEntry += ((entry-1)/8);
|
|
141 |
*pTableEntry |= (basic << ((entry-1)%8));
|
|
142 |
}
|
|
143 |
}
|
|
144 |
*aTable = pTable;
|
|
145 |
LOGPHONE2("Successfully populated %s table in simtsy", &aLookup);
|
|
146 |
}
|
|
147 |
else
|
|
148 |
{
|
|
149 |
delete(pTable);
|
|
150 |
pTable = NULL;
|
|
151 |
LOGPHONE2("Failed to populat %s table in simtsy", &aLookup);
|
|
152 |
}
|
|
153 |
}
|
|
154 |
|
|
155 |
/**
|
|
156 |
* A utility function for reading the USIM V8 service tables and setting them up
|
|
157 |
*
|
|
158 |
* @param aTableV8 pointer to the table to be constructed for the config file table
|
|
159 |
* @param aLookup config file reference to the table to be looked up
|
|
160 |
* @return void does not return anything
|
|
161 |
*/
|
|
162 |
void CSimPhone::PopulateServiceTableV8L(const TDesC8& aLookup,RMobilePhone::TMobilePhoneServiceTableV8** aTableV8)
|
|
163 |
{
|
|
164 |
|
|
165 |
RMobilePhone::TMobilePhoneServiceTableV8* pTable = NULL;
|
|
166 |
pTable = new(ELeave) RMobilePhone::TMobilePhoneServiceTableV8();
|
|
167 |
|
|
168 |
TInt aMaxSupportedV1 = 56;
|
|
169 |
TInt aMaxSupportedV8 = 72;
|
|
170 |
// USIM Supported entry's for V8
|
|
171 |
|
|
172 |
const CTestConfigItem* item=CfgFile()->Item(aLookup);
|
|
173 |
if (item)
|
|
174 |
{
|
|
175 |
TInt count = CTestConfig::CountElements(item->Value(),KStdDelimiter);
|
|
176 |
for (TInt i= 0; i< count; i++)
|
|
177 |
{
|
|
178 |
TInt entry = 0;
|
|
179 |
TUint8* pTableEntry = &(pTable->iServices57To64);
|
|
180 |
|
|
181 |
TInt ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,entry);
|
|
182 |
if(ret == KErrNone && entry > (aMaxSupportedV1) && entry < (aMaxSupportedV8 +1)) // This is the maximum supported services by etelmm.h
|
|
183 |
{
|
|
184 |
entry -= aMaxSupportedV1;
|
|
185 |
TUint8 basic = 0x01;
|
|
186 |
pTableEntry += ((entry-1)/8);
|
|
187 |
*pTableEntry |= (basic << ((entry-1)%8));
|
|
188 |
}
|
|
189 |
}
|
|
190 |
*aTableV8 = pTable;
|
|
191 |
LOGPHONE2("Successfully populated %s table in simtsy", &aLookup);
|
|
192 |
}
|
|
193 |
else
|
|
194 |
{
|
|
195 |
delete(pTable);
|
|
196 |
pTable = NULL;
|
|
197 |
LOGPHONE2("Failed to populate %s table in simtsy", &aLookup);
|
|
198 |
}
|
|
199 |
}
|
|
200 |
|
|
201 |
|
|
202 |
|
|
203 |
void CSimPhone::SetTestNumberAndReadConfigurationFileL()
|
|
204 |
{
|
|
205 |
TInt testNumber;
|
|
206 |
User::LeaveIfError(GetTestNumber(testNumber));
|
|
207 |
iSectionName.Format(KSectionNameFormat,testNumber);
|
|
208 |
|
|
209 |
delete iConfigFile;
|
|
210 |
iConfigFile = NULL;
|
|
211 |
|
|
212 |
TRAPD(err, iConfigFile = CTestConfig::NewLC(iFs, KConfigFileDir, KConfigFilename); CleanupStack::Pop(iConfigFile));
|
|
213 |
if( err == KErrNone && iConfigFile->Section(iSectionName) != NULL )
|
|
214 |
{
|
|
215 |
iConfigSection = iConfigFile->Section(iSectionName);
|
|
216 |
}
|
|
217 |
else
|
|
218 |
{
|
|
219 |
LOGPHONE2("Section for requested test number (%d) not found in the Config File",testNumber);
|
|
220 |
delete iConfigFile;
|
|
221 |
iConfigFile = NULL;
|
|
222 |
|
|
223 |
User::Leave(KErrNotFound);
|
|
224 |
}
|
|
225 |
|
|
226 |
User::LeaveIfError(SetTestNumberInUse(testNumber));
|
|
227 |
}
|
|
228 |
|
|
229 |
void CSimPhone::ConstructL()
|
|
230 |
/**
|
|
231 |
* 2 Phase Construction (Second phase)
|
|
232 |
* Loads the WINS Physical and Logical Serial Device Drivers. C32 loads the non-WINS
|
|
233 |
* serial drivers, so we don't have to worry about these.
|
|
234 |
* Creates Voice (CSimVoiceLine) and Data lines (CSimDataLine), CConfigReader objects,
|
|
235 |
* CSimSysAgent objects, CSimSmsMessaging object, CSimPhoneStore object,
|
|
236 |
* CSimPhoneBook object, and CSimPacketService object.
|
|
237 |
*/
|
|
238 |
{
|
|
239 |
#if defined (__WINS__)
|
|
240 |
TInt r=User::LoadPhysicalDevice(PDD_NAME);
|
|
241 |
r=User::LoadLogicalDevice(LDD_NAME);
|
|
242 |
#endif
|
|
243 |
|
|
244 |
LOGPHONE1("Starting to Load and Parse the Config File");
|
|
245 |
|
|
246 |
User::LeaveIfError(iFs.Connect());
|
|
247 |
|
|
248 |
SetTestNumberAndReadConfigurationFileL();
|
|
249 |
|
|
250 |
CSimTsyMode::InitL(this);
|
|
251 |
|
|
252 |
iReduceTimers = CSimReduceTimers::NewL();
|
|
253 |
|
|
254 |
InitPhoneStatus();
|
|
255 |
iSimPhoneInitialise = CSimPhoneInitialise::NewL(this);
|
|
256 |
|
|
257 |
if (CSimTsyMode::GetMode() != CSimTsyMode::ECdmaV1)
|
|
258 |
{
|
|
259 |
iVoiceLine = CSimVoiceLine::NewL(this,KVoiceLineName);
|
|
260 |
iDataLine = CSimDataLine::NewL(this,KDataLineName);
|
|
261 |
iSmsMessaging = CSimSmsMessaging::NewL(this);
|
|
262 |
iPhoneSecurity = CSimPhoneSecurity::NewL(this);
|
|
263 |
iPhoneUSimApp = CSimPhoneUSimApp::NewL(this);
|
|
264 |
iPhoneSmartCardApp = CSimPhoneSmartCardApp::NewL(this);
|
|
265 |
iPhoneScAuth = CSimSmartCardAuth::NewL(this);
|
|
266 |
|
|
267 |
iPhBkStores=new(ELeave) CArrayFixFlat<CSimPhBkStore*>(KPhonebookStoreGranularity);
|
|
268 |
iPhBkUSimStores=new(ELeave) CArrayFixFlat<CSimPhBkUSimStore*>(KPhBkUSimStoreGranularity);
|
|
269 |
|
|
270 |
FindAndCreatePhBkStoresL();
|
|
271 |
CreateONStoreL();
|
|
272 |
|
|
273 |
iSignalStrength=CSimSignalStrength::NewL(this);
|
|
274 |
iNetworkStatus=CSimNetworkStatus::NewL(this);
|
|
275 |
iDtmf=CSimDtmf::NewL(this);
|
|
276 |
|
|
277 |
}
|
|
278 |
|
|
279 |
const TInt capacityServiceTable = 56;
|
|
280 |
PopulateServiceTableL(capacityServiceTable,KUSIMServiceTableSupportedEntrys(), &iUSIMServiceTable);
|
|
281 |
PopulateServiceTableL(capacityServiceTable,USIMServiceTableEnabledEntrys(), &iUSIMEnabledServiceTable);
|
|
282 |
PopulateServiceTableL(capacityServiceTable,KSIMServiceTable(), &iSIMServiceTable);
|
|
283 |
|
|
284 |
/* Updating the V8 features */
|
|
285 |
PopulateServiceTableV8L(KUSIMServiceTableSupportedEntrys(),&iUSIMServiceTableV8);
|
|
286 |
|
|
287 |
if (ServiceEnabled(iUSIMServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
288 |
{
|
|
289 |
TInt entries = 0;
|
|
290 |
const CTestConfigItem* aPNListItem=CfgFile()->Item(KAccessPointNameList);
|
|
291 |
if (aPNListItem)
|
|
292 |
{
|
|
293 |
TInt ret=CTestConfig::GetElement(aPNListItem->Value(),KStdDelimiter,0,entries);
|
|
294 |
if(ret == KErrNone && entries > 0)
|
|
295 |
{
|
|
296 |
for (TInt i= 0;i< entries;i++)
|
|
297 |
{
|
|
298 |
RMobilePhone::TAPNEntryV3 entry;
|
|
299 |
entry.iApn.Zero();
|
|
300 |
TPtrC8 startupAPNList;
|
|
301 |
ret=CTestConfig::GetElement(aPNListItem->Value(),KStdDelimiter,i+1,startupAPNList);
|
|
302 |
entry.iApn.Copy(startupAPNList);
|
|
303 |
iAPNList.Append(entry);
|
|
304 |
}
|
|
305 |
}
|
|
306 |
}
|
|
307 |
}
|
|
308 |
|
|
309 |
TPtrC8 IMSI;
|
|
310 |
iSubscriberId.iError = KErrNone;
|
|
311 |
const CTestConfigItem* itemSubscriberId=CfgFile()->Item(KSubscriberId);
|
|
312 |
if( itemSubscriberId != NULL )
|
|
313 |
{
|
|
314 |
TInt ret=CTestConfig::GetElement(itemSubscriberId->Value(),KStdDelimiter,0,IMSI);
|
|
315 |
if( ret != KErrNone )
|
|
316 |
{
|
|
317 |
LOGPARSERR("IMSI",ret,0,&KSubscriberId);
|
|
318 |
}
|
|
319 |
// coverity[check_return]
|
|
320 |
CTestConfig::GetElement(itemSubscriberId->Value(),KStdDelimiter,1,iSubscriberId.iError);
|
|
321 |
iSubscriberId.iIMSI.Copy(IMSI);
|
|
322 |
}
|
|
323 |
else
|
|
324 |
{
|
|
325 |
iSubscriberId.iIMSI.Copy(KSubscriberIdDefault);
|
|
326 |
}
|
|
327 |
|
|
328 |
iNtwkMode=(RMobilePhone::TMobilePhoneNetworkMode)CfgFile()->ItemValue(KNetworkMode,KNetworkModeDefault);
|
|
329 |
//get phone id from config file
|
|
330 |
GetPhoneIdAndCaps();
|
|
331 |
|
|
332 |
LOGPHONE1("Loading the version configuration");
|
|
333 |
iSimTsyVersion = CfgFile()->ItemValue(KTsyVersionNumber,KSimTsyDefaultVersion);
|
|
334 |
LOGPHONE2("Simulated SIMTSY version: %d", iSimTsyVersion);
|
|
335 |
|
|
336 |
iPacketService = CSimPacketService::NewL(this);
|
|
337 |
iBatteryCharger = CSimBatteryCharger::NewL(this);
|
|
338 |
iSat = CSimSat::NewL(this);
|
|
339 |
iIndicator = CSimIndicator::NewL(this);
|
|
340 |
iPhoneIMSAuth = CSimPhoneIMSAuth::NewL(this);
|
|
341 |
|
|
342 |
iCallBarring=CSimCallBarring::NewL(this);
|
|
343 |
iCallForwarding=CSimCallForwarding::NewL(this);
|
|
344 |
iCallWaiting=CSimCallWaiting::NewL(this);
|
|
345 |
iUsimRelease6=CSimUsimR6::NewL(this);
|
|
346 |
|
|
347 |
iNetworkModeArray = new (ELeave) CArrayFixFlat<TNetworkModeBundle>(KGranularity);
|
|
348 |
|
|
349 |
iPhoneScEapMan = CSimSmartCardEapManager::NewL(this);
|
|
350 |
|
|
351 |
iNetworkModeTimer = CSimTimer::NewL(this);
|
|
352 |
//< Read in all network mode data
|
|
353 |
TInt count = CfgFile()->ItemCount(KNetworkMode);
|
|
354 |
const CTestConfigItem* item = NULL;
|
|
355 |
for (TInt i = 0; i < count; ++i)
|
|
356 |
{
|
|
357 |
item = CfgFile()->Item(KNetworkMode,i);
|
|
358 |
if (!item)
|
|
359 |
break;
|
|
360 |
|
|
361 |
TInt duration(0);
|
|
362 |
TInt networkMode(0);
|
|
363 |
TInt ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,0,duration);
|
|
364 |
if (ret != KErrNone)
|
|
365 |
break;
|
|
366 |
ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,1,networkMode);
|
|
367 |
if (ret != KErrNone)
|
|
368 |
break;
|
|
369 |
RMobilePhone::TMobilePhoneNetworkMode mode;
|
|
370 |
if(networkMode == 1)
|
|
371 |
{
|
|
372 |
mode = RMobilePhone::ENetworkModeUnregistered;
|
|
373 |
}
|
|
374 |
else if(networkMode == 2)
|
|
375 |
{
|
|
376 |
mode = RMobilePhone::ENetworkModeGsm;
|
|
377 |
}
|
|
378 |
else if(networkMode == 3)
|
|
379 |
{
|
|
380 |
mode = RMobilePhone::ENetworkModeAmps;
|
|
381 |
}
|
|
382 |
else if(networkMode == 6)
|
|
383 |
{
|
|
384 |
mode = RMobilePhone::ENetworkModeWcdma;
|
|
385 |
}
|
|
386 |
else if(networkMode == 7)
|
|
387 |
{
|
|
388 |
mode = RMobilePhone::ENetworkModeTdcdma;
|
|
389 |
}
|
|
390 |
else
|
|
391 |
{
|
|
392 |
mode = RMobilePhone::ENetworkModeUnknown;
|
|
393 |
}
|
|
394 |
TNetworkModeBundle networkModeData;
|
|
395 |
networkModeData.iDuration = duration;
|
|
396 |
networkModeData.iNetworkMode = mode;
|
|
397 |
|
|
398 |
TRAP_IGNORE(iNetworkModeArray->AppendL(networkModeData));
|
|
399 |
}
|
|
400 |
|
|
401 |
if (iNetworkModeArray->Count() != 0)
|
|
402 |
{
|
|
403 |
iNetworkModeIndex = 0;
|
|
404 |
TNetworkModeBundle initialNetworkMode = iNetworkModeArray->At(0);
|
|
405 |
iNtwkMode = initialNetworkMode.iNetworkMode; // set to new value if NetworkMode present in config.txt file
|
|
406 |
iTimerCallBackNetworkMode.SetHandle(this);
|
|
407 |
iNetworkModeTimer->Start(initialNetworkMode.iDuration, &iTimerCallBackNetworkMode);
|
|
408 |
}
|
|
409 |
// end of network mode simulation setup
|
|
410 |
iTestNumberObserver = CSimTestNumberObserver::NewL(*this);
|
|
411 |
|
|
412 |
LOGPHONE1("Completed Loading and Parsing the Config File");
|
|
413 |
}
|
|
414 |
|
|
415 |
CSimReduceTimers* CSimPhone::GetReduceTimersSubject()
|
|
416 |
{
|
|
417 |
return iReduceTimers;
|
|
418 |
}
|
|
419 |
|
|
420 |
TInt CSimPhone::GetTestNumber(TInt& aTestNumber)
|
|
421 |
/**
|
|
422 |
* Retrieve the test number.
|
|
423 |
*/
|
|
424 |
{
|
|
425 |
TInt ret = RProperty::Get(KUidPSSimTsyCategory, KPSSimTsyTestNumber, aTestNumber);
|
|
426 |
|
|
427 |
if (ret == KErrNone && aTestNumber >= 0)
|
|
428 |
{
|
|
429 |
LOGPHONE2("Got system property KUidPSSimTsyCategory/KPSSimTsyTestNumber. testNumber=%d", aTestNumber);
|
|
430 |
}
|
|
431 |
else
|
|
432 |
{
|
|
433 |
aTestNumber = KDefaultTestNumber;
|
|
434 |
LOGPHONE2("Using the default test number. testNumber=%d", aTestNumber);
|
|
435 |
}
|
|
436 |
|
|
437 |
return KErrNone;
|
|
438 |
}
|
|
439 |
|
|
440 |
|
|
441 |
TInt CSimPhone::SetTestNumberInUse(TInt aTestNumber)
|
|
442 |
/**
|
|
443 |
* Set the test number that is actually used by the TSY
|
|
444 |
*/
|
|
445 |
{
|
|
446 |
TInt ret = RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumberInUse, aTestNumber);
|
|
447 |
|
|
448 |
if (ret == KErrNone)
|
|
449 |
{
|
|
450 |
LOGPHONE2("Set system property KUidPSSimTsyCategory/KPSSimTsyTestNumberInUse. testNumber=%d", aTestNumber);
|
|
451 |
}
|
|
452 |
|
|
453 |
return ret;
|
|
454 |
}
|
|
455 |
|
|
456 |
|
|
457 |
CSimPhone::~CSimPhone()
|
|
458 |
/**
|
|
459 |
* Standard destructor.
|
|
460 |
* Any objects created by the ::ConstructL() function should be destroyed here.
|
|
461 |
* The objects to be destroyed are:
|
|
462 |
* CSimVoiceLine, CSimDataLine, CConfigReader, CSimSysAgent, CSimSmsMessaging
|
|
463 |
* CSimPhoneStore, CSimPhoneBook, CSimPacketService
|
|
464 |
*/
|
|
465 |
{
|
|
466 |
iPhoneBaseRef = NULL;
|
|
467 |
|
|
468 |
delete iNetworkModeTimer;
|
|
469 |
|
|
470 |
delete iDtmf;
|
|
471 |
delete iNetworkStatus;
|
|
472 |
delete iSignalStrength;
|
|
473 |
delete iIndicator;
|
|
474 |
delete iBatteryCharger;
|
|
475 |
delete iPhoneIMSAuth;
|
|
476 |
delete iPhoneScEapMan;
|
|
477 |
delete iPhoneScAuth;
|
|
478 |
delete iUsimRelease6;
|
|
479 |
|
|
480 |
iFs.Close();
|
|
481 |
if(iDataLine)
|
|
482 |
iDataLine->Close();
|
|
483 |
if(iVoiceLine)
|
|
484 |
iVoiceLine->Close();
|
|
485 |
if(iSmsMessaging)
|
|
486 |
iSmsMessaging->Close();
|
|
487 |
if(iPhoneSecurity)
|
|
488 |
iPhoneSecurity->Close();
|
|
489 |
if(iPhoneUSimApp)
|
|
490 |
iPhoneUSimApp->Close();
|
|
491 |
if(iPhoneSmartCardApp)
|
|
492 |
iPhoneSmartCardApp->Close();
|
|
493 |
|
|
494 |
if (iUSIMServiceTable != NULL)
|
|
495 |
delete(iUSIMServiceTable);
|
|
496 |
if (iUSIMEnabledServiceTable != NULL)
|
|
497 |
delete(iUSIMEnabledServiceTable);
|
|
498 |
if (iSIMServiceTable != NULL)
|
|
499 |
delete(iSIMServiceTable);
|
|
500 |
if (iUSIMServiceTableV8 != NULL)
|
|
501 |
delete(iUSIMServiceTableV8);
|
|
502 |
|
|
503 |
if( iPhBkStores != NULL )
|
|
504 |
{
|
|
505 |
TInt storeCount=iPhBkStores->Count();
|
|
506 |
for(TInt i=0;i<storeCount;i++)
|
|
507 |
{
|
|
508 |
iPhBkStores->At(i)->Close();
|
|
509 |
}
|
|
510 |
delete iPhBkStores;
|
|
511 |
}
|
|
512 |
if( iPhBkUSimStores != NULL )
|
|
513 |
{
|
|
514 |
TInt storeCount=iPhBkUSimStores->Count();
|
|
515 |
for(TInt i=0;i<storeCount;i++)
|
|
516 |
{
|
|
517 |
iPhBkUSimStores->At(i)->Close();
|
|
518 |
}
|
|
519 |
delete iPhBkUSimStores;
|
|
520 |
}
|
|
521 |
|
|
522 |
if(iONStore)
|
|
523 |
{
|
|
524 |
iONStore->Close();
|
|
525 |
iONStore = NULL;
|
|
526 |
}
|
|
527 |
if( iNetworkModeArray != NULL )
|
|
528 |
{
|
|
529 |
iNetworkModeArray->Delete(0,iNetworkModeArray->Count());
|
|
530 |
delete iNetworkModeArray;
|
|
531 |
}
|
|
532 |
if( iPacketService!= NULL )
|
|
533 |
{
|
|
534 |
iPacketService->Close();
|
|
535 |
}
|
|
536 |
if( iSat != NULL )
|
|
537 |
{
|
|
538 |
iSat->Close();
|
|
539 |
}
|
|
540 |
if( iConfigFile == NULL)
|
|
541 |
{
|
|
542 |
// In this case if iConfigSection exists then it is not owned
|
|
543 |
// by iConfigFile - this is cos there was no config file for
|
|
544 |
// this SIM TSY.
|
|
545 |
delete iConfigSection;
|
|
546 |
}
|
|
547 |
delete iConfigFile;
|
|
548 |
delete iCallBarring;
|
|
549 |
delete iCallForwarding;
|
|
550 |
delete iCallWaiting;
|
|
551 |
|
|
552 |
if (iSetCallProcessingSuspendStateTimer)
|
|
553 |
{
|
|
554 |
iSetCallProcessingSuspendStateTimer->Cancel();
|
|
555 |
delete iSetCallProcessingSuspendStateTimer;
|
|
556 |
}
|
|
557 |
delete iSimPhoneInitialise;
|
|
558 |
|
|
559 |
delete iReduceTimers;
|
|
560 |
delete iTestNumberObserver;
|
|
561 |
|
|
562 |
CSimTsyMode::FreeMode();
|
|
563 |
LOGPHONE1("CSimPhone Destroyed");
|
|
564 |
}
|
|
565 |
|
|
566 |
void CSimPhone::InitPhoneStatus()
|
|
567 |
{
|
|
568 |
const CTestConfigItem* item = NULL;
|
|
569 |
TInt ret = KErrNone;
|
|
570 |
|
|
571 |
LOGPHONE1("Starting to Load and Parse Phone Config parameters");
|
|
572 |
|
|
573 |
item = CfgFile()->Item(KPhoneStatus);
|
|
574 |
if(!item)
|
|
575 |
return;
|
|
576 |
|
|
577 |
TInt modemDetection, mode;
|
|
578 |
ret = CTestConfig::GetElement(item->Value(), KStdDelimiter, 0, modemDetection);
|
|
579 |
if (ret == KErrNone)
|
|
580 |
{
|
|
581 |
iModemDetection = (RPhone::TModemDetection)modemDetection;
|
|
582 |
}
|
|
583 |
ret=CTestConfig::GetElement(item->Value(), KStdDelimiter, 1, mode);
|
|
584 |
if (ret != KErrNone)
|
|
585 |
{
|
|
586 |
iMode = (RPhone::TMode)mode;
|
|
587 |
}
|
|
588 |
}
|
|
589 |
|
|
590 |
void CSimPhone::FindAndCreatePhBkStoresL()
|
|
591 |
{
|
|
592 |
TInt count=CfgFile()->ItemCount(KPhBkStore);
|
|
593 |
const CTestConfigItem* item=NULL;
|
|
594 |
TInt ret=KErrNone;
|
|
595 |
|
|
596 |
LOGPHONE1("Starting to Load and Parse PhoneBookStore Config parameters");
|
|
597 |
TInt i;
|
|
598 |
for(i=0;i<count;i++)
|
|
599 |
{
|
|
600 |
item=CfgFile()->Item(KPhBkStore,i);
|
|
601 |
if(!item)
|
|
602 |
break;
|
|
603 |
|
|
604 |
TPtrC8 phonebookName;
|
|
605 |
TInt maxNumSlots, telNumMaxLen, alphaTagMaxLen;
|
|
606 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,phonebookName);
|
|
607 |
if(ret!=KErrNone)
|
|
608 |
{
|
|
609 |
LOGPARSERR("phonebookName",ret,0,&KPhBkStore);
|
|
610 |
continue;
|
|
611 |
}
|
|
612 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,maxNumSlots);
|
|
613 |
if(ret!=KErrNone)
|
|
614 |
{
|
|
615 |
LOGPARSERR("maxNumSlots",ret,1,&KPhBkStore);
|
|
616 |
continue;
|
|
617 |
}
|
|
618 |
|
|
619 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,telNumMaxLen);
|
|
620 |
if(ret!=KErrNone)
|
|
621 |
{
|
|
622 |
LOGPARSERR("telNumMaxLen",ret,2,&KPhBkStore);
|
|
623 |
continue;
|
|
624 |
}
|
|
625 |
|
|
626 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,alphaTagMaxLen);
|
|
627 |
if(ret!=KErrNone)
|
|
628 |
{
|
|
629 |
LOGPARSERR("alphaTagMaxLen",ret,3,&KPhBkStore);
|
|
630 |
continue;
|
|
631 |
}
|
|
632 |
|
|
633 |
|
|
634 |
CSimPhBkStore* phBkStore=CSimPhBkStore::NewL(this,phonebookName,maxNumSlots,telNumMaxLen,alphaTagMaxLen);
|
|
635 |
TCleanupItem newObjClose(CloseObj,phBkStore);
|
|
636 |
CleanupStack::PushL(newObjClose);
|
|
637 |
iPhBkStores->AppendL(phBkStore);
|
|
638 |
CleanupStack::Pop();
|
|
639 |
}
|
|
640 |
|
|
641 |
|
|
642 |
count=CfgFile()->ItemCount(KPhBkUSimStore);
|
|
643 |
|
|
644 |
LOGPHONE1("Starting to Load and Parse USim PhoneBookStore Config parameters");
|
|
645 |
|
|
646 |
for(i=0;i<count;i++)
|
|
647 |
{
|
|
648 |
item=CfgFile()->Item(KPhBkUSimStore,i);
|
|
649 |
if(!item)
|
|
650 |
break;
|
|
651 |
|
|
652 |
TPtrC8 phonebookName, phonebookStore;
|
|
653 |
TInt maxNumSlots, telNumMaxLen, alphaTagMaxLen;
|
|
654 |
TInt additional, maxEmail, maxAdditionalTelNumLen, maxAdditionalTextLen;
|
|
655 |
|
|
656 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,phonebookStore);
|
|
657 |
if(ret!=KErrNone)
|
|
658 |
{
|
|
659 |
LOGPARSERR("phonebookStore",ret,0,&KPhBkUSimStore);
|
|
660 |
continue;
|
|
661 |
}
|
|
662 |
|
|
663 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,phonebookName);
|
|
664 |
if(ret!=KErrNone)
|
|
665 |
{
|
|
666 |
LOGPARSERR("phonebookName",ret,1,&KPhBkUSimStore);
|
|
667 |
continue;
|
|
668 |
}
|
|
669 |
|
|
670 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,maxNumSlots);
|
|
671 |
if(ret!=KErrNone)
|
|
672 |
{
|
|
673 |
LOGPARSERR("maxNumSlots",ret,2,&KPhBkUSimStore);
|
|
674 |
continue;
|
|
675 |
}
|
|
676 |
|
|
677 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,telNumMaxLen);
|
|
678 |
if(ret!=KErrNone)
|
|
679 |
{
|
|
680 |
LOGPARSERR("telNumMaxLen",ret,3,&KPhBkUSimStore);
|
|
681 |
continue;
|
|
682 |
}
|
|
683 |
|
|
684 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,4,alphaTagMaxLen);
|
|
685 |
if(ret!=KErrNone)
|
|
686 |
{
|
|
687 |
LOGPARSERR("alphaTagMaxLen",ret,4,&KPhBkUSimStore);
|
|
688 |
continue;
|
|
689 |
}
|
|
690 |
|
|
691 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,5,additional);
|
|
692 |
if(ret!=KErrNone)
|
|
693 |
{
|
|
694 |
LOGPARSERR("additional",ret,5,&KPhBkUSimStore);
|
|
695 |
continue;
|
|
696 |
}
|
|
697 |
|
|
698 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,6,maxEmail);
|
|
699 |
if(ret!=KErrNone)
|
|
700 |
{
|
|
701 |
LOGPARSERR("maxEmail",ret,6,&KPhBkUSimStore);
|
|
702 |
continue;
|
|
703 |
}
|
|
704 |
|
|
705 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,7,maxAdditionalTelNumLen);
|
|
706 |
if(ret!=KErrNone)
|
|
707 |
{
|
|
708 |
LOGPHONE1("WARNING maxAdditionalTelNumLen missing, defaulting to telNumMaxLen");
|
|
709 |
maxAdditionalTelNumLen = telNumMaxLen;
|
|
710 |
}
|
|
711 |
|
|
712 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,8,maxAdditionalTextLen);
|
|
713 |
if(ret!=KErrNone)
|
|
714 |
{
|
|
715 |
LOGPHONE1("WARNING maxAdditionalTextLen missing, defaulting to alphaTagMaxLen");
|
|
716 |
maxAdditionalTextLen = alphaTagMaxLen;
|
|
717 |
}
|
|
718 |
|
|
719 |
TInt countStores = iPhBkUSimStores->Count();
|
|
720 |
TBool found=EFalse;
|
|
721 |
|
|
722 |
if(phonebookName.Compare(KGsmPhoneBook) == KErrNone)
|
|
723 |
{
|
|
724 |
TInt countShort = iPhBkStores->Count();
|
|
725 |
TBool foundShort=EFalse;
|
|
726 |
|
|
727 |
for(TInt j=0; i < countShort; j++)
|
|
728 |
{
|
|
729 |
CSimPhBkStore* phBkStore = iPhBkStores->At(j);
|
|
730 |
if((phBkStore->Name().Compare(phonebookName) == KErrNone))
|
|
731 |
{
|
|
732 |
foundShort=ETrue;
|
|
733 |
break;
|
|
734 |
}
|
|
735 |
}
|
|
736 |
if(foundShort) //warn but not fail!
|
|
737 |
{
|
|
738 |
LOGPHONE1("WARNING! PhBkUSimStore and PhBkStore duplicate phonebook configuration");
|
|
739 |
}
|
|
740 |
}
|
|
741 |
for(TInt j=0; j < countStores; j++)
|
|
742 |
{
|
|
743 |
CSimPhBkUSimStore* phBkStore = iPhBkUSimStores->At(j);
|
|
744 |
if((phBkStore->Name().Compare(phonebookName) == KErrNone)&&
|
|
745 |
(phBkStore->PhBkStore().Compare(phonebookStore) == KErrNone))
|
|
746 |
{
|
|
747 |
found=ETrue;
|
|
748 |
break;
|
|
749 |
}
|
|
750 |
}
|
|
751 |
|
|
752 |
if(found) //This store already exists!!!
|
|
753 |
continue;
|
|
754 |
|
|
755 |
CSimPhBkUSimStore* phBkStore=CSimPhBkUSimStore::NewL(this,phonebookStore,phonebookName,maxNumSlots,telNumMaxLen,alphaTagMaxLen,additional,maxEmail,maxAdditionalTelNumLen,maxAdditionalTextLen);
|
|
756 |
TCleanupItem newObjClose(CloseObj,phBkStore);
|
|
757 |
CleanupStack::PushL(newObjClose);
|
|
758 |
iPhBkUSimStores->AppendL(phBkStore);
|
|
759 |
CleanupStack::Pop();
|
|
760 |
}
|
|
761 |
|
|
762 |
|
|
763 |
// Populate the Phonebook Stores after construction, so as not to disturb the config file's
|
|
764 |
// search pointer
|
|
765 |
for(i=0;i<iPhBkStores->Count();i++)
|
|
766 |
{
|
|
767 |
iPhBkStores->At(i)->PopulateStoreFromConfigFileL();
|
|
768 |
}
|
|
769 |
for(i=0;i<iPhBkUSimStores->Count();i++)
|
|
770 |
{
|
|
771 |
iPhBkUSimStores->At(i)->PopulateStoreFromConfigFileL();
|
|
772 |
}
|
|
773 |
LOGPHONE1("Finished parsing PhBkStores config parameters");
|
|
774 |
}
|
|
775 |
|
|
776 |
void CSimPhone::CreateONStoreL()
|
|
777 |
{
|
|
778 |
const CTestConfigItem* item=NULL;
|
|
779 |
TInt ret=KErrNone;
|
|
780 |
|
|
781 |
LOGPHONE1("Starting to Load and Parse Own Number Config parameters");
|
|
782 |
|
|
783 |
TInt i=0;
|
|
784 |
item=CfgFile()->Item(KONStore,i);
|
|
785 |
if(!item)
|
|
786 |
return;
|
|
787 |
|
|
788 |
TInt maxNumSlots, telNumMaxLen, alphaTagMaxLen;
|
|
789 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,maxNumSlots);
|
|
790 |
if(ret!=KErrNone)
|
|
791 |
{
|
|
792 |
LOGPARSERR("maxNumSlots",ret,1,&KONStore);
|
|
793 |
return;
|
|
794 |
}
|
|
795 |
|
|
796 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,telNumMaxLen);
|
|
797 |
if(ret!=KErrNone)
|
|
798 |
{
|
|
799 |
LOGPARSERR("telNumMaxLen",ret,2,&KONStore);
|
|
800 |
return;
|
|
801 |
}
|
|
802 |
|
|
803 |
ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,alphaTagMaxLen);
|
|
804 |
if(ret!=KErrNone)
|
|
805 |
{
|
|
806 |
LOGPARSERR("alphaTagMaxLen",ret,3,&KONStore);
|
|
807 |
return;
|
|
808 |
}
|
|
809 |
|
|
810 |
iONStore=CSimONStore::NewL(this,maxNumSlots,telNumMaxLen,alphaTagMaxLen);
|
|
811 |
|
|
812 |
// Populate the Own Number Store
|
|
813 |
iONStore->PopulateStoreFromConfigFileL();
|
|
814 |
|
|
815 |
LOGPHONE1("Finished parsing Own Number Store config parameters");
|
|
816 |
}
|
|
817 |
|
|
818 |
TInt CSimPhone::ExtFunc(const TTsyReqHandle aReqHandle, const TInt aIpc, const TDataPackage& aPckg)
|
|
819 |
/**
|
|
820 |
* ExtFunc is called by the server when it has a "extended", i.e. non-core ETel request
|
|
821 |
* for the TSY to process.
|
|
822 |
* A request handle, request type and request data are passed to the TSY.
|
|
823 |
*/
|
|
824 |
{
|
|
825 |
TAny* dataPtr = aPckg.Ptr1();
|
|
826 |
|
|
827 |
TAny* dataPtr2 = aPckg.Ptr2();
|
|
828 |
|
|
829 |
TInt functionValue;
|
|
830 |
|
|
831 |
switch (aIpc)
|
|
832 |
{
|
|
833 |
case EMobilePhoneGetMultimodeCaps:
|
|
834 |
return GetMultimodeCaps(aReqHandle, reinterpret_cast<TUint32*>(dataPtr));
|
|
835 |
|
|
836 |
case EMobilePhoneGetIccAccessCaps:
|
|
837 |
return GetIccAccessCaps(aReqHandle,
|
|
838 |
REINTERPRET_CAST(TUint32*,dataPtr));
|
|
839 |
|
|
840 |
case EMobilePhoneGetPhoneStoreInfo:
|
|
841 |
switch(aPckg.Type())
|
|
842 |
{
|
|
843 |
// Switch between the alternative implementations of GetPhoneStoreInfo
|
|
844 |
case TDataPackage::EPackage1n2u:
|
|
845 |
return GetPhoneStoreInfo(aReqHandle,
|
|
846 |
aPckg.Des1n(),aPckg.Des2u());
|
|
847 |
case TDataPackage::EPackage1n2n:
|
|
848 |
return GetPhoneStoreInfo(aReqHandle, aPckg.Des2n(),
|
|
849 |
REINTERPRET_CAST(RMobilePhone::TPhoneStoreNameAndIccType*, dataPtr));
|
|
850 |
default:
|
|
851 |
return NULL;
|
|
852 |
}
|
|
853 |
|
|
854 |
|
|
855 |
// return GetPhoneStoreInfo(aReqHandle,aPckg.Des1n(),aPckg.Des2u());
|
|
856 |
|
|
857 |
// Signal Strength
|
|
858 |
case EMobilePhoneGetSignalCaps:
|
|
859 |
return iSignalStrength->GetSignalCaps(aReqHandle,aPckg.Des1n());
|
|
860 |
|
|
861 |
case EMobilePhoneGetSignalStrength:
|
|
862 |
return iSignalStrength->GetSignalStrength(aReqHandle,aPckg.Des1n(),aPckg.Des2n());
|
|
863 |
|
|
864 |
case EMobilePhoneNotifySignalStrengthChange:
|
|
865 |
return iSignalStrength->NotifySignalStrengthChange(aReqHandle,aPckg.Des1n(),aPckg.Des2n());
|
|
866 |
|
|
867 |
// Indicators
|
|
868 |
case EMobilePhoneGetIndicator:
|
|
869 |
return iIndicator->GetIndicator(aReqHandle,aPckg.Des1n());
|
|
870 |
|
|
871 |
case EMobilePhoneNotifyIndicatorChange:
|
|
872 |
return iIndicator->NotifyIndicatorChange(aReqHandle,aPckg.Des1n());
|
|
873 |
|
|
874 |
case EMobilePhoneGetIndicatorCaps:
|
|
875 |
return iIndicator->GetIndicatorCaps(aReqHandle,aPckg.Des1n(), aPckg.Des2n());
|
|
876 |
|
|
877 |
// Battery Charger
|
|
878 |
case EMobilePhoneGetBatteryInfo:
|
|
879 |
return iBatteryCharger->GetBatteryInfo(aReqHandle,aPckg.Des1n());
|
|
880 |
|
|
881 |
case EMobilePhoneNotifyBatteryInfoChange:
|
|
882 |
return iBatteryCharger->NotifyBatteryInfoChange(aReqHandle,aPckg.Des1n());
|
|
883 |
|
|
884 |
case EMobilePhoneGetBatteryCaps:
|
|
885 |
return iBatteryCharger->GetBatteryCaps(aReqHandle,aPckg.Des1n());
|
|
886 |
|
|
887 |
// Network Information
|
|
888 |
case EMobilePhoneGetNetworkCaps:
|
|
889 |
return iNetworkStatus->GetNetworkCaps(aReqHandle,aPckg.Des1n());
|
|
890 |
|
|
891 |
case EMobilePhoneGetCurrentMode:
|
|
892 |
return GetCurrentMode(aReqHandle,aPckg.Des1n());
|
|
893 |
|
|
894 |
|
|
895 |
case EMobilePhoneNotifyModeChange:
|
|
896 |
return NotifyModeChange(aReqHandle,reinterpret_cast<RMobilePhone::TMobilePhoneNetworkMode*>(dataPtr));
|
|
897 |
|
|
898 |
|
|
899 |
case EMobilePhoneGetHomeNetwork:
|
|
900 |
return iNetworkStatus->GetHomeNetwork(aReqHandle,aPckg.Des1n());
|
|
901 |
|
|
902 |
case EMobilePhoneGetCurrentNetwork:
|
|
903 |
return iNetworkStatus->GetCurrentNetwork(aReqHandle,aPckg.Des1n(),aPckg.Des2n());
|
|
904 |
|
|
905 |
case EMobilePhoneGetCurrentNetworkNoLocation:
|
|
906 |
return iNetworkStatus->GetCurrentNetworkNoLocation(aReqHandle,aPckg.Des1n());
|
|
907 |
|
|
908 |
case EMobilePhoneNotifyCurrentNetworkChange:
|
|
909 |
return iNetworkStatus->NotifyCurrentNetworkChange(aReqHandle,aPckg.Des1n(),aPckg.Des2n());
|
|
910 |
|
|
911 |
case EMobilePhoneNotifyCurrentNetworkNoLocationChange:
|
|
912 |
return iNetworkStatus->NotifyCurrentNetworkNoLocationChange(aReqHandle,aPckg.Des1n());
|
|
913 |
|
|
914 |
case EMobilePhoneGetNetworkRegistrationStatus:
|
|
915 |
return iNetworkStatus->GetNetworkRegistrationStatus(aReqHandle,aPckg.Des1n());
|
|
916 |
|
|
917 |
case EMobilePhoneNotifyNetworkRegistrationStatusChange:
|
|
918 |
return iNetworkStatus->NotifyNetworkRegistrationStatusChange(aReqHandle,aPckg.Des1n());
|
|
919 |
|
|
920 |
case EMobilePhoneGetServiceProviderName:
|
|
921 |
return iNetworkStatus->GetCurrentServiceProvider(aReqHandle,aPckg.Des1n());
|
|
922 |
|
|
923 |
case EMobilePhoneGetNetworkName:
|
|
924 |
return iNetworkStatus->GetCurrentNetworkName(aReqHandle,aPckg.Des1n(), aPckg.Des2n());
|
|
925 |
|
|
926 |
//USIM Release6 Infomration
|
|
927 |
case EMobilePhoneGetMailboxNumbers:
|
|
928 |
return iUsimRelease6->GetMailboxNumbers(aReqHandle,aPckg.Des1n());
|
|
929 |
|
|
930 |
case EMobilePhoneNotifyMailboxNumbersChange:
|
|
931 |
return iUsimRelease6->NotifyMailboxNumbersChange(aReqHandle,aPckg.Des1n());
|
|
932 |
|
|
933 |
case EMobilePhoneNotifyMessageWaiting:
|
|
934 |
return iUsimRelease6->NotifyMessageWaiting(aReqHandle,REINTERPRET_CAST(TInt*, dataPtr));
|
|
935 |
|
|
936 |
case EMobilePhoneGetIccMessageWaitingIndicators:
|
|
937 |
return iUsimRelease6->GetIccMessageWaitingIndicators(aReqHandle,aPckg.Des1n());
|
|
938 |
|
|
939 |
case EMobilePhoneSetIccMessageWaitingIndicators:
|
|
940 |
return iUsimRelease6->SetIccMessageWaitingIndicators(aReqHandle,aPckg.Des1n());
|
|
941 |
|
|
942 |
case EMobilePhoneNotifyIccMessageWaitingIndicatorsChange:
|
|
943 |
return iUsimRelease6->NotifyIccMessageWaitingIndicatorsChange(aReqHandle,aPckg.Des1n());
|
|
944 |
|
|
945 |
case EMobilePhoneNotifyWlanDataChange:
|
|
946 |
return iUsimRelease6->NotifyWlanDataChange(aReqHandle,aPckg.Des1n());
|
|
947 |
|
|
948 |
case EMobilePhoneNotifyPreferredWlanSIDListChange:
|
|
949 |
return iUsimRelease6->NotifyPreferredWlanSIDListChange(aReqHandle);
|
|
950 |
|
|
951 |
case EMobilePhoneGetWlanData:
|
|
952 |
return iUsimRelease6->GetWlanData(aReqHandle,aPckg.Des1n());
|
|
953 |
|
|
954 |
case EMobilePhoneSetWlanData:
|
|
955 |
return iUsimRelease6->SetWlanData(aReqHandle,aPckg.Des1n());
|
|
956 |
|
|
957 |
case EMobilePhoneGetPreferredWlanSIDsPhase1:
|
|
958 |
return iUsimRelease6->GetPreferredWlanSIDsPhase1(aReqHandle,
|
|
959 |
REINTERPRET_CAST(RMobilePhone::TClientId*, dataPtr),
|
|
960 |
REINTERPRET_CAST(TInt*, dataPtr2));
|
|
961 |
|
|
962 |
case EMobilePhoneGetPreferredWlanSIDsPhase2:
|
|
963 |
return iUsimRelease6->GetPreferredWlanSIDsPhase2(aReqHandle,
|
|
964 |
REINTERPRET_CAST(RMobilePhone::TClientId*, dataPtr), aPckg.Des2n());
|
|
965 |
|
|
966 |
case EMobilePhoneStorePreferredWlanSIDList:
|
|
967 |
return iUsimRelease6->StorePreferredWlanSIDList(aReqHandle, aPckg.Des1n());
|
|
968 |
|
|
969 |
case EMobilePhoneNotifyStorePreferredNetworksListChange:
|
|
970 |
return iUsimRelease6->NotifyStorePreferredNetworksListChange(aReqHandle);
|
|
971 |
|
|
972 |
case EMobilePhoneGetPreferredNetworksPhase1:
|
|
973 |
return iUsimRelease6->GetPreferredNetworksPhase1(aReqHandle,
|
|
974 |
REINTERPRET_CAST(RMobilePhone::TClientId*, dataPtr),
|
|
975 |
REINTERPRET_CAST(TInt*, dataPtr2));
|
|
976 |
|
|
977 |
case EMobilePhoneGetPreferredNetworksPhase2:
|
|
978 |
return iUsimRelease6->GetPreferredNetworksPhase2(aReqHandle,
|
|
979 |
REINTERPRET_CAST(RMobilePhone::TClientId*, dataPtr), aPckg.Des2n());
|
|
980 |
|
|
981 |
case EMobilePhoneStorePreferredNetworksList:
|
|
982 |
return iUsimRelease6->StorePreferredNetworksList(aReqHandle, aPckg.Des1n());
|
|
983 |
|
|
984 |
case EMobilePhoneSetGbaBootstrapParams:
|
|
985 |
return iUsimRelease6->SetGbaBootstrapParams(aReqHandle, aPckg.Des1n(),
|
|
986 |
reinterpret_cast<RMobilePhone::TAID*>(dataPtr2));
|
|
987 |
|
|
988 |
case EMobilePhoneNotifyAuthenticateDataChange:
|
|
989 |
return iUsimRelease6->NotifyAuthenticateDataChange(aReqHandle, aPckg.Des1n());
|
|
990 |
|
|
991 |
case EMobilePhoneGetAuthenticationParams:
|
|
992 |
return iUsimRelease6->GetAuthenticationParams(aReqHandle, aPckg.Des1n(),
|
|
993 |
aPckg.Des2n());
|
|
994 |
|
|
995 |
case EMobilePhoneAuthenticationListPhase1:
|
|
996 |
return iUsimRelease6->GetAuthenticationListPhase1(aReqHandle,
|
|
997 |
REINTERPRET_CAST(CRetrieveMobilePhoneAuthenticationIds::TAuthRequestData*, dataPtr),
|
|
998 |
REINTERPRET_CAST(TInt*, dataPtr2));
|
|
999 |
|
|
1000 |
case EMobilePhoneAuthenticationListPhase2:
|
|
1001 |
return iUsimRelease6->GetAuthenticationListPhase2(aReqHandle,
|
|
1002 |
REINTERPRET_CAST(RMobilePhone::TClientId*, dataPtr),
|
|
1003 |
aPckg.Des2n());
|
|
1004 |
|
|
1005 |
// NITZ Network Information
|
|
1006 |
case EMobilePhoneGetNITZInfo:
|
|
1007 |
return iNetworkStatus->GetNITZInfo(aReqHandle,aPckg.Des1n());
|
|
1008 |
|
|
1009 |
case EMobilePhoneNotifyNITZInfoChange:
|
|
1010 |
return iNetworkStatus->NotifyNITZInfoChange(aReqHandle,aPckg.Des1n());
|
|
1011 |
|
|
1012 |
// Cell Information
|
|
1013 |
case EMobilePhoneGetCellInfo:
|
|
1014 |
return iNetworkStatus->GetCellInfo(aReqHandle,aPckg.Des1n());
|
|
1015 |
|
|
1016 |
case EMobilePhoneNotifyCellInfoChange:
|
|
1017 |
return iNetworkStatus->NotifyCellInfoChange(aReqHandle,aPckg.Des1n());
|
|
1018 |
|
|
1019 |
// Get Subscriber Info
|
|
1020 |
case EMobilePhoneGetSubscriberId:
|
|
1021 |
return GetSubscriberInfo(aReqHandle,aPckg.Des1n());
|
|
1022 |
|
|
1023 |
// DTMF Tx
|
|
1024 |
case EMobilePhoneGetDTMFCaps:
|
|
1025 |
return iDtmf->GetDtmfCaps(aReqHandle,aPckg.Des1n());
|
|
1026 |
|
|
1027 |
case EMobilePhoneNotifyDTMFCapsChange:
|
|
1028 |
return iDtmf->NotifyDtmfCapsChange(aReqHandle,aPckg.Des1n());
|
|
1029 |
|
|
1030 |
case EMobilePhoneSendDTMFTones:
|
|
1031 |
return iDtmf->SendDTMFTones(aReqHandle,aPckg.Des1u());
|
|
1032 |
|
|
1033 |
case EMobilePhoneStartDTMFTone:
|
|
1034 |
return iDtmf->StartDTMFTone(aReqHandle,aPckg.Des1n());
|
|
1035 |
|
|
1036 |
case EMobilePhoneStopDTMFTone:
|
|
1037 |
return iDtmf->StopDTMFTone(aReqHandle);
|
|
1038 |
|
|
1039 |
case EMobilePhoneNotifyStopInDTMFString:
|
|
1040 |
return iDtmf->NotifyStopInDTMFString(aReqHandle);
|
|
1041 |
|
|
1042 |
case EMobilePhoneContinueDTMFStringSending:
|
|
1043 |
return iDtmf->ContinueDtmfStringSending(aReqHandle,aPckg.Des1n());
|
|
1044 |
// Phone ID
|
|
1045 |
case EMobilePhoneGetIdentityCaps:
|
|
1046 |
return GetIdentityCaps(aReqHandle,*REINTERPRET_CAST(TUint32*, dataPtr));
|
|
1047 |
|
|
1048 |
case EMobilePhoneGetPhoneId:
|
|
1049 |
return GetPhoneId(aReqHandle,REINTERPRET_CAST(RMobilePhone::TMobilePhoneIdentityV1*, dataPtr));
|
|
1050 |
|
|
1051 |
// Security (ICC)
|
|
1052 |
|
|
1053 |
case EMobilePhoneGetSecurityCaps:
|
|
1054 |
case EMobilePhoneNotifySecurityCapsChange:
|
|
1055 |
case EMobilePhoneGetLockInfo:
|
|
1056 |
case EMobilePhoneNotifyLockInfoChange:
|
|
1057 |
case EMobilePhoneSetLockSetting:
|
|
1058 |
case EMobilePhoneChangeSecurityCode:
|
|
1059 |
case EMobilePhoneNotifySecurityEvent:
|
|
1060 |
case EMobilePhoneVerifySecurityCode:
|
|
1061 |
case EMobilePhoneAbortSecurityCode:
|
|
1062 |
case EMobilePhoneGetSecurityCodeInfo:
|
|
1063 |
case EMobilePhoneNotifySecurityCodeInfoChange:
|
|
1064 |
return iPhoneSecurity->ExtFunc(aReqHandle, aIpc, aPckg);
|
|
1065 |
|
|
1066 |
//USim Application Support
|
|
1067 |
case EMobilePhoneEnumerateUSimApplications:
|
|
1068 |
case EMobilePhoneSetUSimApplicationStatus:
|
|
1069 |
case EMobilePhoneGetUSimApplicationsInfo:
|
|
1070 |
case EMobilePhoneNotifyUSimApplicationsInfoChange:
|
|
1071 |
if(iPhoneUSimApp->FoundUSimAppTags())
|
|
1072 |
{
|
|
1073 |
return iPhoneUSimApp->ExtFunc(aReqHandle, aIpc, aPckg);
|
|
1074 |
}
|
|
1075 |
else
|
|
1076 |
{
|
|
1077 |
return iPhoneSmartCardApp->ExtFunc(aReqHandle, aIpc, aPckg);
|
|
1078 |
}
|
|
1079 |
|
|
1080 |
//SmartCard Application Support
|
|
1081 |
case EMobilePhoneEnumerateSmartCardApplications:
|
|
1082 |
case EMobilePhoneGetSmartCardApplicationInfo:
|
|
1083 |
case EMobilePhoneSetSmartCardApplicationStatus:
|
|
1084 |
case EMobilePhoneNotifySmartCardApplicationInfoChange:
|
|
1085 |
case EMobilePhoneGetScFileInfo:
|
|
1086 |
case EMobilePhoneReadScFile:
|
|
1087 |
case EMobilePhoneUpdateScFile:
|
|
1088 |
if(iPhoneSmartCardApp->FoundScAppTags())
|
|
1089 |
{
|
|
1090 |
return iPhoneSmartCardApp->ExtFunc(aReqHandle, aIpc, aPckg);
|
|
1091 |
}
|
|
1092 |
else
|
|
1093 |
{
|
|
1094 |
ReqCompleted(aReqHandle, KErrNotSupported);
|
|
1095 |
return KErrNone;
|
|
1096 |
}
|
|
1097 |
|
|
1098 |
|
|
1099 |
//USim/SmartCard Application Supoprt
|
|
1100 |
case EMobilePhoneGetCurrentActiveUSimApplication:
|
|
1101 |
case EMobilePhoneGetUSimAppsSelectionMode:
|
|
1102 |
case EMobilePhoneSetUSimAppsSelectionMode:
|
|
1103 |
case EMobilePhoneNotifyUSimAppsSelectionModeChange:
|
|
1104 |
if(iPhoneUSimApp->FoundUSimAppTags())
|
|
1105 |
{
|
|
1106 |
return iPhoneUSimApp->ExtFunc(aReqHandle, aIpc, aPckg);
|
|
1107 |
}
|
|
1108 |
else
|
|
1109 |
{
|
|
1110 |
return iPhoneSmartCardApp->ExtFunc(aReqHandle, aIpc, aPckg);
|
|
1111 |
}
|
|
1112 |
|
|
1113 |
// CallBarring
|
|
1114 |
case EMobilePhoneSetCallBarringStatus:
|
|
1115 |
case EMobilePhoneSetCallBarringPassword:
|
|
1116 |
case EMobilePhoneNotifyCallBarringStatusChange:
|
|
1117 |
case EMobilePhoneGetBarringStatusPhase1:
|
|
1118 |
case EMobilePhoneGetBarringStatusPhase2:
|
|
1119 |
return iCallBarring->ExtFunc(aReqHandle, aIpc, aPckg);
|
|
1120 |
|
|
1121 |
// CallForwarding
|
|
1122 |
case EMobilePhoneSetCallForwardingStatus:
|
|
1123 |
case EMobilePhoneNotifyCallForwardingStatusChange:
|
|
1124 |
case EMobilePhoneGetIdentityServiceStatus:
|
|
1125 |
case EMobilePhoneGetCallForwardingStatusPhase1:
|
|
1126 |
case EMobilePhoneGetCallForwardingStatusPhase2:
|
|
1127 |
return iCallForwarding->ExtFunc(aReqHandle, aIpc, aPckg);
|
|
1128 |
|
|
1129 |
// CallWaiting
|
|
1130 |
case EMobilePhoneSetCallWaitingStatus:
|
|
1131 |
case EMobilePhoneNotifyCallWaitingStatusChange:
|
|
1132 |
case EMobilePhoneGetWaitingStatusPhase1:
|
|
1133 |
case EMobilePhoneGetWaitingStatusPhase2:
|
|
1134 |
{
|
|
1135 |
functionValue = 0;
|
|
1136 |
TRAPD(leaveValue, functionValue = iCallWaiting->ExtFuncL(aReqHandle, aIpc, aPckg));
|
|
1137 |
if (leaveValue != KErrNone)
|
|
1138 |
{
|
|
1139 |
return leaveValue;
|
|
1140 |
}
|
|
1141 |
else
|
|
1142 |
{
|
|
1143 |
return functionValue;
|
|
1144 |
}
|
|
1145 |
}
|
|
1146 |
|
|
1147 |
// IMS Auth
|
|
1148 |
case EMobilePhoneAuthorizationInfoPhase1:
|
|
1149 |
return iPhoneIMSAuth->GetAuthorizationInfoPhase1(aReqHandle,
|
|
1150 |
reinterpret_cast<RMobilePhone::TClientId*>(dataPtr),
|
|
1151 |
reinterpret_cast<TInt*>(dataPtr2));
|
|
1152 |
|
|
1153 |
case EMobilePhoneAuthorizationInfoPhase2:
|
|
1154 |
return iPhoneIMSAuth->GetAuthorizationInfoPhase2(aReqHandle,
|
|
1155 |
reinterpret_cast<RMobilePhone::TClientId*>(dataPtr), aPckg.Des2n());
|
|
1156 |
|
|
1157 |
case EMobilePhoneIMSAuthenticate:
|
|
1158 |
return iPhoneIMSAuth->GetAuthenticationData(aReqHandle, aPckg.Des1n());
|
|
1159 |
|
|
1160 |
case EMobilePhoneNotifyImsAuthorizationInfoChanged:
|
|
1161 |
return iPhoneIMSAuth->NotifyImsAuthorizationInfoChanged(aReqHandle);
|
|
1162 |
|
|
1163 |
// Generic Smart Card Authentication
|
|
1164 |
case EMobilePhoneSmartCardAuthenticate:
|
|
1165 |
return iPhoneScAuth->GetScAuthenticationData(aReqHandle, aPckg.Des1n(),
|
|
1166 |
reinterpret_cast<RMobilePhone::TAID*>(dataPtr2));
|
|
1167 |
|
|
1168 |
// Access Point Name (APN)
|
|
1169 |
case EMobilePhoneEnumerateAPNEntries:
|
|
1170 |
{
|
|
1171 |
TUint32* count = static_cast<TUint32*>(dataPtr);
|
|
1172 |
return EnumerateAPNEntries(aReqHandle,count);
|
|
1173 |
}
|
|
1174 |
|
|
1175 |
case EMobilePhoneGetAPNname:
|
|
1176 |
{
|
|
1177 |
TUint32 index = *static_cast<TUint32*>(dataPtr);
|
|
1178 |
|
|
1179 |
RMobilePhone::TAPNEntryV3Pckg* entryToReturnPckg =
|
|
1180 |
static_cast<RMobilePhone::TAPNEntryV3Pckg*> (aPckg.Des2n());
|
|
1181 |
|
|
1182 |
return GetAPNname(aReqHandle, index, *entryToReturnPckg);
|
|
1183 |
}
|
|
1184 |
|
|
1185 |
case EMobilePhoneAppendAPNName:
|
|
1186 |
{
|
|
1187 |
RMobilePhone::TAPNEntryV3 entryToAppend =
|
|
1188 |
*static_cast<RMobilePhone::TAPNEntryV3*>(dataPtr);
|
|
1189 |
|
|
1190 |
RMobilePhone::TAPNEntryV3Pckg entryToAppendPckg(entryToAppend);
|
|
1191 |
return AppendAPNName(aReqHandle,entryToAppendPckg);
|
|
1192 |
}
|
|
1193 |
|
|
1194 |
case EMobilePhoneDeleteAPNName:
|
|
1195 |
{
|
|
1196 |
TUint32 tmp = *static_cast<TUint32*>(dataPtr);
|
|
1197 |
|
|
1198 |
return DeleteAPNName(aReqHandle,tmp);
|
|
1199 |
}
|
|
1200 |
|
|
1201 |
case EMobilePhoneNotifyAPNListChanged:
|
|
1202 |
return NotifyAPNListChanged(aReqHandle);
|
|
1203 |
|
|
1204 |
case EMobilePhoneSetAPNControlListServiceStatus:
|
|
1205 |
return SetAPNControlListServiceStatus(aReqHandle,
|
|
1206 |
*static_cast<RMobilePhone::TAPNControlListServiceStatus*>(dataPtr));
|
|
1207 |
|
|
1208 |
case EMobilePhoneGetAPNControlListServiceStatus:
|
|
1209 |
return GetAPNControlListServiceStatus(aReqHandle,
|
|
1210 |
*static_cast<RMobilePhone::TAPNControlListServiceStatus*>(dataPtr));
|
|
1211 |
|
|
1212 |
case EMobilePhoneNotifyAPNControlListServiceStatusChange:
|
|
1213 |
return NotifyAPNControlListServiceStatusChange(aReqHandle,
|
|
1214 |
*static_cast<RMobilePhone::TAPNControlListServiceStatus*>(dataPtr));
|
|
1215 |
|
|
1216 |
case EMobilePhoneGetServiceTable:
|
|
1217 |
return GetServiceTable(aReqHandle,
|
|
1218 |
*static_cast<RMobilePhone::TMobilePhoneServiceTable*>(dataPtr),
|
|
1219 |
(aPckg.Des2n()));
|
|
1220 |
default:
|
|
1221 |
ReqCompleted(aReqHandle, KErrNotSupported);
|
|
1222 |
return KErrNone; // Real error value returned in completion of clients request
|
|
1223 |
}
|
|
1224 |
|
|
1225 |
}
|
|
1226 |
|
|
1227 |
TInt CSimPhone::CancelService(const TInt aIpc,const TTsyReqHandle aTsyReqHandle)
|
|
1228 |
/**
|
|
1229 |
* Cancel an outstanding request.
|
|
1230 |
* @param aIpc The IPC number of the request that must be cancelled. Note: this is not the
|
|
1231 |
* IPC number of the cancel request itself.
|
|
1232 |
* @param aTsyReqHandle The TSY Request Handle of the request to be cancelled.
|
|
1233 |
*/
|
|
1234 |
{
|
|
1235 |
switch(aIpc)
|
|
1236 |
{
|
|
1237 |
case EMobilePhoneNotifyIndicatorChange:
|
|
1238 |
iIndicator->NotifyIndicatorChangeCancel();
|
|
1239 |
break;
|
|
1240 |
|
|
1241 |
case EMobilePhoneNotifyBatteryInfoChange:
|
|
1242 |
iBatteryCharger->NotifyBatteryInfoCancel();
|
|
1243 |
break;
|
|
1244 |
|
|
1245 |
case EMobilePhoneNotifySignalStrengthChange:
|
|
1246 |
iSignalStrength->NotifySignalStrengthChangeCancel();
|
|
1247 |
break;
|
|
1248 |
|
|
1249 |
case EMobilePhoneNotifyNetworkRegistrationStatusChange:
|
|
1250 |
iNetworkStatus->NotifyNetworkRegistrationStatusChangeCancel();
|
|
1251 |
break;
|
|
1252 |
|
|
1253 |
case EMobilePhoneNotifyCurrentNetworkChange:
|
|
1254 |
iNetworkStatus->NotifyCurrentNetworkChangeCancel(aTsyReqHandle);
|
|
1255 |
break;
|
|
1256 |
|
|
1257 |
case EMobilePhoneNotifyCurrentNetworkNoLocationChange:
|
|
1258 |
iNetworkStatus->NotifyCurrentNetworkNoLocationChangeCancel(aTsyReqHandle);
|
|
1259 |
break;
|
|
1260 |
|
|
1261 |
case EMobilePhoneNotifyNITZInfoChange:
|
|
1262 |
iNetworkStatus->NotifyNITZInfoChangeCancel();
|
|
1263 |
break;
|
|
1264 |
|
|
1265 |
case EMobilePhoneNotifyCellInfoChange:
|
|
1266 |
iNetworkStatus->NotifyCellInfoChangeCancel(aTsyReqHandle);
|
|
1267 |
break;
|
|
1268 |
|
|
1269 |
case EMobilePhoneNotifyModeChange:
|
|
1270 |
NotifyModeChangeCancel(aTsyReqHandle);
|
|
1271 |
break;
|
|
1272 |
|
|
1273 |
|
|
1274 |
// Get Subscriber Info
|
|
1275 |
case EMobilePhoneSendDTMFTones:
|
|
1276 |
iDtmf->SendDTMFTonesCancel();
|
|
1277 |
break;
|
|
1278 |
|
|
1279 |
case EMobilePhoneNotifyStopInDTMFString:
|
|
1280 |
iDtmf->NotifyStopInDTMFStringCancel();
|
|
1281 |
break;
|
|
1282 |
|
|
1283 |
case EMobilePhoneNotifyDTMFCapsChange:
|
|
1284 |
iDtmf->NotifyDtmfCapsChangeCancel(aTsyReqHandle);
|
|
1285 |
break;
|
|
1286 |
|
|
1287 |
case EMobilePhoneNotifySecurityCapsChange:
|
|
1288 |
case EMobilePhoneGetLockInfo:
|
|
1289 |
case EMobilePhoneNotifyLockInfoChange:
|
|
1290 |
case EMobilePhoneSetLockSetting:
|
|
1291 |
case EMobilePhoneChangeSecurityCode:
|
|
1292 |
case EMobilePhoneNotifySecurityEvent:
|
|
1293 |
case EMobilePhoneVerifySecurityCode:
|
|
1294 |
case EMobilePhoneAbortSecurityCode:
|
|
1295 |
case EMobilePhoneGetSecurityCodeInfo:
|
|
1296 |
case EMobilePhoneNotifySecurityCodeInfoChange:
|
|
1297 |
return iPhoneSecurity->CancelService(aIpc,aTsyReqHandle);
|
|
1298 |
|
|
1299 |
//USim Application Support
|
|
1300 |
case EMobilePhoneEnumerateUSimApplications:
|
|
1301 |
case EMobilePhoneSetUSimApplicationStatus:
|
|
1302 |
case EMobilePhoneGetUSimApplicationsInfo:
|
|
1303 |
case EMobilePhoneNotifyUSimApplicationsInfoChange:
|
|
1304 |
if(iPhoneUSimApp->FoundUSimAppTags())
|
|
1305 |
{
|
|
1306 |
return iPhoneUSimApp->CancelService(aIpc,aTsyReqHandle);
|
|
1307 |
}
|
|
1308 |
else
|
|
1309 |
{
|
|
1310 |
return iPhoneSmartCardApp->CancelService(aIpc,aTsyReqHandle);
|
|
1311 |
}
|
|
1312 |
|
|
1313 |
//SmartCard Application Support
|
|
1314 |
case EMobilePhoneEnumerateSmartCardApplications:
|
|
1315 |
case EMobilePhoneGetSmartCardApplicationInfo:
|
|
1316 |
case EMobilePhoneSetSmartCardApplicationStatus:
|
|
1317 |
case EMobilePhoneNotifySmartCardApplicationInfoChange:
|
|
1318 |
case EMobilePhoneGetScFileInfo:
|
|
1319 |
case EMobilePhoneReadScFile:
|
|
1320 |
case EMobilePhoneUpdateScFile:
|
|
1321 |
if(iPhoneSmartCardApp->FoundScAppTags())
|
|
1322 |
{
|
|
1323 |
return iPhoneSmartCardApp->CancelService(aIpc,aTsyReqHandle);
|
|
1324 |
}
|
|
1325 |
else
|
|
1326 |
{
|
|
1327 |
return CPhoneBase::CancelService(aIpc,aTsyReqHandle);;
|
|
1328 |
}
|
|
1329 |
|
|
1330 |
|
|
1331 |
//USim/SmartCard Application Supoprt
|
|
1332 |
case EMobilePhoneGetCurrentActiveUSimApplication:
|
|
1333 |
case EMobilePhoneGetUSimAppsSelectionMode:
|
|
1334 |
case EMobilePhoneSetUSimAppsSelectionMode:
|
|
1335 |
case EMobilePhoneNotifyUSimAppsSelectionModeChange:
|
|
1336 |
if(iPhoneUSimApp->FoundUSimAppTags())
|
|
1337 |
{
|
|
1338 |
return iPhoneUSimApp->CancelService(aIpc,aTsyReqHandle);
|
|
1339 |
}
|
|
1340 |
else
|
|
1341 |
{
|
|
1342 |
return iPhoneSmartCardApp->CancelService(aIpc,aTsyReqHandle);
|
|
1343 |
}
|
|
1344 |
|
|
1345 |
|
|
1346 |
// CallBarring
|
|
1347 |
case EMobilePhoneSetCallBarringStatus:
|
|
1348 |
case EMobilePhoneSetCallBarringPassword:
|
|
1349 |
case EMobilePhoneNotifyCallBarringStatusChange:
|
|
1350 |
case EMobilePhoneGetBarringStatusPhase1:
|
|
1351 |
case EMobilePhoneGetBarringStatusPhase2:
|
|
1352 |
return iCallBarring->CancelService(aIpc, aTsyReqHandle);
|
|
1353 |
|
|
1354 |
// CallForwarding
|
|
1355 |
case EMobilePhoneSetCallForwardingStatus:
|
|
1356 |
case EMobilePhoneNotifyCallForwardingStatusChange:
|
|
1357 |
case EMobilePhoneGetIdentityServiceStatus:
|
|
1358 |
case EMobilePhoneGetCallForwardingStatusPhase1:
|
|
1359 |
case EMobilePhoneGetCallForwardingStatusPhase2:
|
|
1360 |
return iCallForwarding->CancelService(aIpc, aTsyReqHandle);
|
|
1361 |
|
|
1362 |
// CallWaiting
|
|
1363 |
case EMobilePhoneSetCallWaitingStatus:
|
|
1364 |
case EMobilePhoneNotifyCallWaitingStatusChange:
|
|
1365 |
case EMobilePhoneGetWaitingStatusPhase1:
|
|
1366 |
case EMobilePhoneGetWaitingStatusPhase2:
|
|
1367 |
return iCallWaiting->CancelService(aIpc, aTsyReqHandle);
|
|
1368 |
|
|
1369 |
//IMS Auth
|
|
1370 |
case EMobilePhoneNotifyImsAuthorizationInfoChanged:
|
|
1371 |
return iPhoneIMSAuth->NotifyImsAuthorizationInfoChangedCancel(aTsyReqHandle);
|
|
1372 |
|
|
1373 |
case EMobilePhoneAuthorizationInfoPhase1:
|
|
1374 |
case EMobilePhoneAuthorizationInfoPhase2:
|
|
1375 |
return iPhoneIMSAuth->GetAuthorizationInfoCancel(aTsyReqHandle);
|
|
1376 |
|
|
1377 |
case EMobilePhoneIMSAuthenticate:
|
|
1378 |
return iPhoneIMSAuth->GetAuthenticationDataCancel(aTsyReqHandle);
|
|
1379 |
|
|
1380 |
// Generic Smart Card Authenticate cancel
|
|
1381 |
case EMobilePhoneSmartCardAuthenticate:
|
|
1382 |
return iPhoneScAuth->GetScAuthenticationDataCancel(aTsyReqHandle);
|
|
1383 |
|
|
1384 |
// Access Point Name (APN)
|
|
1385 |
case EMobilePhoneEnumerateAPNEntries:
|
|
1386 |
case EMobilePhoneGetAPNname:
|
|
1387 |
case EMobilePhoneAppendAPNName:
|
|
1388 |
case EMobilePhoneDeleteAPNName:
|
|
1389 |
ReqCompleted(aTsyReqHandle, KErrNone);
|
|
1390 |
return KErrNone;
|
|
1391 |
case EMobilePhoneNotifyAPNListChanged:
|
|
1392 |
if (iAPNListNotify.iNotifyPending == TRUE)
|
|
1393 |
{
|
|
1394 |
iAPNListNotify.iNotifyPending = EFalse;
|
|
1395 |
ReqCompleted(iAPNListNotify.iNotifyHandle, KErrCancel);
|
|
1396 |
}
|
|
1397 |
return KErrNone;
|
|
1398 |
case EMobilePhoneSetAPNControlListServiceStatus:
|
|
1399 |
case EMobilePhoneGetAPNControlListServiceStatus:
|
|
1400 |
ReqCompleted(aTsyReqHandle, KErrNone);
|
|
1401 |
return KErrNone;
|
|
1402 |
case EMobilePhoneNotifyAPNControlListServiceStatusChange:
|
|
1403 |
if (iAPNStatusNotify.iNotifyPending == TRUE)
|
|
1404 |
{
|
|
1405 |
iAPNStatusNotify.iNotifyPending = EFalse;
|
|
1406 |
ReqCompleted(iAPNStatusNotify.iNotifyHandle, KErrCancel);
|
|
1407 |
}
|
|
1408 |
return KErrNone;
|
|
1409 |
case EMobilePhoneGetServiceTable:
|
|
1410 |
ReqCompleted(aTsyReqHandle, KErrNone);
|
|
1411 |
return KErrNone;
|
|
1412 |
|
|
1413 |
|
|
1414 |
case EMobilePhoneNotifyMessageWaiting:
|
|
1415 |
return iUsimRelease6->NotifyMessageWaitingCancel(aTsyReqHandle);
|
|
1416 |
|
|
1417 |
case EMobilePhoneNotifyIccMessageWaitingIndicatorsChange:
|
|
1418 |
return iUsimRelease6->NotifyIccMessageWaitingIndicatorsChangeCancel(aTsyReqHandle);
|
|
1419 |
|
|
1420 |
case EMobilePhoneNotifyMailboxNumbersChange:
|
|
1421 |
return iUsimRelease6->NotifyMailboxNumbersChangeCancel(aTsyReqHandle);
|
|
1422 |
|
|
1423 |
case EMobilePhoneNotifyWlanDataChange:
|
|
1424 |
return iUsimRelease6->NotifyWlanDataChangeCancel(aTsyReqHandle);
|
|
1425 |
|
|
1426 |
case EMobilePhoneNotifyPreferredWlanSIDListChange:
|
|
1427 |
return iUsimRelease6->NotifyPreferredWlanSIDListChangeCancel(aTsyReqHandle);
|
|
1428 |
|
|
1429 |
case EMobilePhoneNotifyStorePreferredNetworksListChange:
|
|
1430 |
return iUsimRelease6->NotifyStorePreferredNetworksListChangeCancel(aTsyReqHandle);
|
|
1431 |
|
|
1432 |
case EMobilePhoneGetPreferredNetworksPhase1:
|
|
1433 |
case EMobilePhoneGetPreferredNetworksPhase2:
|
|
1434 |
return iUsimRelease6->GetPreferredNetworksCancel(aTsyReqHandle);
|
|
1435 |
|
|
1436 |
case EMobilePhoneGetPreferredWlanSIDsPhase1:
|
|
1437 |
case EMobilePhoneGetPreferredWlanSIDsPhase2:
|
|
1438 |
return iUsimRelease6->GetPreferredWlanSIDsCancel(aTsyReqHandle);
|
|
1439 |
|
|
1440 |
case EMobilePhoneSetGbaBootstrapParams:
|
|
1441 |
return iUsimRelease6->SetGbaBootstrapParamsCancel(aTsyReqHandle);
|
|
1442 |
|
|
1443 |
case EMobilePhoneNotifyAuthenticateDataChange:
|
|
1444 |
return iUsimRelease6->NotifyAuthenticateDataChangeCancel(aTsyReqHandle);
|
|
1445 |
|
|
1446 |
case EMobilePhoneGetAuthenticationParams:
|
|
1447 |
return iUsimRelease6->GetAuthenticationParamsCancel(aTsyReqHandle);
|
|
1448 |
|
|
1449 |
case EMobilePhoneAuthenticationListPhase1:
|
|
1450 |
case EMobilePhoneAuthenticationListPhase2:
|
|
1451 |
return iUsimRelease6->GetAuthenticationListCancel(aTsyReqHandle);
|
|
1452 |
|
|
1453 |
// Default
|
|
1454 |
default:
|
|
1455 |
return CPhoneBase::CancelService(aIpc,aTsyReqHandle);
|
|
1456 |
}
|
|
1457 |
return KErrNone;
|
|
1458 |
}
|
|
1459 |
|
|
1460 |
CTelObject* CSimPhone::OpenNewObjectByNameL(const TDesC& aName)
|
|
1461 |
/**
|
|
1462 |
* This function will open a new LINE by name.
|
|
1463 |
* In reality the lines should be pre-constructed in the phone's two phase constructor,
|
|
1464 |
* so this will just return a pointer to the relevant line.
|
|
1465 |
*
|
|
1466 |
* @param aName the name of the line object to be opened
|
|
1467 |
* @return CTelObject pointer to the phone object created
|
|
1468 |
* @leave Leaves if incorrect phone name
|
|
1469 |
*/
|
|
1470 |
{
|
|
1471 |
LOGPHONE1(">>CSimPhone::OpenNewObjectByNameL");
|
|
1472 |
|
|
1473 |
// Is it a voice line?
|
|
1474 |
if (aName.CompareF(KVoiceLineName) == 0)
|
|
1475 |
{
|
|
1476 |
__ASSERT_ALWAYS(iVoiceLine!=NULL,SimPanic(ELineNotPreInstantiated));
|
|
1477 |
// Base class open.
|
|
1478 |
(void)iVoiceLine->Open();
|
|
1479 |
return iVoiceLine;
|
|
1480 |
}
|
|
1481 |
|
|
1482 |
// Is it a data line?
|
|
1483 |
else if (aName.CompareF(KDataLineName) == 0)
|
|
1484 |
{
|
|
1485 |
__ASSERT_ALWAYS(iDataLine!=NULL,SimPanic(ESubsessionNotPreInstantiated));
|
|
1486 |
// Base class open.
|
|
1487 |
(void)iDataLine->Open();
|
|
1488 |
return iDataLine;
|
|
1489 |
}
|
|
1490 |
|
|
1491 |
// Is it an SMS messaging class?
|
|
1492 |
else if (aName.CompareF(KETelSmsMessaging) == 0)
|
|
1493 |
{
|
|
1494 |
__ASSERT_ALWAYS(iSmsMessaging!=NULL,SimPanic(ESubsessionNotPreInstantiated));
|
|
1495 |
// Base class open.
|
|
1496 |
(void)iSmsMessaging->Open();
|
|
1497 |
return iSmsMessaging;
|
|
1498 |
}
|
|
1499 |
|
|
1500 |
else if (aName.CompareF(KPacketName) == 0)
|
|
1501 |
{
|
|
1502 |
__ASSERT_ALWAYS(iPacketService!=NULL,SimPanic(ESubsessionNotPreInstantiated));
|
|
1503 |
// Base class open.
|
|
1504 |
(void)iPacketService->Open();
|
|
1505 |
return iPacketService;
|
|
1506 |
}
|
|
1507 |
else if (aName.CompareF(KSatName) == 0)
|
|
1508 |
{
|
|
1509 |
__ASSERT_ALWAYS(iSat!=NULL,SimPanic(ESubsessionNotPreInstantiated));
|
|
1510 |
// Base class open.
|
|
1511 |
(void)iSat->Open();
|
|
1512 |
return iSat;
|
|
1513 |
}
|
|
1514 |
else if (aName.Left(SCEAP_SSN_LENGTH).Compare(KETelSmartCardEapSession) == 0)
|
|
1515 |
{
|
|
1516 |
// "num" is used for both lengths and error codes! saves on stack! :)
|
|
1517 |
|
|
1518 |
// Extracting AID
|
|
1519 |
RMobilePhone::TAID tempAID;
|
|
1520 |
// get number of AID bytes (each byte uses two chars)
|
|
1521 |
TInt num = CharToSeptNumL(aName[SCEAP_SSN_LENGTH]) * 2;
|
|
1522 |
// get the segment containing the AID
|
|
1523 |
TPtrC ptrAid = aName.Mid(SCEAP_SSN_LENGTH + 1, num);
|
|
1524 |
// convert AID to its correct binary value
|
|
1525 |
ConvertTextToBinary(ptrAid, tempAID);
|
|
1526 |
|
|
1527 |
// Extracting EapType
|
|
1528 |
RMobileSmartCardEap::TEapType eapType;
|
|
1529 |
// get position of EAP type's length
|
|
1530 |
TInt posTypeLength = SCEAP_SSN_LENGTH + num + 1;
|
|
1531 |
// get the value of the length of EAP type
|
|
1532 |
num = CharToSeptNumL(aName[posTypeLength]);
|
|
1533 |
// get the segment containing the EAP type
|
|
1534 |
TPtrC ptrEapT = aName.Mid(posTypeLength + 1, num);
|
|
1535 |
eapType.Copy(ptrEapT);
|
|
1536 |
|
|
1537 |
CTelObject* phoneScEap = iPhoneScEapMan->CreateScEapSubSessionL(tempAID, eapType);
|
|
1538 |
|
|
1539 |
if (phoneScEap == NULL)
|
|
1540 |
{
|
|
1541 |
LOGPHONE1("ERROR CSimSmartCardEap object not created, returning KErrGeneral");
|
|
1542 |
User::Leave(KErrGeneral);
|
|
1543 |
}
|
|
1544 |
|
|
1545 |
LOGPHONE2("CSimPhone::OpenNewObjectByNameL CSimSmartCardEap object created [0x%08x]", phoneScEap);
|
|
1546 |
return phoneScEap;
|
|
1547 |
} // End of opening Smart Card EAP sub-session
|
|
1548 |
else if (aName.CompareF(KETelOwnNumberStore) == 0)
|
|
1549 |
{
|
|
1550 |
if(iONStore==NULL)
|
|
1551 |
{
|
|
1552 |
LOGPHONE1("ERROR CSimONStore object not found. Please check config file.");
|
|
1553 |
User::Leave(KErrNotFound);
|
|
1554 |
}
|
|
1555 |
else
|
|
1556 |
{
|
|
1557 |
(void)iONStore->Open();
|
|
1558 |
return iONStore;
|
|
1559 |
}
|
|
1560 |
}
|
|
1561 |
// Is it a phonebook store?
|
|
1562 |
else
|
|
1563 |
{
|
|
1564 |
TInt i = 0;
|
|
1565 |
TBuf8<KMaxName> name;
|
|
1566 |
TInt tLength;
|
|
1567 |
TPtrC remain(aName);
|
|
1568 |
name.Copy(aName); // Do simple 16 bit to 8 bit conversion
|
|
1569 |
|
|
1570 |
if ((tLength=remain.Find(PHBOOK_DELIMITER))==KErrNotFound)
|
|
1571 |
{
|
|
1572 |
for(i=0;i<iPhBkStores->Count();i++)
|
|
1573 |
{
|
|
1574 |
if(name.MatchF(iPhBkStores->At(i)->Name())==0)
|
|
1575 |
{
|
|
1576 |
// Base class open.
|
|
1577 |
(void)iPhBkStores->At(i)->Open();
|
|
1578 |
return iPhBkStores->At(i);
|
|
1579 |
}
|
|
1580 |
}
|
|
1581 |
for(i=0;i<iPhBkUSimStores->Count();i++)
|
|
1582 |
{
|
|
1583 |
if((name.MatchF(iPhBkUSimStores->At(i)->Name())==0) &&
|
|
1584 |
(iPhBkUSimStores->At(i)->PhBkStore().Compare(KGsmPhoneBook)==0))
|
|
1585 |
|
|
1586 |
{
|
|
1587 |
(void)iPhBkUSimStores->At(i)->Open();
|
|
1588 |
return iPhBkUSimStores->At(i);
|
|
1589 |
}
|
|
1590 |
|
|
1591 |
}
|
|
1592 |
}
|
|
1593 |
else
|
|
1594 |
{
|
|
1595 |
TBuf8<KMaxName> PhBkName;
|
|
1596 |
TBuf8<KMaxName> PhBkStore;
|
|
1597 |
PhBkName.Copy(aName.Left(tLength));
|
|
1598 |
PhBkStore.Copy(aName.Right(aName.Length()-tLength-2));
|
|
1599 |
|
|
1600 |
for(TInt i=0;i<iPhBkUSimStores->Count();i++)
|
|
1601 |
{
|
|
1602 |
if((PhBkName.MatchF(iPhBkUSimStores->At(i)->Name())==0) &&
|
|
1603 |
(PhBkStore.MatchF(iPhBkUSimStores->At(i)->PhBkStore())==0))
|
|
1604 |
|
|
1605 |
{
|
|
1606 |
(void)iPhBkUSimStores->At(i)->Open();
|
|
1607 |
return iPhBkUSimStores->At(i);
|
|
1608 |
}
|
|
1609 |
|
|
1610 |
}
|
|
1611 |
}
|
|
1612 |
}
|
|
1613 |
// Not matched...
|
|
1614 |
User::Leave(KErrNotFound);
|
|
1615 |
return NULL;
|
|
1616 |
}
|
|
1617 |
|
|
1618 |
|
|
1619 |
CTelObject* CSimPhone::OpenNewObjectL(TDes& /*aNewName*/)
|
|
1620 |
/**
|
|
1621 |
* This function would open a new unnamed object,
|
|
1622 |
* but this functionality is not supported at the phone level.
|
|
1623 |
* All lines must be opened by name.
|
|
1624 |
*
|
|
1625 |
* @param aNewName a reference to the name of the phone object created
|
|
1626 |
* @return CTelObject a pointer to the phone object created
|
|
1627 |
* @leave Leaves if no memory is available
|
|
1628 |
*/
|
|
1629 |
{
|
|
1630 |
User::Leave(KErrNotSupported);
|
|
1631 |
return NULL;
|
|
1632 |
}
|
|
1633 |
|
|
1634 |
CTelObject::TReqMode CSimPhone::ReqModeL(const TInt aIpc)
|
|
1635 |
/**
|
|
1636 |
* This function returns the Request Mode for the request with the passed IPC value.
|
|
1637 |
* The ETel Server provides a function for returning the standard request modes for
|
|
1638 |
* the Core API requests.
|
|
1639 |
*/
|
|
1640 |
{
|
|
1641 |
TReqMode reqMode=0;
|
|
1642 |
switch(aIpc)
|
|
1643 |
{
|
|
1644 |
case EMobilePhoneGetPhoneStoreInfo:
|
|
1645 |
case EMobilePhoneGetSignalCaps:
|
|
1646 |
case EMobilePhoneGetSignalStrength:
|
|
1647 |
case EMobilePhoneGetNetworkCaps:
|
|
1648 |
case EMobilePhoneGetCurrentMode:
|
|
1649 |
|
|
1650 |
case EMobilePhoneNotifyModeChange:
|
|
1651 |
|
|
1652 |
case EMobilePhoneGetHomeNetwork:
|
|
1653 |
case EMobilePhoneGetCurrentNetwork:
|
|
1654 |
case EMobilePhoneGetCurrentNetworkNoLocation:
|
|
1655 |
case EMobilePhoneGetNetworkRegistrationStatus:
|
|
1656 |
case EMobilePhoneGetNITZInfo:
|
|
1657 |
case EMobilePhoneGetCellInfo:
|
|
1658 |
case EMobilePhoneGetSubscriberId:
|
|
1659 |
case EMobilePhoneGetDTMFCaps:
|
|
1660 |
case EMobilePhoneSendDTMFTones:
|
|
1661 |
case EMobilePhoneStartDTMFTone:
|
|
1662 |
case EMobilePhoneStopDTMFTone:
|
|
1663 |
case EMobilePhoneContinueDTMFStringSending:
|
|
1664 |
case EMobilePhoneGetMultimodeCaps:
|
|
1665 |
case EMobilePhoneGetIndicator:
|
|
1666 |
case EMobilePhoneGetIndicatorCaps:
|
|
1667 |
case EMobilePhoneGetBatteryInfo:
|
|
1668 |
case EMobilePhoneGetBatteryCaps:
|
|
1669 |
case EMobilePhoneGetIccAccessCaps:
|
|
1670 |
case EMobilePhoneGetSecurityCaps:
|
|
1671 |
case EMobilePhoneGetLockInfo:
|
|
1672 |
case EMobilePhoneSetLockSetting:
|
|
1673 |
case EMobilePhoneGetSecurityCodeInfo:
|
|
1674 |
case EMobilePhoneChangeSecurityCode:
|
|
1675 |
case EMobilePhoneVerifySecurityCode:
|
|
1676 |
case EMobilePhoneAbortSecurityCode:
|
|
1677 |
case EMobilePhoneEnumerateUSimApplications:
|
|
1678 |
case EMobilePhoneGetCurrentActiveUSimApplication:
|
|
1679 |
case EMobilePhoneSetUSimApplicationStatus:
|
|
1680 |
case EMobilePhoneGetUSimApplicationsInfo:
|
|
1681 |
case EMobilePhoneGetUSimAppsSelectionMode:
|
|
1682 |
case EMobilePhoneSetUSimAppsSelectionMode:
|
|
1683 |
case EMobilePhoneEnumerateSmartCardApplications:
|
|
1684 |
case EMobilePhoneGetSmartCardApplicationInfo:
|
|
1685 |
case EMobilePhoneSetSmartCardApplicationStatus:
|
|
1686 |
case EMobilePhoneGetScFileInfo:
|
|
1687 |
case EMobilePhoneReadScFile:
|
|
1688 |
case EMobilePhoneUpdateScFile:
|
|
1689 |
case EMobilePhoneSetCallBarringStatus:
|
|
1690 |
case EMobilePhoneSetCallBarringPassword:
|
|
1691 |
case EMobilePhoneGetBarringStatusPhase1:
|
|
1692 |
case EMobilePhoneGetBarringStatusPhase2:
|
|
1693 |
case EMobilePhoneSetCallForwardingStatus:
|
|
1694 |
case EMobilePhoneGetIdentityServiceStatus:
|
|
1695 |
case EMobilePhoneGetCallForwardingStatusPhase1:
|
|
1696 |
case EMobilePhoneGetCallForwardingStatusPhase2:
|
|
1697 |
case EMobilePhoneGetIdentityCaps:
|
|
1698 |
case EMobilePhoneGetPhoneId:
|
|
1699 |
case EMobilePhoneGetServiceProviderName:
|
|
1700 |
case EMobilePhoneGetNetworkName:
|
|
1701 |
case EMobilePhoneSetCallWaitingStatus:
|
|
1702 |
case EMobilePhoneGetWaitingStatusPhase1:
|
|
1703 |
case EMobilePhoneGetWaitingStatusPhase2:
|
|
1704 |
case EMobilePhoneAuthorizationInfoPhase1:
|
|
1705 |
case EMobilePhoneAuthorizationInfoPhase2:
|
|
1706 |
case EMobilePhoneIMSAuthenticate:
|
|
1707 |
case EMobilePhoneSmartCardAuthenticate:
|
|
1708 |
case EMobilePhoneGetMailboxNumbers:
|
|
1709 |
case EMobilePhoneGetIccMessageWaitingIndicators:
|
|
1710 |
case EMobilePhoneSetIccMessageWaitingIndicators:
|
|
1711 |
case EMobilePhoneGetWlanData:
|
|
1712 |
case EMobilePhoneSetWlanData:
|
|
1713 |
case EMobilePhoneGetPreferredWlanSIDsPhase1:
|
|
1714 |
case EMobilePhoneGetPreferredWlanSIDsPhase2:
|
|
1715 |
case EMobilePhoneStorePreferredWlanSIDList:
|
|
1716 |
case EMobilePhoneGetPreferredNetworksPhase1:
|
|
1717 |
case EMobilePhoneGetPreferredNetworksPhase2:
|
|
1718 |
case EMobilePhoneStorePreferredNetworksList:
|
|
1719 |
case EMobilePhoneSetGbaBootstrapParams:
|
|
1720 |
case EMobilePhoneGetAuthenticationParams:
|
|
1721 |
case EMobilePhoneNotifyAuthenticateDataChange:
|
|
1722 |
case EMobilePhoneAuthenticationListPhase1:
|
|
1723 |
case EMobilePhoneAuthenticationListPhase2:
|
|
1724 |
break;
|
|
1725 |
|
|
1726 |
// Service Tables
|
|
1727 |
case EMobilePhoneEnumerateAPNEntries:
|
|
1728 |
case EMobilePhoneGetAPNname:
|
|
1729 |
case EMobilePhoneAppendAPNName:
|
|
1730 |
case EMobilePhoneDeleteAPNName:
|
|
1731 |
case EMobilePhoneNotifyAPNListChanged:
|
|
1732 |
case EMobilePhoneSetAPNControlListServiceStatus:
|
|
1733 |
case EMobilePhoneGetAPNControlListServiceStatus:
|
|
1734 |
case EMobilePhoneNotifyAPNControlListServiceStatusChange:
|
|
1735 |
case EMobilePhoneGetServiceTable:
|
|
1736 |
break;
|
|
1737 |
|
|
1738 |
case EMobilePhoneNotifyIndicatorChange:
|
|
1739 |
case EMobilePhoneNotifyBatteryInfoChange:
|
|
1740 |
case EMobilePhoneNotifySignalStrengthChange:
|
|
1741 |
case EMobilePhoneNotifyNetworkRegistrationStatusChange:
|
|
1742 |
case EMobilePhoneNotifyCurrentNetworkChange:
|
|
1743 |
case EMobilePhoneNotifyCurrentNetworkNoLocationChange:
|
|
1744 |
case EMobilePhoneNotifyNITZInfoChange:
|
|
1745 |
case EMobilePhoneNotifyCellInfoChange:
|
|
1746 |
case EMobilePhoneNotifyDTMFCapsChange:
|
|
1747 |
case EMobilePhoneNotifyStopInDTMFString:
|
|
1748 |
case EMobilePhoneNotifySecurityEvent:
|
|
1749 |
case EMobilePhoneNotifySecurityCapsChange:
|
|
1750 |
case EMobilePhoneNotifyUSimApplicationsInfoChange:
|
|
1751 |
case EMobilePhoneNotifySmartCardApplicationInfoChange:
|
|
1752 |
case EMobilePhoneNotifyUSimAppsSelectionModeChange:
|
|
1753 |
case EMobilePhoneNotifyCallBarringStatusChange:
|
|
1754 |
case EMobilePhoneNotifyCallWaitingStatusChange:
|
|
1755 |
case EMobilePhoneNotifyCallForwardingStatusChange:
|
|
1756 |
case EMobilePhoneNotifyImsAuthorizationInfoChanged:
|
|
1757 |
case EMobilePhoneNotifyMailboxNumbersChange:
|
|
1758 |
case EMobilePhoneNotifyIccMessageWaitingIndicatorsChange:
|
|
1759 |
case EMobilePhoneNotifyMessageWaiting:
|
|
1760 |
case EMobilePhoneNotifyWlanDataChange:
|
|
1761 |
case EMobilePhoneNotifyPreferredWlanSIDListChange:
|
|
1762 |
case EMobilePhoneNotifyStorePreferredNetworksListChange:
|
|
1763 |
reqMode=KReqModeMultipleCompletionEnabled | KReqModeRePostImmediately;
|
|
1764 |
break;
|
|
1765 |
case EMobilePhoneNotifyLockInfoChange:
|
|
1766 |
case EMobilePhoneNotifySecurityCodeInfoChange:
|
|
1767 |
reqMode=KReqModeMultipleCompletionEnabled;
|
|
1768 |
break;
|
|
1769 |
default:
|
|
1770 |
reqMode=CPhoneBase::ReqModeL(aIpc);
|
|
1771 |
break;
|
|
1772 |
}
|
|
1773 |
return reqMode;
|
|
1774 |
}
|
|
1775 |
|
|
1776 |
TInt CSimPhone::RegisterNotification(const TInt /*aIpc*/)
|
|
1777 |
/**
|
|
1778 |
* The ETel Server calls this function when the first client makes a notification request.
|
|
1779 |
* If supported by the underlying protocol controlling the signalling stack,
|
|
1780 |
* this can be used to start requesting updates for the relevant service.
|
|
1781 |
* This function does nothing in this TSY.
|
|
1782 |
*
|
|
1783 |
* @param aIpc The Ipc representing the client notification request
|
|
1784 |
* @return KErrNone
|
|
1785 |
*/
|
|
1786 |
{
|
|
1787 |
return KErrNone;
|
|
1788 |
}
|
|
1789 |
|
|
1790 |
TInt CSimPhone::DeregisterNotification(const TInt /*aIpc*/)
|
|
1791 |
/**
|
|
1792 |
* The ETel Server calls this function when the last client that had previously
|
|
1793 |
* made a notification request closes its ETel Server handle. If supported by
|
|
1794 |
* the underlying protocol controlling the signalling stack, this can be used
|
|
1795 |
* to stop requesting updates for the relevant service.
|
|
1796 |
*
|
|
1797 |
* @param aIpc The Ipc representing the client notification request
|
|
1798 |
* @return KErrNone
|
|
1799 |
*/
|
|
1800 |
{
|
|
1801 |
return KErrNone;
|
|
1802 |
}
|
|
1803 |
|
|
1804 |
TInt CSimPhone::NumberOfSlotsL(const TInt aIpc)
|
|
1805 |
{
|
|
1806 |
switch(aIpc)
|
|
1807 |
{
|
|
1808 |
case EMobilePhoneNotifyIndicatorChange:
|
|
1809 |
case EMobilePhoneNotifyBatteryInfoChange:
|
|
1810 |
case EMobilePhoneNotifySignalStrengthChange:
|
|
1811 |
case EMobilePhoneNotifyCurrentNetworkChange:
|
|
1812 |
case EMobilePhoneNotifyCurrentNetworkNoLocationChange:
|
|
1813 |
case EMobilePhoneNotifyNetworkRegistrationStatusChange:
|
|
1814 |
case EMobilePhoneNotifyNITZInfoChange:
|
|
1815 |
case EMobilePhoneNotifyCellInfoChange:
|
|
1816 |
case EMobilePhoneNotifyStopInDTMFString:
|
|
1817 |
case EMobilePhoneNotifySecurityEvent:
|
|
1818 |
case EMobilePhoneNotifyUSimApplicationsInfoChange:
|
|
1819 |
case EMobilePhoneNotifySmartCardApplicationInfoChange:
|
|
1820 |
case EMobilePhoneNotifyUSimAppsSelectionModeChange:
|
|
1821 |
case EMobilePhoneNotifySecurityCapsChange:
|
|
1822 |
case EMobilePhoneNotifyCallBarringStatusChange:
|
|
1823 |
case EMobilePhoneNotifyCallForwardingStatusChange:
|
|
1824 |
case EMobilePhoneNotifyCallWaitingStatusChange:
|
|
1825 |
case EMobilePhoneNotifyImsAuthorizationInfoChanged:
|
|
1826 |
case EMobilePhoneNotifyMailboxNumbersChange:
|
|
1827 |
case EMobilePhoneNotifyIccMessageWaitingIndicatorsChange:
|
|
1828 |
case EMobilePhoneNotifyMessageWaiting:
|
|
1829 |
case EMobilePhoneNotifyWlanDataChange:
|
|
1830 |
case EMobilePhoneNotifyPreferredWlanSIDListChange:
|
|
1831 |
case EMobilePhoneNotifyStorePreferredNetworksListChange:
|
|
1832 |
return KDefaultNumberOfSlots;
|
|
1833 |
default:
|
|
1834 |
break;
|
|
1835 |
}
|
|
1836 |
return CPhoneBase::NumberOfSlotsL(aIpc);
|
|
1837 |
}
|
|
1838 |
|
|
1839 |
void CSimPhone::Init()
|
|
1840 |
/**
|
|
1841 |
* This function can be used to perform any necessary synchronous initialisation.
|
|
1842 |
*/
|
|
1843 |
{
|
|
1844 |
}
|
|
1845 |
|
|
1846 |
TInt CSimPhone::ControlledInitialisation(const TTsyReqHandle aTsyReqHandle)
|
|
1847 |
/**
|
|
1848 |
* This function can be used to start any necessary asynchronous initialisation.
|
|
1849 |
* In this TSY, there are no asynchronous initialisation procedures, so its empty.
|
|
1850 |
*/
|
|
1851 |
{
|
|
1852 |
iSimPhoneInitialise->Start(aTsyReqHandle);
|
|
1853 |
return KErrNone;
|
|
1854 |
}
|
|
1855 |
|
|
1856 |
TInt CSimPhone::ControlledInitialisationCancel(const TTsyReqHandle /*aTsyReqHandle*/)
|
|
1857 |
/**
|
|
1858 |
* Request to cancel the ::ControlledInitialisation function.
|
|
1859 |
* Since this TSY has no asynchronous initialisation procedures,
|
|
1860 |
* this function should never be called.
|
|
1861 |
*/
|
|
1862 |
{
|
|
1863 |
iSimPhoneInitialise->Cancel();
|
|
1864 |
return KErrNone;
|
|
1865 |
}
|
|
1866 |
|
|
1867 |
TInt CSimPhone::NotifyCapsChange(const TTsyReqHandle aTsyReqHandle, RPhone::TCaps* /*aCaps*/)
|
|
1868 |
/**
|
|
1869 |
* The phone caps will not change dynamically in this TSY as it is hardcoded,
|
|
1870 |
* so there is no chance of completing this request.
|
|
1871 |
*
|
|
1872 |
* @param aTsyReqHandle
|
|
1873 |
* @param aCaps a pointer to the phone capability
|
|
1874 |
* @return KErrNone
|
|
1875 |
*/
|
|
1876 |
{
|
|
1877 |
ReqCompleted(aTsyReqHandle, KErrNotSupported);
|
|
1878 |
return KErrNone;
|
|
1879 |
}
|
|
1880 |
|
|
1881 |
TInt CSimPhone::NotifyCapsChangeCancel(const TTsyReqHandle /*aTsyReqHandle*/)
|
|
1882 |
/**
|
|
1883 |
* Cancel the NotifyCapsChange request.
|
|
1884 |
*
|
|
1885 |
* @param aTsyReqHandle
|
|
1886 |
* @return KErrNone
|
|
1887 |
*/
|
|
1888 |
{
|
|
1889 |
return KErrNone;
|
|
1890 |
}
|
|
1891 |
|
|
1892 |
|
|
1893 |
|
|
1894 |
TInt CSimPhone::NotifyModemDetected(const TTsyReqHandle aTsyReqHandle, RPhone::TModemDetection* /*aDetection*/)
|
|
1895 |
/**
|
|
1896 |
* This request will be completed when the phone's connection status changes.
|
|
1897 |
* This function is not supported in this version of the TSY
|
|
1898 |
*/
|
|
1899 |
{
|
|
1900 |
ReqCompleted(aTsyReqHandle,KErrNotSupported);
|
|
1901 |
return KErrNone;
|
|
1902 |
}
|
|
1903 |
|
|
1904 |
TInt CSimPhone::NotifyModemDetectedCancel(const TTsyReqHandle /*aTsyReqHandle*/)
|
|
1905 |
/**
|
|
1906 |
* Cancel outstanding modem detection notification, by TSY handle
|
|
1907 |
* Returns KErrNone
|
|
1908 |
*/
|
|
1909 |
{
|
|
1910 |
return KErrNone;
|
|
1911 |
}
|
|
1912 |
|
|
1913 |
TInt CSimPhone::GetInfo(const TTsyReqHandle aTsyReqHandle, RPhone::TPhoneInfo* aPhoneInfo)
|
|
1914 |
/**
|
|
1915 |
* Retrieve the Phone Information
|
|
1916 |
* It should always return TModemDetection::EDetectedPresent
|
|
1917 |
*
|
|
1918 |
* @param aTsyReqHandle
|
|
1919 |
* @param aPhoneInfo pointer to the phone information to be returned to client
|
|
1920 |
* @return KErrNone
|
|
1921 |
*/
|
|
1922 |
{
|
|
1923 |
aPhoneInfo->iDetection=iModemDetection;
|
|
1924 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1925 |
return KErrNone;
|
|
1926 |
}
|
|
1927 |
|
|
1928 |
void CSimPhone::UpdateNetworkMode(RMobilePhone::TMobilePhoneNetworkMode aNetworkMode)
|
|
1929 |
{
|
|
1930 |
iNtwkMode = aNetworkMode;
|
|
1931 |
}
|
|
1932 |
|
|
1933 |
RMobilePhone::TMobilePhoneNetworkMode CSimPhone::NetworkMode()
|
|
1934 |
{
|
|
1935 |
return iNtwkMode;
|
|
1936 |
}
|
|
1937 |
|
|
1938 |
TInt CSimPhone::GetCurrentMode(TTsyReqHandle aReqHandle,TDes8* aPckg1)
|
|
1939 |
/**
|
|
1940 |
* Retrieve the Current Mode.
|
|
1941 |
* @param aReqHandle The request handle associated with this request.
|
|
1942 |
* @param aPckg1 The first parameter package. This will be populated with the
|
|
1943 |
* mode setting to be returned.
|
|
1944 |
* @return TInt Standard error value.
|
|
1945 |
*/
|
|
1946 |
{
|
|
1947 |
TPckg<RMobilePhone::TMobilePhoneNetworkMode>* modePckg=(TPckg<RMobilePhone::TMobilePhoneNetworkMode>*)aPckg1;
|
|
1948 |
RMobilePhone::TMobilePhoneNetworkMode& mode=(*modePckg)();
|
|
1949 |
|
|
1950 |
mode=iNtwkMode;
|
|
1951 |
ReqCompleted(aReqHandle,KErrNone);
|
|
1952 |
return KErrNone;
|
|
1953 |
}
|
|
1954 |
|
|
1955 |
TInt CSimPhone::GetCaps(const TTsyReqHandle aTsyReqHandle, RPhone::TCaps* aCaps)
|
|
1956 |
/**
|
|
1957 |
* Retrieve the phone capabilities
|
|
1958 |
*
|
|
1959 |
* @param aTsyReqHandle
|
|
1960 |
* @param aCaps a pointer to the Phone capability
|
|
1961 |
* @return KErrNone
|
|
1962 |
*/
|
|
1963 |
{
|
|
1964 |
aCaps->iFlags= RPhone::KCapsVoice | RPhone::KCapsData;
|
|
1965 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1966 |
return KErrNone;
|
|
1967 |
}
|
|
1968 |
|
|
1969 |
TInt CSimPhone::GetStatus(const TTsyReqHandle aTsyReqHandle, RPhone::TStatus* aStatus)
|
|
1970 |
/**
|
|
1971 |
* Retrieve the phone status.
|
|
1972 |
*
|
|
1973 |
* @param aTsyReqHandle
|
|
1974 |
* @param aStatus pointer to the phone status info.
|
|
1975 |
* @return KErrNone
|
|
1976 |
*/
|
|
1977 |
{
|
|
1978 |
aStatus->iModemDetected=iModemDetection;
|
|
1979 |
aStatus->iMode=iMode;
|
|
1980 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1981 |
return KErrNone;
|
|
1982 |
}
|
|
1983 |
|
|
1984 |
TInt CSimPhone::EnumerateLines(const TTsyReqHandle aTsyReqHandle, TInt* aParams)
|
|
1985 |
/**
|
|
1986 |
* Enumerate the lines
|
|
1987 |
* Returns 2 (for the voice and data lines) in the integer reference passed in
|
|
1988 |
* through its function argument.
|
|
1989 |
*
|
|
1990 |
* @param aTsyReqHandle
|
|
1991 |
* @param aParams pointer to the number of lines supported
|
|
1992 |
* @return KErrNone
|
|
1993 |
*/
|
|
1994 |
{
|
|
1995 |
*aParams = KNumberOfLines;
|
|
1996 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
1997 |
return KErrNone;
|
|
1998 |
}
|
|
1999 |
|
|
2000 |
TInt CSimPhone::GetLineInfo(const TTsyReqHandle aTsyReqHandle, TLineInfoIndex* aParams)
|
|
2001 |
/**
|
|
2002 |
* Gets the line info on the particular CSimLine object required.
|
|
2003 |
* Returns the current hook status, the current line status, name of last call created on
|
|
2004 |
* that line and the name of the call to which a new incoming call will be directed.
|
|
2005 |
* TLineInfoIndex specifies which lines' info is requested.
|
|
2006 |
*
|
|
2007 |
* @param aTsyReqHandle
|
|
2008 |
* @param aParam pointer to the line info
|
|
2009 |
* @return KErrNone
|
|
2010 |
*/
|
|
2011 |
{
|
|
2012 |
if (aParams->iIndex==KVoiceLineIndex)
|
|
2013 |
{
|
|
2014 |
aParams->iInfo.iStatus = (RCall::TStatus)iVoiceLine->iState;
|
|
2015 |
aParams->iInfo.iName = iVoiceLine->iLineName;
|
|
2016 |
aParams->iInfo.iLineCapsFlags = (RLine::KCapsVoice|RLine::KCapsEventIncomingCall);
|
|
2017 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
2018 |
}
|
|
2019 |
else if (aParams->iIndex==KDataLineIndex)
|
|
2020 |
{
|
|
2021 |
aParams->iInfo.iStatus = (RCall::TStatus)iDataLine->iState;
|
|
2022 |
aParams->iInfo.iName = iDataLine->iLineName;
|
|
2023 |
aParams->iInfo.iLineCapsFlags = (RLine::KCapsData|RLine::KCapsEventIncomingCall);
|
|
2024 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
2025 |
}
|
|
2026 |
else
|
|
2027 |
{
|
|
2028 |
ReqCompleted(aTsyReqHandle,KErrNotFound);
|
|
2029 |
}
|
|
2030 |
return KErrNone;
|
|
2031 |
}
|
|
2032 |
|
|
2033 |
TInt CSimPhone::GetPhoneStoreInfo(TTsyReqHandle aReqHandle,TDes8* aPckg1,TDes16* aPckg2)
|
|
2034 |
/**
|
|
2035 |
* Retrieve information about a named Phonebook Store.
|
|
2036 |
* @param aReqHandle The TSY request handle associated with this request.
|
|
2037 |
* @param aPckg1 The parameter package containing the index of the SMS Store for which
|
|
2038 |
* information is going to be retrieved.
|
|
2039 |
* @param aPckg2 The parameter package in which the retrieved SMS Store information will
|
|
2040 |
* be passed back to the client.
|
|
2041 |
* @return TInt Standard error value.
|
|
2042 |
*/
|
|
2043 |
{
|
|
2044 |
TPckg<RMobilePhoneStore::TMobilePhoneStoreInfoV1>* infoPckg=(TPckg<RMobilePhoneStore::TMobilePhoneStoreInfoV1>*)aPckg1;
|
|
2045 |
RMobilePhoneStore::TMobilePhoneStoreInfoV1& info=(*infoPckg)();
|
|
2046 |
|
|
2047 |
// Check that the data structure is supported by the simulated TSY version
|
|
2048 |
TInt err = CheckSimTsyVersion(info);
|
|
2049 |
if(err != KErrNone)
|
|
2050 |
{
|
|
2051 |
ReqCompleted(aReqHandle, err);
|
|
2052 |
return KErrNone;
|
|
2053 |
}
|
|
2054 |
|
|
2055 |
TInt i;
|
|
2056 |
for(i=0;i<iPhBkStores->Count();i++)
|
|
2057 |
{
|
|
2058 |
TBuf8<KMaxName> nBuf;
|
|
2059 |
nBuf.Copy(*aPckg2);
|
|
2060 |
if(iPhBkStores->At(i)->Name().MatchF(nBuf)==0)
|
|
2061 |
break;
|
|
2062 |
}
|
|
2063 |
|
|
2064 |
if(i==iPhBkStores->Count())
|
|
2065 |
{
|
|
2066 |
ReqCompleted(aReqHandle,KErrNotFound);
|
|
2067 |
return KErrNone;
|
|
2068 |
}
|
|
2069 |
|
|
2070 |
iPhBkStores->At(i)->PopulatePhBkStoreInfo(&info);
|
|
2071 |
ReqCompleted(aReqHandle,KErrNone);
|
|
2072 |
return KErrNone;
|
|
2073 |
}
|
|
2074 |
|
|
2075 |
TInt CSimPhone::GetPhoneStoreInfo(TTsyReqHandle aReqHandle,TDes8* aPckg1,
|
|
2076 |
RMobilePhone::TPhoneStoreNameAndIccType* aTable)
|
|
2077 |
/**
|
|
2078 |
* Retrieve information about a named Phonebook Store.
|
|
2079 |
* @param aReqHandle The TSY request handle associated with this request.
|
|
2080 |
* @param aPckg1 The parameter package containing the index of the PhoneBook Store for which
|
|
2081 |
* information is going to be retrieved.
|
|
2082 |
* @param aTable The parameter package in which the retrieved PhoneBook Store name and type information will
|
|
2083 |
* be passed from the client.
|
|
2084 |
* @return TInt Standard error value.
|
|
2085 |
*/
|
|
2086 |
{
|
|
2087 |
TBool found = EFalse;
|
|
2088 |
TPckg<RMobilePhoneStore::TMobilePhoneStoreInfoV1>* infoPckg=(TPckg<RMobilePhoneStore::TMobilePhoneStoreInfoV1>*)aPckg1;
|
|
2089 |
RMobilePhoneStore::TMobilePhoneStoreInfoV1& info=(*infoPckg)();
|
|
2090 |
|
|
2091 |
// Check that the data structure is supported by the simulated TSY version
|
|
2092 |
TInt err = CheckSimTsyVersion(info);
|
|
2093 |
if(err != KErrNone)
|
|
2094 |
{
|
|
2095 |
ReqCompleted(aReqHandle, err);
|
|
2096 |
return KErrNone;
|
|
2097 |
}
|
|
2098 |
|
|
2099 |
TBuf8<KMaxName> n1Buf,n2Buf;
|
|
2100 |
|
|
2101 |
n1Buf.Copy(aTable->iStoreName);
|
|
2102 |
n2Buf.Copy(aTable->iMode);
|
|
2103 |
|
|
2104 |
TInt i;
|
|
2105 |
|
|
2106 |
for(i=0;i<iPhBkUSimStores->Count();i++)
|
|
2107 |
{
|
|
2108 |
if((iPhBkUSimStores->At(i)->Name().MatchF(n1Buf)==0) &&
|
|
2109 |
(iPhBkUSimStores->At(i)->PhBkStore().MatchF(n2Buf)==0))
|
|
2110 |
{
|
|
2111 |
found = ETrue;
|
|
2112 |
break;
|
|
2113 |
}
|
|
2114 |
}
|
|
2115 |
|
|
2116 |
if(!found)
|
|
2117 |
{
|
|
2118 |
for(i=0;i<iPhBkStores->Count();i++)
|
|
2119 |
{
|
|
2120 |
if((iPhBkStores->At(i)->Name().MatchF(n1Buf)==0) &&
|
|
2121 |
n2Buf != KUSimPhoneBook)
|
|
2122 |
{
|
|
2123 |
found = ETrue;
|
|
2124 |
break;
|
|
2125 |
}
|
|
2126 |
}
|
|
2127 |
if(!found)
|
|
2128 |
{
|
|
2129 |
ReqCompleted(aReqHandle,KErrNotFound);
|
|
2130 |
return KErrNone;
|
|
2131 |
}
|
|
2132 |
else
|
|
2133 |
{
|
|
2134 |
iPhBkStores->At(i)->PopulatePhBkStoreInfo(&info);
|
|
2135 |
ReqCompleted(aReqHandle,KErrNone);
|
|
2136 |
}
|
|
2137 |
}
|
|
2138 |
else
|
|
2139 |
{
|
|
2140 |
if(iPhBkUSimStores->At(i)->CheckAndSwitchUSimApps()!=KErrNone)
|
|
2141 |
{
|
|
2142 |
ReqCompleted(aReqHandle, KErrNotFound);
|
|
2143 |
return KErrNone;
|
|
2144 |
}
|
|
2145 |
|
|
2146 |
iPhBkUSimStores->At(i)->PopulatePhBkStoreInfo(&info);
|
|
2147 |
ReqCompleted(aReqHandle,KErrNone);
|
|
2148 |
}
|
|
2149 |
return KErrNone;
|
|
2150 |
}
|
|
2151 |
|
|
2152 |
TInt CSimPhone::GetMultimodeCaps(const TTsyReqHandle aTsyReqHandle,TUint32* aCaps)
|
|
2153 |
/**
|
|
2154 |
* Retrieve the multimode capabilities of this TSY. This is hardcoded to support GSM, GPRS and CDMA.
|
|
2155 |
* @param aTsyReqHandle TSY Request Handle associated with this request.
|
|
2156 |
* @param aCaps The multimode capability structure to be populated with the result.
|
|
2157 |
* @return TInt Standard error value.
|
|
2158 |
*/
|
|
2159 |
{
|
|
2160 |
*aCaps = RMobilePhone::KCapsGsmSupported |
|
|
2161 |
RMobilePhone::KCapsGprsSupported |
|
|
2162 |
RMobilePhone::KCapsEapSupported |
|
|
2163 |
RMobilePhone::KCapsWcdmaSupported;
|
|
2164 |
|
|
2165 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
2166 |
|
|
2167 |
return KErrNone;
|
|
2168 |
}
|
|
2169 |
|
|
2170 |
TInt CSimPhone::GetIccAccessCaps(const TTsyReqHandle aTsyReqHandle,TUint32* aCaps)
|
|
2171 |
/**
|
|
2172 |
* Retrieve the access capabilities of this ICC using SimTSY. This is hardcoded to support SIM, RUIM and USIM.
|
|
2173 |
* @param aTsyReqHandle TSY Request Handle associated with this request.
|
|
2174 |
* @param aCaps The multimode capability structure to be populated with the result.
|
|
2175 |
* @return TInt Standard error value.
|
|
2176 |
*/
|
|
2177 |
{
|
|
2178 |
*aCaps = RMobilePhone::KCapsSimAccessSupported | RMobilePhone::KCapsRUimAccessSupported | RMobilePhone::KCapsUSimAccessSupported;
|
|
2179 |
ReqCompleted(aTsyReqHandle,KErrNone);
|
|
2180 |
|
|
2181 |
return KErrNone;
|
|
2182 |
}
|
|
2183 |
|
|
2184 |
TInt CSimPhone::GetSubscriberInfo(TTsyReqHandle aReqHandle,TDes8* aPckg1)
|
|
2185 |
/**
|
|
2186 |
* Retrieve the Subscriber Identifier.
|
|
2187 |
* @param aReqHandle The TSY request handle associated with this request.
|
|
2188 |
* @param aPckg1 The first parameter package. This will be populated with the
|
|
2189 |
* subscriber information.
|
|
2190 |
* @return TInt Standard error value.
|
|
2191 |
*/
|
|
2192 |
{
|
|
2193 |
TPckg<RMobilePhone::TMobilePhoneSubscriberId>* subscribePckg=(TPckg<RMobilePhone::TMobilePhoneSubscriberId>*)aPckg1;
|
|
2194 |
RMobilePhone::TMobilePhoneSubscriberId& subscribe=(*subscribePckg)();
|
|
2195 |
TInt ret = KErrNone;
|
|
2196 |
if (iSubscriberId.iError == KErrNone)
|
|
2197 |
{
|
|
2198 |
if(iSubscriberId.iIMSI.Length()>RMobilePhone::KIMSISize)
|
|
2199 |
{
|
|
2200 |
subscribe.Copy(iSubscriberId.iIMSI.Left(RMobilePhone::KIMSISize));
|
|
2201 |
}
|
|
2202 |
else
|
|
2203 |
{
|
|
2204 |
subscribe.Copy(iSubscriberId.iIMSI);
|
|
2205 |
}
|
|
2206 |
}
|
|
2207 |
else
|
|
2208 |
{
|
|
2209 |
ret = iSubscriberId.iError;
|
|
2210 |
}
|
|
2211 |
ReqCompleted(aReqHandle,ret);
|
|
2212 |
return KErrNone;
|
|
2213 |
}
|
|
2214 |
|
|
2215 |
const CTestConfigSection* CSimPhone::CfgFile()
|
|
2216 |
/**
|
|
2217 |
* Return a pointer to the Configuration File Section
|
|
2218 |
*
|
|
2219 |
* @return CTestConfigSection pointer to the configuration file section
|
|
2220 |
*/
|
|
2221 |
{
|
|
2222 |
return iConfigSection;
|
|
2223 |
}
|
|
2224 |
|
|
2225 |
const CTestConfigSection* CSimPhone::DefaultCfgFile()
|
|
2226 |
/**
|
|
2227 |
* Return a pointer to the Default Configuration File Section
|
|
2228 |
*
|
|
2229 |
* @return CTestConfigSection pointer to the default configuration file section
|
|
2230 |
*/
|
|
2231 |
{
|
|
2232 |
if( iConfigFile == NULL )
|
|
2233 |
{
|
|
2234 |
return NULL;
|
|
2235 |
}
|
|
2236 |
return iConfigFile->Section(KScriptDefaults);
|
|
2237 |
}
|
|
2238 |
|
|
2239 |
TInt CSimPhone::ValidateChangeState(CSimLine* aOriginatingLine, RMobileCall::TMobileCallStatus aState)
|
|
2240 |
/**
|
|
2241 |
* This function validates the proposed state change by using the iActiveLine
|
|
2242 |
* pointer member variable. If the proposed change of state would clash with
|
|
2243 |
* an existing call, the change is errored.
|
|
2244 |
* The function also updates the iMode state to reflect the new call state.
|
|
2245 |
*
|
|
2246 |
* @param aOriginatingLine pointer to the line requesting for the change of state
|
|
2247 |
* @param aState the state the aOriginatingLine wants to change to
|
|
2248 |
* @return Error indicates whether the change of state is successful or not
|
|
2249 |
*/
|
|
2250 |
{
|
|
2251 |
__ASSERT_ALWAYS(iMode!=RPhone::EModeUnknown,SimPanic(EPhoneModeUnknownIllegal));
|
|
2252 |
__ASSERT_ALWAYS(iNtwkMode!=RMobilePhone::ENetworkModeUnknown,SimPanic(ENetworkModeUnknownIllegal));
|
|
2253 |
|
|
2254 |
// If there is no active line defined, then any state changes are fine. However,
|
|
2255 |
// we need to watch for a shift to an "active" status.
|
|
2256 |
LOGPHONE1(">>CSimPhone::ValidateChangeState");
|
|
2257 |
if(!iActiveLine)
|
|
2258 |
{
|
|
2259 |
iMode=ConvertStateToMode(aState);
|
|
2260 |
if(IsStateActive(aState))
|
|
2261 |
iActiveLine=aOriginatingLine;
|
|
2262 |
// If a call is in progress, we may need to trigger NotifyIndicatorChange
|
|
2263 |
CheckIndicatorNotification();
|
|
2264 |
return KErrNone;
|
|
2265 |
}
|
|
2266 |
|
|
2267 |
// If this state change request is coming from the active line then any state changes
|
|
2268 |
// are ok, but we must watch for a change that would "deactivate" the line.
|
|
2269 |
if(iActiveLine==aOriginatingLine)
|
|
2270 |
{
|
|
2271 |
iMode=ConvertStateToMode(aState);
|
|
2272 |
if(!IsStateActive(aState))
|
|
2273 |
iActiveLine=NULL;
|
|
2274 |
// If a call is in progress, we may need to trigger NotifyIndicatorChange
|
|
2275 |
CheckIndicatorNotification();
|
|
2276 |
return KErrNone;
|
|
2277 |
}
|
|
2278 |
|
|
2279 |
// If we have got this far, then there is an active line, but this state change
|
|
2280 |
// request has not come from it. If this is the case, then a change to ringing
|
|
2281 |
// or Idle are the only valid state changes.
|
|
2282 |
|
|
2283 |
if((aState==RMobileCall::EStatusRinging) ||
|
|
2284 |
(aState==RMobileCall::EStatusIdle))
|
|
2285 |
return KErrNone;
|
|
2286 |
|
|
2287 |
LOGPHONE1("<<CSimPhone::ValidateChangeState");
|
|
2288 |
return KErrGeneral;
|
|
2289 |
}
|
|
2290 |
|
|
2291 |
TInt CSimPhone::FindActiveVoiceCall(CSimVoiceCall*& aCall)
|
|
2292 |
/**
|
|
2293 |
* Find an active voice call. Return KErrNotFound if no voice calls active.
|
|
2294 |
* @param aCall Pointer to active voice call.
|
|
2295 |
* @return TInt Standard return error.
|
|
2296 |
*/
|
|
2297 |
{
|
|
2298 |
return iVoiceLine->FindActiveVoiceCall(aCall);
|
|
2299 |
}
|
|
2300 |
|
|
2301 |
TInt CSimPhone::ValidateChangeState(RPacketService::TStatus aState)
|
|
2302 |
/**
|
|
2303 |
* This function validates the proposed state change by using the iActiveLine
|
|
2304 |
* pointer member variable. If the proposed change of state would clash with
|
|
2305 |
* an existing call, the change is errored.
|
|
2306 |
* The function also updates the iMode state to reflect the new call state.
|
|
2307 |
*
|
|
2308 |
* @param aOriginatingLine pointer to the line requesting for the change of state
|
|
2309 |
* @param aState the state the aOriginatingLine wants to change to
|
|
2310 |
* @return Error indicates whether the change of state is successful or not
|
|
2311 |
*/
|
|
2312 |
{
|
|
2313 |
LOGPHONE1(">>CSimPhone::ValidateChangeState packet");
|
|
2314 |
__ASSERT_ALWAYS(iMode!=RPhone::EModeUnknown,SimPanic(EPhoneModeUnknownIllegal));
|
|
2315 |
__ASSERT_ALWAYS(iNtwkMode!=RMobilePhone::ENetworkModeUnknown,SimPanic(ENetworkModeUnknownIllegal));
|
|
2316 |
__ASSERT_ALWAYS(iPacketService->MSClass()!=RPacketService::EMSClassUnknown,SimPanic(EPacketMSClassUnKnown));
|
|
2317 |
|
|
2318 |
//we must know the type of class the phone supports in order to determine what action to take.
|
|
2319 |
switch(iPacketService->MSClass())
|
|
2320 |
{
|
|
2321 |
case RPacketService::EMSClassDualMode: //< Active Simultaneous PS & CS calls supported (ClassA)
|
|
2322 |
return KErrNone;
|
|
2323 |
case RPacketService::EMSClassSuspensionRequired: //< Active CS & Suspended PS simultaneous calls supported (ClassB)
|
|
2324 |
if(iMode == RPhone::EModeIdle)
|
|
2325 |
return KErrNone;
|
|
2326 |
else if((aState == RPacketService::EStatusUnattached) || (aState == RPacketService::EStatusSuspended))
|
|
2327 |
return KErrNone;
|
|
2328 |
else return KErrNotSupported; //Should actually force a suspend of the packet context and service
|
|
2329 |
case RPacketService::EMSClassAlternateMode: //< Active CS or Active PS only call supported (ClassC)
|
|
2330 |
if(iMode == RPhone::EModeIdle)
|
|
2331 |
return KErrNone;
|
|
2332 |
else if(aState == RPacketService::EStatusUnattached)
|
|
2333 |
return KErrNone;
|
|
2334 |
else return KErrNotSupported;
|
|
2335 |
case RPacketService::EMSClassCircuitSwitchedOnly: //< Active CS only call supported (ClassC)
|
|
2336 |
return KErrNotSupported; //Should actually force a detach from the network if not in unattached state already
|
|
2337 |
case RPacketService::EMSClassPacketSwitchedOnly: //< Active PS only call supported (ClassC)
|
|
2338 |
return KErrNone; //Should disconnect all active calls if mode is not Idle.
|
|
2339 |
default:
|
|
2340 |
return KErrNotSupported;
|
|
2341 |
}
|
|
2342 |
}
|
|
2343 |
|
|
2344 |
RMobilePhone::TMobilePhoneBatteryStatus CSimPhone::BatteryStatus()
|
|
2345 |
{
|
|
2346 |
return iBatteryCharger->Status();
|
|
2347 |
}
|
|
2348 |
|
|
2349 |
RMobilePhone::TMobilePhoneRegistrationStatus CSimPhone::RegistrationStatus()
|
|
2350 |
{
|
|
2351 |
return iNetworkStatus->RegistrationStatus();
|
|
2352 |
}
|
|
2353 |
|
|
2354 |
void CSimPhone::CheckIndicatorNotification()
|
|
2355 |
{
|
|
2356 |
iIndicator->CheckNotification();
|
|
2357 |
}
|
|
2358 |
|
|
2359 |
/**
|
|
2360 |
* A utility function for checking whether the first pin on the phone
|
|
2361 |
* requires authentication
|
|
2362 |
*
|
|
2363 |
* @return TBool true if required and false if not
|
|
2364 |
*/
|
|
2365 |
TBool CSimPhone::IsICCLocked()
|
|
2366 |
{
|
|
2367 |
return iPhoneSecurity->IsICCLocked();
|
|
2368 |
}
|
|
2369 |
|
|
2370 |
/**
|
|
2371 |
* A utility function for checking whether the second pin on the phone
|
|
2372 |
* requires authentication
|
|
2373 |
*
|
|
2374 |
* @return TBool true if required and false if not
|
|
2375 |
*/
|
|
2376 |
TBool CSimPhone::IsPIN2Locked()
|
|
2377 |
{
|
|
2378 |
return iPhoneSecurity->IsPIN2Locked();
|
|
2379 |
}
|
|
2380 |
|
|
2381 |
TBool CSimPhone::IsHiddenEnabled()
|
|
2382 |
{
|
|
2383 |
return iPhoneSecurity->IsHiddenEnabled();
|
|
2384 |
}
|
|
2385 |
|
|
2386 |
void CSimPhone::SecurityEvent(RMobilePhone::TMobilePhoneSecurityEvent aEvent)
|
|
2387 |
{
|
|
2388 |
iPhoneSecurity->SecurityEvent(aEvent);
|
|
2389 |
}
|
|
2390 |
|
|
2391 |
RMobilePhone::TAID CSimPhone::GetActiveUSim()
|
|
2392 |
{
|
|
2393 |
if(iPhoneUSimApp->FoundUSimAppTags())
|
|
2394 |
{
|
|
2395 |
return iPhoneUSimApp->GetActiveUSim();
|
|
2396 |
}
|
|
2397 |
else
|
|
2398 |
{
|
|
2399 |
return iPhoneSmartCardApp->GetActiveUSim();
|
|
2400 |
}
|
|
2401 |
|
|
2402 |
}
|
|
2403 |
|
|
2404 |
RMobilePhone::TMobilePhoneSubscriberId CSimPhone::GetImsi()
|
|
2405 |
{
|
|
2406 |
return iSubscriberId.iIMSI;
|
|
2407 |
}
|
|
2408 |
void CSimPhone::GetPhoneIdAndCaps()
|
|
2409 |
{
|
|
2410 |
TPtrC8 imei, model, manufacturer, revision;
|
|
2411 |
const CTestConfigItem* item=CfgFile()->Item(KPhoneId);
|
|
2412 |
if (item)
|
|
2413 |
{
|
|
2414 |
TInt ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,manufacturer);
|
|
2415 |
if(ret!=KErrNone)
|
|
2416 |
LOGPARSERR("manufacturer",ret,0,&KPhoneId);
|
|
2417 |
ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,1,model);
|
|
2418 |
if(ret!=KErrNone)
|
|
2419 |
LOGPARSERR("model",ret,1,&KPhoneId);
|
|
2420 |
ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,2,revision);
|
|
2421 |
if(ret!=KErrNone)
|
|
2422 |
LOGPARSERR("revision",ret,2,&KPhoneId);
|
|
2423 |
ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,3,imei);
|
|
2424 |
if(ret!=KErrNone)
|
|
2425 |
LOGPARSERR("imei",ret,3,&KPhoneId);
|
|
2426 |
ret = CTestConfig::GetElement(item->Value(),KStdDelimiter,4,iPhoneId.iError);
|
|
2427 |
|
|
2428 |
iPhoneId.iManufacturerId.Copy(manufacturer);
|
|
2429 |
iPhoneId.iModelId.Copy(model);
|
|
2430 |
iPhoneId.iRevisionId.Copy(revision);
|
|
2431 |
iPhoneId.iSerialId.Copy(imei);
|
|
2432 |
}
|
|
2433 |
else
|
|
2434 |
{
|
|
2435 |
//set to default
|
|
2436 |
iPhoneId.iManufacturerId.Copy(KPhoneManufacturerDefault);
|
|
2437 |
iPhoneId.iModelId.Copy(KPhoneModelDefault);
|
|
2438 |
iPhoneId.iRevisionId.Copy(KPhoneRevesionDefault);
|
|
2439 |
iPhoneId.iSerialId.Copy(KPhoneSerialNumberDefault);
|
|
2440 |
iPhoneId.iError = KErrNone;
|
|
2441 |
}
|
|
2442 |
|
|
2443 |
//Set Phone Identity Caps
|
|
2444 |
iPhoneIdCaps = 0;
|
|
2445 |
if(iPhoneId.iManufacturerId.Length() > 0)
|
|
2446 |
iPhoneIdCaps |= RMobilePhone::KCapsGetManufacturer;
|
|
2447 |
|
|
2448 |
if(iPhoneId.iModelId.Length() > 0)
|
|
2449 |
iPhoneIdCaps |= RMobilePhone::KCapsGetModel;
|
|
2450 |
|
|
2451 |
if(iPhoneId.iRevisionId.Length() > 0)
|
|
2452 |
iPhoneIdCaps |= RMobilePhone::KCapsGetRevision;
|
|
2453 |
|
|
2454 |
if(iPhoneId.iSerialId.Length() > 0)
|
|
2455 |
iPhoneIdCaps |= RMobilePhone:: KCapsGetSerialNumber;
|
|
2456 |
|
|
2457 |
if(iSubscriberId.iIMSI.Length() > 0)
|
|
2458 |
iPhoneIdCaps |= RMobilePhone::KCapsGetSubscriberId;
|
|
2459 |
}
|
|
2460 |
|
|
2461 |
TInt CSimPhone::GetIdentityCaps(TTsyReqHandle aReqHandle, TUint32& aCaps)
|
|
2462 |
{
|
|
2463 |
aCaps = iPhoneIdCaps;
|
|
2464 |
ReqCompleted(aReqHandle,KErrNone);
|
|
2465 |
return KErrNone;
|
|
2466 |
}
|
|
2467 |
|
|
2468 |
/**
|
|
2469 |
* A utility function for checking whether a service is active in the service table
|
|
2470 |
*
|
|
2471 |
* @param aTable pointer to the table to be tested for active service
|
|
2472 |
* @param aOffset to pointer in the service table
|
|
2473 |
* @param aModifier which service to be tested for in the table
|
|
2474 |
* @return TBool true if active and false if not enabled
|
|
2475 |
*/
|
|
2476 |
TBool CSimPhone::ServiceEnabled(RMobilePhone::TMobilePhoneServiceTableV1* aTable,
|
|
2477 |
TInt aOffset,
|
|
2478 |
TUint8 aModifier)
|
|
2479 |
{
|
|
2480 |
if (aTable)
|
|
2481 |
{
|
|
2482 |
TUint8* pService = &(aTable->iServices1To8);
|
|
2483 |
TUint8 service = *(pService+aOffset);
|
|
2484 |
if (service & aModifier)
|
|
2485 |
{
|
|
2486 |
return true;
|
|
2487 |
}
|
|
2488 |
}
|
|
2489 |
return false;
|
|
2490 |
}
|
|
2491 |
|
|
2492 |
/**
|
|
2493 |
* An IPC support function for counting the number of entries in the Acces Point Name (APN) List
|
|
2494 |
*
|
|
2495 |
* @param aReqHandle handle to the IPC call used for completing the round trip
|
|
2496 |
* @param aIndex a pointer to some memory for storing the number of entries
|
|
2497 |
* @return TInt always returns KErrNone
|
|
2498 |
*/
|
|
2499 |
TInt CSimPhone::EnumerateAPNEntries(TTsyReqHandle aReqHandle, TUint32* aIndex)
|
|
2500 |
{
|
|
2501 |
if (IsICCLocked())
|
|
2502 |
{
|
|
2503 |
SYMBIAN_REQEXTERR(aReqHandle, KErrGsm0707SimPin1Required, KErrAccessDenied);
|
|
2504 |
return KErrNone;
|
|
2505 |
}
|
|
2506 |
|
|
2507 |
if (ServiceEnabled(iUSIMServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2508 |
{
|
|
2509 |
if (ServiceEnabled(iUSIMEnabledServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2510 |
{
|
|
2511 |
*aIndex = iAPNList.Count();
|
|
2512 |
ReqCompleted(aReqHandle,KErrNone);
|
|
2513 |
}
|
|
2514 |
else
|
|
2515 |
{
|
|
2516 |
SYMBIAN_REQEXTERR(aReqHandle,KErrMMEtelAPNEnabledServicesTableNotFound,KErrNotFound);
|
|
2517 |
}
|
|
2518 |
}
|
|
2519 |
else
|
|
2520 |
{
|
|
2521 |
SYMBIAN_REQEXTERR(aReqHandle,KErrMMEtelAPNNameACLNotFound,KErrNotSupported);
|
|
2522 |
}
|
|
2523 |
|
|
2524 |
return KErrNone;
|
|
2525 |
}
|
|
2526 |
|
|
2527 |
/**
|
|
2528 |
* An IPC support function for retrieving a name in the Acces Point Name (APN) List
|
|
2529 |
*
|
|
2530 |
* @param aReqHandle handle to the IPC call used for completing the round trip
|
|
2531 |
* @param aIndex a index into the APN List for the name to be retrieved
|
|
2532 |
* @param aRetrieved a TAPNEntryV3Pckg to store the name from the APN List
|
|
2533 |
* @return TInt always returns KErrNone
|
|
2534 |
*/
|
|
2535 |
TInt CSimPhone::GetAPNname( TTsyReqHandle aReqHandle,
|
|
2536 |
TUint32& aIndex,
|
|
2537 |
RMobilePhone::TAPNEntryV3Pckg& aRetrieved)
|
|
2538 |
{
|
|
2539 |
if (IsICCLocked())
|
|
2540 |
{
|
|
2541 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrGsm0707SimPin1Required, KErrAccessDenied));
|
|
2542 |
return KErrNone;
|
|
2543 |
}
|
|
2544 |
|
|
2545 |
if (ServiceEnabled(iUSIMServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2546 |
{
|
|
2547 |
if (ServiceEnabled(iUSIMEnabledServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2548 |
{
|
|
2549 |
if (aIndex < iAPNList.Count() )
|
|
2550 |
{
|
|
2551 |
RMobilePhone::TAPNEntryV3& tAPNEntryV3 = aRetrieved();
|
|
2552 |
|
|
2553 |
tAPNEntryV3.iApn.Zero();
|
|
2554 |
tAPNEntryV3.iApn.Insert(0,iAPNList[aIndex].iApn);
|
|
2555 |
|
|
2556 |
ReqCompleted(aReqHandle,KErrNone);
|
|
2557 |
}
|
|
2558 |
else
|
|
2559 |
{
|
|
2560 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR(KErrMMEtelAPNNameInvalidIndex,KErrNotFound));
|
|
2561 |
}
|
|
2562 |
}
|
|
2563 |
else
|
|
2564 |
{
|
|
2565 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelAPNEnabledServicesTableNotFound,
|
|
2566 |
KErrNotFound));
|
|
2567 |
}
|
|
2568 |
}
|
|
2569 |
else
|
|
2570 |
{
|
|
2571 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelAPNNameACLNotFound,
|
|
2572 |
KErrNotSupported));
|
|
2573 |
}
|
|
2574 |
return KErrNone;
|
|
2575 |
}
|
|
2576 |
|
|
2577 |
/**
|
|
2578 |
* An IPC support function for adding a name to the Acces Point Name (APN) List
|
|
2579 |
*
|
|
2580 |
* @param aReqHandle handle to the IPC call used for completing the round trip
|
|
2581 |
* @param aIndex a index into the APN List for the name to be retrieved
|
|
2582 |
* @param aEntry a TAPNEntryV3Pckg to add to the end of the APN List
|
|
2583 |
* @return TInt always returns KErrNone
|
|
2584 |
*/
|
|
2585 |
TInt CSimPhone::AppendAPNName(TTsyReqHandle aReqHandle, RMobilePhone::TAPNEntryV3Pckg& aEntry)
|
|
2586 |
{
|
|
2587 |
if (IsPIN2Locked())
|
|
2588 |
{
|
|
2589 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrGsm0707SimPin2Required, KErrAccessDenied));
|
|
2590 |
return KErrNone;
|
|
2591 |
}
|
|
2592 |
|
|
2593 |
if (ServiceEnabled(iUSIMServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2594 |
{
|
|
2595 |
if (ServiceEnabled(iUSIMEnabledServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2596 |
{
|
|
2597 |
RMobilePhone::TAPNEntryV3& entry = (aEntry)();
|
|
2598 |
iAPNList.Append(entry);
|
|
2599 |
|
|
2600 |
ReqCompleted(aReqHandle,KErrNone);
|
|
2601 |
|
|
2602 |
if (iAPNListNotify.iNotifyPending == TRUE)
|
|
2603 |
{
|
|
2604 |
iAPNListNotify.iNotifyPending = EFalse;
|
|
2605 |
ReqCompleted(iAPNListNotify.iNotifyHandle,KErrNone);
|
|
2606 |
}
|
|
2607 |
}
|
|
2608 |
else
|
|
2609 |
{
|
|
2610 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelAPNEnabledServicesTableNotFound,
|
|
2611 |
KErrNotFound));
|
|
2612 |
}
|
|
2613 |
}
|
|
2614 |
else
|
|
2615 |
{
|
|
2616 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelAPNNameACLNotFound,
|
|
2617 |
KErrNotSupported));
|
|
2618 |
}
|
|
2619 |
|
|
2620 |
return KErrNone;
|
|
2621 |
}
|
|
2622 |
|
|
2623 |
/**
|
|
2624 |
* An IPC support function for removing a name from the Acces Point Name (APN) List
|
|
2625 |
*
|
|
2626 |
* @param aReqHandle handle to the IPC call used for completing the round trip
|
|
2627 |
* @param aIndex a index into the APN List for the name to be deleted
|
|
2628 |
* @return TInt always returns KErrNone
|
|
2629 |
*/
|
|
2630 |
TInt CSimPhone::DeleteAPNName(TTsyReqHandle aReqHandle, TUint32& aIndex)
|
|
2631 |
{
|
|
2632 |
if (IsPIN2Locked())
|
|
2633 |
{
|
|
2634 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrGsm0707SimPin2Required, KErrAccessDenied));
|
|
2635 |
return KErrNone;
|
|
2636 |
}
|
|
2637 |
|
|
2638 |
if (ServiceEnabled(iUSIMServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2639 |
{
|
|
2640 |
if (ServiceEnabled(iUSIMEnabledServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2641 |
{
|
|
2642 |
if (aIndex < iAPNList.Count())
|
|
2643 |
{
|
|
2644 |
iAPNList.Remove(aIndex);
|
|
2645 |
iAPNList.Compress();
|
|
2646 |
ReqCompleted(aReqHandle,KErrNone);
|
|
2647 |
if (iAPNListNotify.iNotifyPending == TRUE)
|
|
2648 |
{
|
|
2649 |
iAPNListNotify.iNotifyPending = EFalse;
|
|
2650 |
ReqCompleted(iAPNListNotify.iNotifyHandle,KErrNone);
|
|
2651 |
}
|
|
2652 |
}
|
|
2653 |
else
|
|
2654 |
{
|
|
2655 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR(KErrMMEtelAPNNameInvalidIndex,KErrNotFound));
|
|
2656 |
}
|
|
2657 |
}
|
|
2658 |
else
|
|
2659 |
{
|
|
2660 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelAPNEnabledServicesTableNotFound,
|
|
2661 |
KErrNotFound));
|
|
2662 |
}
|
|
2663 |
}
|
|
2664 |
else
|
|
2665 |
{
|
|
2666 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelAPNNameACLNotFound,
|
|
2667 |
KErrNotSupported));
|
|
2668 |
}
|
|
2669 |
return KErrNone;
|
|
2670 |
}
|
|
2671 |
|
|
2672 |
/**
|
|
2673 |
* An IPC support function for registering interest in APN List changes
|
|
2674 |
*
|
|
2675 |
* @param aReqHandle handle to the IPC call used for completing the round trip
|
|
2676 |
* @return TInt always returns KErrNone
|
|
2677 |
*/
|
|
2678 |
TInt CSimPhone::NotifyAPNListChanged(TTsyReqHandle aReqHandle)
|
|
2679 |
{
|
|
2680 |
if (ServiceEnabled(iUSIMServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2681 |
{
|
|
2682 |
if (ServiceEnabled(iUSIMEnabledServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2683 |
{
|
|
2684 |
iAPNListNotify.iNotifyPending = ETrue;
|
|
2685 |
iAPNListNotify.iNotifyHandle = aReqHandle;
|
|
2686 |
}
|
|
2687 |
else
|
|
2688 |
{
|
|
2689 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelAPNEnabledServicesTableNotFound,
|
|
2690 |
KErrNotFound));
|
|
2691 |
}
|
|
2692 |
}
|
|
2693 |
else
|
|
2694 |
{
|
|
2695 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelAPNNameACLNotFound,
|
|
2696 |
KErrNotSupported));
|
|
2697 |
}
|
|
2698 |
return KErrNone;
|
|
2699 |
}
|
|
2700 |
|
|
2701 |
/**
|
|
2702 |
* An IPC support function for switching the Acces Point Name (APN) List to enabled or disabled
|
|
2703 |
*
|
|
2704 |
* @param aReqHandle handle to the IPC call used for completing the round trip
|
|
2705 |
* @param aAPNControlListServiceStatus service status to be set
|
|
2706 |
* @return TInt always returns KErrNone
|
|
2707 |
*/
|
|
2708 |
TInt CSimPhone::SetAPNControlListServiceStatus(TTsyReqHandle aReqHandle,
|
|
2709 |
RMobilePhone::TAPNControlListServiceStatus& aAPNControlListServiceStatus)
|
|
2710 |
{
|
|
2711 |
if (IsPIN2Locked())
|
|
2712 |
{
|
|
2713 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrGsm0707SimPin2Required, KErrAccessDenied));
|
|
2714 |
return KErrNone;
|
|
2715 |
}
|
|
2716 |
|
|
2717 |
if (ServiceEnabled(iUSIMServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2718 |
{
|
|
2719 |
switch (aAPNControlListServiceStatus)
|
|
2720 |
{
|
|
2721 |
case RMobilePhone::EAPNControlListServiceDisabled:
|
|
2722 |
{
|
|
2723 |
if (iUSIMEnabledServiceTable)
|
|
2724 |
{
|
|
2725 |
iUSIMEnabledServiceTable->iServices33To40 =
|
|
2726 |
(iUSIMEnabledServiceTable->iServices33To40 & RMobilePhone::KUstACL)
|
|
2727 |
^ iUSIMEnabledServiceTable->iServices33To40;
|
|
2728 |
|
|
2729 |
ReqCompleted(aReqHandle,KErrNone);
|
|
2730 |
if (iAPNStatusNotify.iNotifyPending == TRUE)
|
|
2731 |
{
|
|
2732 |
*static_cast<RMobilePhone::TAPNControlListServiceStatus*>(iAPNStatusNotify.iNotifyData) =
|
|
2733 |
RMobilePhone::EAPNControlListServiceDisabled;
|
|
2734 |
iAPNStatusNotify.iNotifyPending = EFalse;
|
|
2735 |
ReqCompleted(iAPNStatusNotify.iNotifyHandle,KErrNone);
|
|
2736 |
}
|
|
2737 |
}
|
|
2738 |
else
|
|
2739 |
{
|
|
2740 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelAPNEnabledServicesTableNotFound,
|
|
2741 |
KErrNotSupported));
|
|
2742 |
}
|
|
2743 |
}
|
|
2744 |
break;
|
|
2745 |
case RMobilePhone::EAPNControlListServiceEnabled:
|
|
2746 |
{
|
|
2747 |
if (iUSIMEnabledServiceTable)
|
|
2748 |
{
|
|
2749 |
iUSIMEnabledServiceTable->iServices33To40 |= RMobilePhone::KUstACL;
|
|
2750 |
ReqCompleted(aReqHandle,KErrNone);
|
|
2751 |
if (iAPNStatusNotify.iNotifyPending == TRUE)
|
|
2752 |
{
|
|
2753 |
*static_cast<RMobilePhone::TAPNControlListServiceStatus*>(iAPNStatusNotify.iNotifyData) =
|
|
2754 |
RMobilePhone::EAPNControlListServiceEnabled;
|
|
2755 |
iAPNStatusNotify.iNotifyPending = EFalse;
|
|
2756 |
ReqCompleted(iAPNStatusNotify.iNotifyHandle,KErrNone);
|
|
2757 |
}
|
|
2758 |
}
|
|
2759 |
else
|
|
2760 |
{
|
|
2761 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelAPNEnabledServicesTableNotFound,
|
|
2762 |
KErrNotSupported));
|
|
2763 |
}
|
|
2764 |
}
|
|
2765 |
break;
|
|
2766 |
default:
|
|
2767 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelFormatNotSupported,
|
|
2768 |
KErrNotFound));
|
|
2769 |
}
|
|
2770 |
}
|
|
2771 |
else
|
|
2772 |
{
|
|
2773 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelAPNEnabledServicesTableNotFound,
|
|
2774 |
KErrNotSupported));
|
|
2775 |
}
|
|
2776 |
return KErrNone;
|
|
2777 |
}
|
|
2778 |
|
|
2779 |
/**
|
|
2780 |
* An IPC support function for retrieving the Acces Point Name (APN) List enabled/ disabled
|
|
2781 |
* status
|
|
2782 |
*
|
|
2783 |
* @param aReqHandle handle to the IPC call used for completing the round trip
|
|
2784 |
* @param aAPNControlListServiceStatus memory for storing the current status for the user
|
|
2785 |
* @return TInt always returns KErrNone
|
|
2786 |
*/
|
|
2787 |
TInt CSimPhone::GetAPNControlListServiceStatus(TTsyReqHandle aReqHandle,
|
|
2788 |
RMobilePhone::TAPNControlListServiceStatus& aAPNControlListServiceStatus)
|
|
2789 |
{
|
|
2790 |
if (IsICCLocked())
|
|
2791 |
{
|
|
2792 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrGsm0707SimPin1Required, KErrAccessDenied));
|
|
2793 |
return KErrNone;
|
|
2794 |
}
|
|
2795 |
|
|
2796 |
if (ServiceEnabled(iUSIMServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2797 |
{
|
|
2798 |
if (ServiceEnabled(iUSIMEnabledServiceTable,iAPNServiceOffset,RMobilePhone::KUstACL))
|
|
2799 |
{
|
|
2800 |
aAPNControlListServiceStatus = RMobilePhone::EAPNControlListServiceEnabled;
|
|
2801 |
}
|
|
2802 |
else
|
|
2803 |
{
|
|
2804 |
aAPNControlListServiceStatus = RMobilePhone::EAPNControlListServiceDisabled;
|
|
2805 |
}
|
|
2806 |
ReqCompleted(aReqHandle,KErrNone);
|
|
2807 |
}
|
|
2808 |
else
|
|
2809 |
{
|
|
2810 |
ReqCompleted(aReqHandle,SYMBIAN_EXTERR( KErrMMEtelAPNEnabledServicesTableNotFound,
|
|
2811 |
KErrNotSupported));
|
|
2812 |
}
|
|
2813 |
return KErrNone;
|
|
2814 |
}
|
|
2815 |
|
|
2816 |
/**
|
|
2817 |
* An IPC support function for registering interest in the Acces Point Name (APN) List
|
|
2818 |
* enabled/ disabled status changing
|
|
2819 |
*
|
|
2820 |
* @param aReqHandle handle to the IPC call used for completing the round trip
|
|
2821 |
* @param aAPNControlListServiceStatus memory for storing the current status for the user
|
|
2822 |
* @return TInt always returns KErrNone
|
|
2823 |
*/
|
|
2824 |
TInt CSimPhone::NotifyAPNControlListServiceStatusChange(TTsyReqHandle aReqHandle,
|
|
2825 |
RMobilePhone::TAPNControlListServiceStatus& aAPNControlListServiceStatus)
|
|
2826 |
{
|
|
2827 |
iAPNStatusNotify.iNotifyPending = ETrue;
|
|
2828 |
iAPNStatusNotify.iNotifyHandle = aReqHandle;
|
|
2829 |
iAPNStatusNotify.iNotifyData = &aAPNControlListServiceStatus;
|
|
2830 |
return KErrNone;
|
|
2831 |
}
|
|
2832 |
|
|
2833 |
/**
|
|
2834 |
* A utility function for checking table availabilty and performing a copy on it
|
|
2835 |
*
|
|
2836 |
* @param aFrom The TMobilePhoneServiceTableV1 table to copied out of
|
|
2837 |
* @param aTo The TMobilePhoneServiceTableV1 table to copied into
|
|
2838 |
* @return TInt returns KErrNone for success and KErrNotSupported if the table aren't
|
|
2839 |
* valid
|
|
2840 |
*/
|
|
2841 |
TInt CSimPhone::CopyServiceTable(RMobilePhone::TMobilePhoneServiceTableV1* aFrom,
|
|
2842 |
RMobilePhone::TMobilePhoneServiceTableV1* aTo)
|
|
2843 |
{
|
|
2844 |
if (aFrom && aTo)
|
|
2845 |
{
|
|
2846 |
*aTo = *aFrom;
|
|
2847 |
return KErrNone;
|
|
2848 |
}
|
|
2849 |
else
|
|
2850 |
{
|
|
2851 |
// This value is returned because this function tests the existance of the table
|
|
2852 |
// not just that the args are OK.
|
|
2853 |
return SYMBIAN_EXTERR(KErrMMEtelAPNEnabledServicesTableNotFound, KErrNotSupported);
|
|
2854 |
}
|
|
2855 |
}
|
|
2856 |
|
|
2857 |
/**
|
|
2858 |
* A utility function for checking table availabilty and performing a copy on it
|
|
2859 |
*
|
|
2860 |
* @param aFrom The TMobilePhoneServiceTableV8 table to copied out of
|
|
2861 |
* @param aTo The TMobilePhoneServiceTableV8 table to copied into
|
|
2862 |
* @return TInt returns KErrNone for success and KErrNotSupported if the table aren't
|
|
2863 |
* valid
|
|
2864 |
*/
|
|
2865 |
TInt CSimPhone::CopyServiceTableV8(RMobilePhone::TMobilePhoneServiceTableV8* aFrom,
|
|
2866 |
RMobilePhone::TMobilePhoneServiceTableV8* aTo)
|
|
2867 |
{
|
|
2868 |
if (aFrom && aTo)
|
|
2869 |
{
|
|
2870 |
*aTo = *aFrom;
|
|
2871 |
return KErrNone;
|
|
2872 |
}
|
|
2873 |
else
|
|
2874 |
{
|
|
2875 |
// This value is returned because this function tests the existance of the table
|
|
2876 |
// not just that the args are OK.
|
|
2877 |
return SYMBIAN_EXTERR(KErrMMEtelAPNEnabledServicesTableNotFound, KErrNotSupported);
|
|
2878 |
}
|
|
2879 |
}
|
|
2880 |
|
|
2881 |
/**
|
|
2882 |
* An IPC support function for retrieving one of the service tables
|
|
2883 |
*
|
|
2884 |
* @param aReqHandle handle to the IPC call used for completing the round trip
|
|
2885 |
* @param aTable the type of table the user has interest in
|
|
2886 |
* @param aPCmd memory to store the retrieved table
|
|
2887 |
* @return TInt always returns KErrNone
|
|
2888 |
*/
|
|
2889 |
TInt CSimPhone::GetServiceTable(TTsyReqHandle aReqHandle,
|
|
2890 |
RMobilePhone::TMobilePhoneServiceTable aTable,
|
|
2891 |
TDes8* aPCmd)
|
|
2892 |
{
|
|
2893 |
TInt ret = KErrNone;
|
|
2894 |
RMobilePhone::TMobilePhoneServiceTableV1Pckg *pTablePckg = (RMobilePhone::TMobilePhoneServiceTableV1Pckg*) aPCmd;
|
|
2895 |
RMobilePhone::TMobilePhoneServiceTableV1 &aSst = (*pTablePckg)();
|
|
2896 |
|
|
2897 |
switch (aTable)
|
|
2898 |
{
|
|
2899 |
|
|
2900 |
/** Retrieve SIM service table from active SIM application on UICC.
|
|
2901 |
Modes: GSM/WCDMA */
|
|
2902 |
case RMobilePhone::ESIMServiceTable:
|
|
2903 |
ret = CopyServiceTable (iSIMServiceTable, &aSst);
|
|
2904 |
break;
|
|
2905 |
/** Retrieve USIM service table from active USIM application on UICC.
|
|
2906 |
|
|
2907 |
Modes: WCDMA */
|
|
2908 |
case RMobilePhone::EUSIMServiceTable:
|
|
2909 |
if ( aSst.ExtensionId ()== KEtelExtMultimodeV8)
|
|
2910 |
{
|
|
2911 |
RMobilePhone::TMobilePhoneServiceTableV8Pckg* pTableV8Pckg = (RMobilePhone::TMobilePhoneServiceTableV8Pckg*) aPCmd;
|
|
2912 |
RMobilePhone::TMobilePhoneServiceTableV8 &pTableV8 = (*pTableV8Pckg) ();
|
|
2913 |
ret = CopyServiceTableV8 (iUSIMServiceTableV8, &pTableV8);
|
|
2914 |
}
|
|
2915 |
else
|
|
2916 |
{
|
|
2917 |
ret = CopyServiceTable (iUSIMServiceTable, &aSst);
|
|
2918 |
}
|
|
2919 |
break;
|
|
2920 |
/** USIM Enabled Services Table to be used in conjunction with the USIM Service Table.
|
|
2921 |
|
|
2922 |
Modes: WCDMA */
|
|
2923 |
case RMobilePhone::EUSIMEnabledServiceTable:
|
|
2924 |
ret = CopyServiceTable (iUSIMEnabledServiceTable, &aSst);
|
|
2925 |
break;
|
|
2926 |
default:
|
|
2927 |
ReqCompleted (aReqHandle, SYMBIAN_EXTERR( KErrMMEtelFormatNotSupported,
|
|
2928 |
KErrArgument));
|
|
2929 |
return KErrNone;
|
|
2930 |
}
|
|
2931 |
// Extended error codes are handled here by the CopyServiceTable() func.
|
|
2932 |
ReqCompleted(aReqHandle,ret);
|
|
2933 |
return KErrNone;
|
|
2934 |
}
|
|
2935 |
|
|
2936 |
TInt CSimPhone::GetPhoneId(TTsyReqHandle aReqHandle,RMobilePhone::TMobilePhoneIdentityV1* aPhoneId)
|
|
2937 |
{
|
|
2938 |
|
|
2939 |
//complete with error if error specified.
|
|
2940 |
if(iPhoneId.iError != KErrNone)
|
|
2941 |
{
|
|
2942 |
ReqCompleted(aReqHandle,iPhoneId.iError);
|
|
2943 |
return KErrNone;
|
|
2944 |
}
|
|
2945 |
//fill out phone identity.
|
|
2946 |
if(iPhoneIdCaps & RMobilePhone:: KCapsGetManufacturer)
|
|
2947 |
{
|
|
2948 |
if(iPhoneId.iManufacturerId.Length() > RMobilePhone::KPhoneManufacturerIdSize)
|
|
2949 |
aPhoneId->iManufacturer.Copy(iPhoneId.iManufacturerId.Left(RMobilePhone::KPhoneManufacturerIdSize));
|
|
2950 |
else
|
|
2951 |
aPhoneId->iManufacturer.Copy(iPhoneId.iManufacturerId);
|
|
2952 |
}
|
|
2953 |
|
|
2954 |
if(iPhoneIdCaps & RMobilePhone::KCapsGetModel)
|
|
2955 |
{
|
|
2956 |
if(iPhoneId.iModelId.Length() > RMobilePhone::KPhoneModelIdSize)
|
|
2957 |
aPhoneId->iModel.Copy(iPhoneId.iModelId.Left(RMobilePhone::KPhoneModelIdSize));
|
|
2958 |
else
|
|
2959 |
aPhoneId->iModel.Copy(iPhoneId.iModelId);
|
|
2960 |
}
|
|
2961 |
|
|
2962 |
if(iPhoneIdCaps & RMobilePhone::KCapsGetRevision)
|
|
2963 |
{
|
|
2964 |
if(iPhoneId.iRevisionId.Length() > RMobilePhone::KPhoneRevisionIdSize)
|
|
2965 |
aPhoneId->iRevision.Copy(iPhoneId.iRevisionId.Left(RMobilePhone::KPhoneRevisionIdSize));
|
|
2966 |
else
|
|
2967 |
aPhoneId->iRevision.Copy(iPhoneId.iRevisionId);
|
|
2968 |
}
|
|
2969 |
|
|
2970 |
if(iPhoneIdCaps & RMobilePhone::KCapsGetSerialNumber)
|
|
2971 |
{
|
|
2972 |
if(iPhoneId.iSerialId.Length() > RMobilePhone::KPhoneSerialNumberSize)
|
|
2973 |
aPhoneId->iSerialNumber.Copy(iPhoneId.iSerialId.Left(RMobilePhone::KPhoneSerialNumberSize));
|
|
2974 |
else
|
|
2975 |
aPhoneId->iSerialNumber.Copy(iPhoneId.iSerialId);
|
|
2976 |
}
|
|
2977 |
|
|
2978 |
ReqCompleted(aReqHandle,KErrNone);
|
|
2979 |
return KErrNone;
|
|
2980 |
}
|
|
2981 |
|
|
2982 |
/**
|
|
2983 |
* Callback function invoked by the observer object when test number property is changed.
|
|
2984 |
* This function is supposed to reset SIMTSY. Currently only SMS messaging part of SIMTSY
|
|
2985 |
* is re-started with the new test number.
|
|
2986 |
*/
|
|
2987 |
void CSimPhone::HandleTestNumberChangedL()
|
|
2988 |
{
|
|
2989 |
SetTestNumberAndReadConfigurationFileL();
|
|
2990 |
iSmsMessaging->ReloadConfigurationSettingsL();
|
|
2991 |
}
|
|
2992 |
|
|
2993 |
TInt CSimPhone::CheckConfigFile()
|
|
2994 |
{
|
|
2995 |
TInt testNumber;
|
|
2996 |
User::LeaveIfError(GetTestNumber(testNumber));
|
|
2997 |
iSectionName.Format(KSectionNameFormat,testNumber);
|
|
2998 |
|
|
2999 |
CTestConfig* configFile = NULL;
|
|
3000 |
|
|
3001 |
TRAPD(err, configFile = CTestConfig::NewLC(iFs, KConfigFileDir, KConfigFilename); CleanupStack::Pop(configFile));
|
|
3002 |
if( err != KErrNone || configFile->Section(iSectionName) != NULL )
|
|
3003 |
{
|
|
3004 |
err = KErrNone;
|
|
3005 |
}
|
|
3006 |
else
|
|
3007 |
{
|
|
3008 |
err = KErrNotFound;
|
|
3009 |
}
|
|
3010 |
delete configFile;
|
|
3011 |
return err;
|
|
3012 |
}
|
|
3013 |
/**
|
|
3014 |
Constructor for suspend call processing timer
|
|
3015 |
*/
|
|
3016 |
CSimPhone::CSetCallProcessingSuspendStateTimerCallBack::CSetCallProcessingSuspendStateTimerCallBack()
|
|
3017 |
{}
|
|
3018 |
|
|
3019 |
/**
|
|
3020 |
Must be called before setting the timer. Simply stores the request to be completed when
|
|
3021 |
timer expires
|
|
3022 |
|
|
3023 |
@param the pointer to the phone that the request will be completed on when the timer expires
|
|
3024 |
@param aReqHandle handle to request that will be completed when the timer expires
|
|
3025 |
*/
|
|
3026 |
void CSimPhone::CSetCallProcessingSuspendStateTimerCallBack::SetHandle(CSimPhone* aPhone, const TTsyReqHandle aHandle)
|
|
3027 |
{
|
|
3028 |
iPhone = aPhone;
|
|
3029 |
iHandle = aHandle;
|
|
3030 |
}
|
|
3031 |
|
|
3032 |
/**
|
|
3033 |
Implementation of MTimerCallback::TimerCallBack
|
|
3034 |
Simply completes the suspend call processing request after the delay
|
|
3035 |
*/
|
|
3036 |
void CSimPhone::CSetCallProcessingSuspendStateTimerCallBack::TimerCallBack(TInt /*aId*/)
|
|
3037 |
{
|
|
3038 |
iPhone->ReqCompleted(iHandle,KErrNone);
|
|
3039 |
}
|
|
3040 |
|
|
3041 |
/**
|
|
3042 |
Constructor for network mode processing timer
|
|
3043 |
*/
|
|
3044 |
CSimPhone::CNetworkModeTimerCallBack::CNetworkModeTimerCallBack()
|
|
3045 |
{
|
|
3046 |
}
|
|
3047 |
|
|
3048 |
void CSimPhone::CNetworkModeTimerCallBack::SetHandle(CSimPhone* aPhone)
|
|
3049 |
{
|
|
3050 |
iPhone = aPhone;
|
|
3051 |
}
|
|
3052 |
/**
|
|
3053 |
Implementation of MTimerCallback::TimerCallBack
|
|
3054 |
Simply completes the suspend call processing request after the delay
|
|
3055 |
*/
|
|
3056 |
void CSimPhone::CNetworkModeTimerCallBack::TimerCallBack(TInt /*aId*/)
|
|
3057 |
{
|
|
3058 |
LOGPACKET1(">>CSimPhone::CNetworkModeTimerCallBack::TimerCallBack");
|
|
3059 |
iPhone->TimerCallBackNetworkMode();
|
|
3060 |
}
|
|
3061 |
|
|
3062 |
TInt CSimPhone::NotifyModeChange(const TTsyReqHandle aTsyReqHandle, RMobilePhone::TMobilePhoneNetworkMode* aCaps)
|
|
3063 |
{
|
|
3064 |
LOGPACKET1("CSimPhone::NotifyModeChange called");
|
|
3065 |
__ASSERT_ALWAYS(!iNotifyNetworkModeChange.iNotifyPending,SimPanic(ENotificationAlreadyPending));
|
|
3066 |
|
|
3067 |
if (iNetworkModeArray->Count() == 0)
|
|
3068 |
{
|
|
3069 |
ReqCompleted(aTsyReqHandle,KErrNotSupported);
|
|
3070 |
return KErrNone;
|
|
3071 |
}
|
|
3072 |
|
|
3073 |
iNotifyNetworkModeChange.iNotifyPending = ETrue;
|
|
3074 |
iNotifyNetworkModeChange.iNotifyHandle = aTsyReqHandle;
|
|
3075 |
iNotifyNetworkModeChange.iNotifyData = aCaps;
|
|
3076 |
return KErrNone;
|
|
3077 |
}
|
|
3078 |
|
|
3079 |
/**
|
|
3080 |
* Cancels a clients interest in the change of dynamic caps.
|
|
3081 |
*
|
|
3082 |
* @param aTsyReqHandle Tsy Request handle for the client cancel request
|
|
3083 |
* @return KErrNone
|
|
3084 |
*/
|
|
3085 |
TInt CSimPhone::NotifyModeChangeCancel(const TTsyReqHandle aTsyReqHandle)
|
|
3086 |
{
|
|
3087 |
LOGPACKET1("CSimPhone::NotifyModeChangeCancel called");
|
|
3088 |
if( (iNotifyNetworkModeChange.iNotifyPending) && (aTsyReqHandle == iNotifyNetworkModeChange.iNotifyHandle))
|
|
3089 |
{
|
|
3090 |
iNotifyNetworkModeChange.iNotifyPending=EFalse;
|
|
3091 |
ReqCompleted(aTsyReqHandle,KErrCancel);
|
|
3092 |
}
|
|
3093 |
return KErrNone;
|
|
3094 |
}
|
|
3095 |
|
|
3096 |
/**
|
|
3097 |
* Timer callback function to simulate a change in the Network Mode of the phone
|
|
3098 |
*/
|
|
3099 |
void CSimPhone::TimerCallBackNetworkMode()
|
|
3100 |
{
|
|
3101 |
if (++iNetworkModeIndex >= iNetworkModeArray->Count())
|
|
3102 |
{
|
|
3103 |
return;
|
|
3104 |
}
|
|
3105 |
iNtwkMode = iNetworkModeArray->At(iNetworkModeIndex).iNetworkMode;
|
|
3106 |
if (iNotifyNetworkModeChange.iNotifyPending)
|
|
3107 |
{
|
|
3108 |
iNotifyNetworkModeChange.iNotifyPending = EFalse;
|
|
3109 |
*(RMobilePhone::TMobilePhoneNetworkMode*)iNotifyNetworkModeChange.iNotifyData = (RMobilePhone::TMobilePhoneNetworkMode)iNtwkMode;
|
|
3110 |
ReqCompleted(iNotifyNetworkModeChange.iNotifyHandle,KErrNone);
|
|
3111 |
}
|
|
3112 |
|
|
3113 |
iNetworkModeTimer->Start(iNetworkModeArray->At(iNetworkModeIndex).iDuration, &iTimerCallBackNetworkMode);
|
|
3114 |
}
|
|
3115 |
|
|
3116 |
TInt CSimPhone::CheckSimTsyVersion(RMobilePhone::TMultimodeType& aDataStruct) // overload this for other types of structures
|
|
3117 |
/**
|
|
3118 |
* Checks the version of a data structure against the (simulated) version of SIMTSY, in order
|
|
3119 |
* to determine if the version of the API used is compatible with the version of the TSY used.
|
|
3120 |
*
|
|
3121 |
* @param aDataStruct A versioned data-holding structure, derived from RMobilePhone::TMultimodeType
|
|
3122 |
*
|
|
3123 |
* @return KErrNone if the version of aDataStruct is supported by the user-defined simulated TSY version. KErrNotSupported otherwise
|
|
3124 |
*/
|
|
3125 |
{
|
|
3126 |
TInt ret = KErrNone;
|
|
3127 |
|
|
3128 |
//retrieval of data version
|
|
3129 |
TInt dataVersion;
|
|
3130 |
switch (aDataStruct.ExtensionId())
|
|
3131 |
{
|
|
3132 |
case KETelExtMultimodeV1:
|
|
3133 |
case RMobilePhoneStore::KETelMobilePhonebookStoreV1:
|
|
3134 |
case RMobileSmsMessaging::KETelMobileSmsSendAttributesV1:
|
|
3135 |
case KETelExt3rdPartyV1:
|
|
3136 |
dataVersion = 1;
|
|
3137 |
break;
|
|
3138 |
case KETelExtMultimodeV2:
|
|
3139 |
//case KETelMobilePhonebookStoreV2: - omitted because it is equal to KETelExtMultimodeV2
|
|
3140 |
dataVersion = 2;
|
|
3141 |
break;
|
|
3142 |
case KETelExtMultimodeV3:
|
|
3143 |
dataVersion = 3;
|
|
3144 |
break;
|
|
3145 |
case KETelExtMultimodeV4:
|
|
3146 |
dataVersion = 4;
|
|
3147 |
break;
|
|
3148 |
case KEtelExtMultimodeV5:
|
|
3149 |
//case KETelMobilePhonebookStoreV5: - omitted because it is equal to KETelExtMultimodeV5
|
|
3150 |
dataVersion = 5;
|
|
3151 |
break;
|
|
3152 |
case KEtelExtMultimodeV6:
|
|
3153 |
dataVersion = 6;
|
|
3154 |
break;
|
|
3155 |
case KEtelExtMultimodeV7:
|
|
3156 |
dataVersion = 7;
|
|
3157 |
break;
|
|
3158 |
case KEtelExtMultimodeV8:
|
|
3159 |
dataVersion = 8;
|
|
3160 |
break;
|
|
3161 |
case KEtelExtMultimodeV9:
|
|
3162 |
dataVersion = 9;
|
|
3163 |
break;
|
|
3164 |
default:
|
|
3165 |
dataVersion = KSimTsyDefaultVersion;
|
|
3166 |
break;
|
|
3167 |
}
|
|
3168 |
|
|
3169 |
if(iSimTsyVersion < dataVersion)
|
|
3170 |
{
|
|
3171 |
ret = KErrNotSupported;
|
|
3172 |
}
|
|
3173 |
|
|
3174 |
return ret;
|
|
3175 |
}
|
|
3176 |
|
|
3177 |
TInt CSimPhone::CheckSimTsyVersion(TPacketBase& aDataStruct)
|
|
3178 |
/**
|
|
3179 |
* Checks the version of a data structure against the (simulated) version of SIMTSY, in order
|
|
3180 |
* to determine if the version of the API used is compatible with the version of the TSY used.
|
|
3181 |
*
|
|
3182 |
* @param aDataStruct A versioned data-holding structure, derived from TPacketBase
|
|
3183 |
*
|
|
3184 |
* @return KErrNone if the version of aDataStruct is supported by the user-defined simulated TSY version. KErrNotSupported otherwise
|
|
3185 |
*/
|
|
3186 |
{
|
|
3187 |
TInt ret = KErrNone;
|
|
3188 |
|
|
3189 |
//retrieval of data version
|
|
3190 |
TInt dataVersion;
|
|
3191 |
switch (aDataStruct.ExtensionId())
|
|
3192 |
{
|
|
3193 |
case KETelExtPcktV1:
|
|
3194 |
dataVersion = 1;
|
|
3195 |
break;
|
|
3196 |
case KETelExtPcktV2:
|
|
3197 |
dataVersion = 2;
|
|
3198 |
break;
|
|
3199 |
case KETelExtPcktV3:
|
|
3200 |
dataVersion = 3;
|
|
3201 |
break;
|
|
3202 |
default:
|
|
3203 |
dataVersion = KSimTsyDefaultVersion;
|
|
3204 |
break;
|
|
3205 |
}
|
|
3206 |
|
|
3207 |
if(iSimTsyVersion < dataVersion)
|
|
3208 |
{
|
|
3209 |
ret = KErrNotSupported;
|
|
3210 |
}
|
|
3211 |
|
|
3212 |
return ret;
|
|
3213 |
}
|
|
3214 |
|
|
3215 |
|
|
3216 |
TInt CSimPhone::CheckSimTsyVersion(RCall::TCallParams& aDataStruct)
|
|
3217 |
/**
|
|
3218 |
* Checks the version of a data structure against the (simulated) version of SIMTSY, in order
|
|
3219 |
* to determine if the version of the API used is compatible with the version of the TSY used.
|
|
3220 |
*
|
|
3221 |
* @param aDataStruct A versioned data-holding structure, derived from TCallParams
|
|
3222 |
*
|
|
3223 |
* @return KErrNone if the version of aDataStruct is supported by the user-defined simulated TSY version. KErrNotSupported otherwise
|
|
3224 |
*/
|
|
3225 |
{
|
|
3226 |
TInt ret = KErrNone;
|
|
3227 |
|
|
3228 |
//retrieval of data version
|
|
3229 |
TInt dataVersion;
|
|
3230 |
switch (aDataStruct.ExtensionId())
|
|
3231 |
{
|
|
3232 |
case RMobileCall::KETelMobileCallParamsV1:
|
|
3233 |
case RMobileCall::KETelMobileDataCallParamsV1:
|
|
3234 |
case RMobileCall::KETelMobileHscsdCallParamsV1:
|
|
3235 |
case RMobileCall::KETel3rdPartyCallParamsV1:
|
|
3236 |
dataVersion = 1;
|
|
3237 |
break;
|
|
3238 |
case RMobileCall::KETelMobileCallParamsV2:
|
|
3239 |
case RMobileCall::KETelMobileDataCallParamsV2:
|
|
3240 |
case RMobileCall::KETelMobileHscsdCallParamsV2:
|
|
3241 |
dataVersion = 2;
|
|
3242 |
break;
|
|
3243 |
default:
|
|
3244 |
dataVersion = KSimTsyDefaultVersion;
|
|
3245 |
break;
|
|
3246 |
}
|
|
3247 |
|
|
3248 |
if(iSimTsyVersion < dataVersion)
|
|
3249 |
{
|
|
3250 |
ret = KErrNotSupported;
|
|
3251 |
}
|
|
3252 |
|
|
3253 |
return ret;
|
|
3254 |
}
|
|
3255 |
|
|
3256 |
|
|
3257 |
TInt CSimPhone::CheckSimTsyVersion(RMobilePhone::CImsAuthorizationInfoV5& /*aDataStruct*/) // overload this for other types of structures
|
|
3258 |
/**
|
|
3259 |
* Checks the version of a data structure against the (simulated) version of SIMTSY, in order
|
|
3260 |
* to determine if the version of the API used is compatible with the version of the TSY used.
|
|
3261 |
*
|
|
3262 |
* @param aDataStruct A versioned data-holding structure, of type RMobilePhone::CImsAuthorizationInfoV5 or a class derived from it.
|
|
3263 |
*
|
|
3264 |
* @return KErrNone if the version of aDataStruct is supported by the user-defined simulated TSY version. KErrNotSupported otherwise
|
|
3265 |
*/
|
|
3266 |
{
|
|
3267 |
|
|
3268 |
TInt ret = KErrNone;
|
|
3269 |
|
|
3270 |
//retrieval of data version
|
|
3271 |
TInt dataVersion = 5; // (does not derive from the TMultimodeType data structure as usual...)
|
|
3272 |
|
|
3273 |
if(iSimTsyVersion < dataVersion)
|
|
3274 |
{
|
|
3275 |
ret = KErrNotSupported;
|
|
3276 |
}
|
|
3277 |
|
|
3278 |
return ret;
|
|
3279 |
}
|
|
3280 |
|
|
3281 |
|
|
3282 |
TInt CSimPhone::CheckSimTsyVersion(RPacketContext::CTFTMediaAuthorizationV3& /*aDataStruct*/) // overload this for other types of structures
|
|
3283 |
/**
|
|
3284 |
* Checks the version of a data structure against the (simulated) version of SIMTSY, in order
|
|
3285 |
* to determine if the version of the API used is compatible with the version of the TSY used.
|
|
3286 |
*
|
|
3287 |
* @param aDataStruct A versioned data-holding structure, of type RPacketContext::CTFTMediaAuthorizationV3 or a class derived from it.
|
|
3288 |
*
|
|
3289 |
* @return KErrNone if the version of aDataStruct is supported by the user-defined simulated TSY version. KErrNotSupported otherwise
|
|
3290 |
*/
|
|
3291 |
{
|
|
3292 |
|
|
3293 |
TInt ret = KErrNone;
|
|
3294 |
|
|
3295 |
//retrieval of data version
|
|
3296 |
TInt dataVersion = 3; // (does not derive from the TMultimodeType data structure as usual...)
|
|
3297 |
|
|
3298 |
if(iSimTsyVersion < dataVersion)
|
|
3299 |
{
|
|
3300 |
ret = KErrNotSupported;
|
|
3301 |
}
|
|
3302 |
|
|
3303 |
return ret;
|
|
3304 |
}
|
|
3305 |
////////////////////
|
|
3306 |
// CSimTestNumberObserver
|
|
3307 |
////////////////////
|
|
3308 |
|
|
3309 |
CSimPhone::CSimTestNumberObserver::CSimTestNumberObserver(CSimPhone& aSimPhone)
|
|
3310 |
: CActive(CActive::EPriorityStandard),
|
|
3311 |
iSimPhone(aSimPhone)
|
|
3312 |
{
|
|
3313 |
CActiveScheduler::Add(this);
|
|
3314 |
}
|
|
3315 |
|
|
3316 |
CSimPhone::CSimTestNumberObserver::~CSimTestNumberObserver()
|
|
3317 |
{
|
|
3318 |
Cancel();
|
|
3319 |
iProperty.Close();
|
|
3320 |
}
|
|
3321 |
|
|
3322 |
CSimPhone::CSimTestNumberObserver* CSimPhone::CSimTestNumberObserver::NewL(CSimPhone& aSimPhone)
|
|
3323 |
{
|
|
3324 |
CSimPhone::CSimTestNumberObserver* self = new(ELeave)CSimPhone::CSimTestNumberObserver(aSimPhone);
|
|
3325 |
CleanupStack::PushL(self);
|
|
3326 |
self->ConstructL();
|
|
3327 |
CleanupStack::Pop(self);
|
|
3328 |
return self;
|
|
3329 |
}
|
|
3330 |
|
|
3331 |
void CSimPhone::CSimTestNumberObserver::ConstructL()
|
|
3332 |
{
|
|
3333 |
LOGPHONE1("CSimPhone::CSimPhoneObserver::ConstructL");
|
|
3334 |
User::LeaveIfError(iProperty.Attach(KUidPSSimTsyCategory, KPSSimTsyTestNumber));
|
|
3335 |
Start();
|
|
3336 |
}
|
|
3337 |
|
|
3338 |
void CSimPhone::CSimTestNumberObserver::Start()
|
|
3339 |
{
|
|
3340 |
LOGPHONE1("CSimPhone::CSimPhoneObserver::Start");
|
|
3341 |
iProperty.Subscribe(iStatus);
|
|
3342 |
SetActive();
|
|
3343 |
}
|
|
3344 |
|
|
3345 |
void CSimPhone::CSimTestNumberObserver::RunL()
|
|
3346 |
{
|
|
3347 |
LOGPHONE2("CSimPhone::CSimPhoneObserver::RunL [iStatus=%d]", iStatus.Int());
|
|
3348 |
TInt err = iSimPhone.CheckConfigFile();
|
|
3349 |
if( err == KErrNone )
|
|
3350 |
{
|
|
3351 |
iSimPhone.HandleTestNumberChangedL();
|
|
3352 |
}
|
|
3353 |
|
|
3354 |
Start();
|
|
3355 |
}
|
|
3356 |
|
|
3357 |
void CSimPhone::CSimTestNumberObserver::DoCancel()
|
|
3358 |
{
|
|
3359 |
LOGPHONE1("CSimPhone::CSimPhoneObserver::DoCancel");
|
|
3360 |
iProperty.Cancel();
|
|
3361 |
}
|
|
3362 |
|