|
1 /* |
|
2 * Copyright (c) 2009 Sony Ericsson Mobile Communications AB |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Sony Ericsson Mobile Communications AB - initial contribution. |
|
11 * Nokia Corporation - additional changes. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: |
|
16 * Code for TelephonyActSupplServices class, used by CTelephonyFunctions class. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 */ |
|
24 |
|
25 #include "TelephonyFunctions.h" |
|
26 #include "TelephonyActSupplServices.h" |
|
27 |
|
28 |
|
29 CGetSupplementaryServiceStatusAct* CGetSupplementaryServiceStatusAct::NewL(CTelephonyFunctions* aTelephonyFunctions) |
|
30 /** |
|
31 Public constructor which can Leave(). |
|
32 |
|
33 @param aTelephonyFunctions Object that constructs us. |
|
34 @leave Leaves if no memory. |
|
35 */ |
|
36 { |
|
37 CGetSupplementaryServiceStatusAct* self = new(ELeave) CGetSupplementaryServiceStatusAct(aTelephonyFunctions); |
|
38 CActiveScheduler::Add(self); |
|
39 return self; |
|
40 } |
|
41 |
|
42 CGetSupplementaryServiceStatusAct::~CGetSupplementaryServiceStatusAct() |
|
43 /** |
|
44 Destructor |
|
45 */ |
|
46 { |
|
47 Cancel(); |
|
48 Complete(); |
|
49 delete iGetCFList; |
|
50 iGetCFList = NULL; |
|
51 delete iGetCBList; |
|
52 iGetCBList = NULL; |
|
53 delete iGetCWList; |
|
54 iGetCWList = NULL; |
|
55 } |
|
56 |
|
57 TInt CGetSupplementaryServiceStatusAct::GetCFSupplementaryServiceStatus(const CTelephony::TCallForwardingCondition aCondition, TDes8& aId, const CTelephony::TServiceGroup aServiceGroup) |
|
58 /** |
|
59 Issue Request |
|
60 */ |
|
61 { |
|
62 iISVSSType = CTelephonyFunctions::EGetCFSupplServicesStatus; |
|
63 iServiceGroup = GetMobileServiceGroup(aServiceGroup); |
|
64 iMobileCFCondition = GetMobileCFCondition(aCondition); |
|
65 if(iMobileCFCondition == RMobilePhone::ECallForwardingUnspecified) |
|
66 { |
|
67 return KErrNotSupported; |
|
68 } |
|
69 iCFCondition = aCondition; |
|
70 |
|
71 //delete old list |
|
72 if(iGetCFList) |
|
73 { |
|
74 delete iGetCFList; |
|
75 iGetCFList = NULL; |
|
76 } |
|
77 |
|
78 iISVCFInfo = reinterpret_cast<CTelephony::TCallForwardingSupplServicesV1*> ( const_cast<TUint8*> (aId.Ptr()) ); |
|
79 //create instance of CF list |
|
80 TRAPD(leavecode, iGetCFList = CRetrieveMobilePhoneCFList::NewL(*iTelephonyFunctions->Phone())); |
|
81 if(leavecode != KErrNone) |
|
82 { |
|
83 return leavecode; |
|
84 } |
|
85 |
|
86 iGetCFList->Start(iStatus, iMobileCFCondition, iServiceGroup); |
|
87 SetActive(); |
|
88 return KErrNone; |
|
89 } |
|
90 |
|
91 TInt CGetSupplementaryServiceStatusAct::GetCBSupplementaryServiceStatus(const CTelephony::TCallBarringCondition aCondition, TDes8& aId, const CTelephony::TServiceGroup aServiceGroup) |
|
92 /** |
|
93 Issue Request |
|
94 */ |
|
95 { |
|
96 iISVSSType = CTelephonyFunctions::EGetCBSupplServicesStatus; |
|
97 iServiceGroup = GetMobileServiceGroup(aServiceGroup); |
|
98 iMobileCBCondition = GetMobileCBCondition(aCondition); |
|
99 if(iMobileCBCondition == RMobilePhone::EBarUnspecified) //not supported |
|
100 { |
|
101 return KErrNotSupported; |
|
102 } |
|
103 iCBCondition = aCondition; |
|
104 |
|
105 //delete old list |
|
106 if(iGetCBList) |
|
107 { |
|
108 delete iGetCBList; |
|
109 iGetCBList = NULL; |
|
110 } |
|
111 |
|
112 iISVCBInfo = reinterpret_cast<CTelephony::TCallBarringSupplServicesV1*> (const_cast<TUint8*> (aId.Ptr()) ); |
|
113 //create instance of CB list |
|
114 TRAPD(leavecode, iGetCBList = CRetrieveMobilePhoneCBList::NewL(*iTelephonyFunctions->Phone())); |
|
115 if(leavecode != KErrNone) |
|
116 { |
|
117 return leavecode; |
|
118 } |
|
119 |
|
120 iGetCBList->Start(iStatus, iMobileCBCondition); |
|
121 SetActive(); |
|
122 return KErrNone; |
|
123 } |
|
124 |
|
125 TInt CGetSupplementaryServiceStatusAct::GetCWSupplementaryServiceStatus(TDes8& aId, const CTelephony::TServiceGroup aServiceGroup) |
|
126 /** |
|
127 Issue Request |
|
128 */ |
|
129 { |
|
130 iISVSSType = CTelephonyFunctions::EGetCWSupplServicesStatus; |
|
131 iServiceGroup = GetMobileServiceGroup(aServiceGroup); |
|
132 |
|
133 //delete old list |
|
134 if(iGetCWList) |
|
135 { |
|
136 delete iGetCWList; |
|
137 iGetCWList = NULL; |
|
138 } |
|
139 |
|
140 iISVCWInfo = reinterpret_cast<CTelephony::TCallWaitingSupplServicesV1*> ( const_cast<TUint8*> (aId.Ptr()) ); |
|
141 //create instance of CW list |
|
142 TRAPD(leavecode, iGetCWList = CRetrieveMobilePhoneCWList::NewL(*iTelephonyFunctions->Phone())); |
|
143 if(leavecode != KErrNone) |
|
144 { |
|
145 return leavecode; |
|
146 } |
|
147 iGetCWList->Start(iStatus); |
|
148 SetActive(); |
|
149 return KErrNone; |
|
150 } |
|
151 |
|
152 RMobilePhone::TMobilePhoneCBCondition CGetSupplementaryServiceStatusAct::GetMobileCBCondition(const CTelephony::TCallBarringCondition aCBCondition) const |
|
153 /** |
|
154 Maps CTelephony::TCallBarringCondition to RMobilePhone::TMobilePhoneCBCondition |
|
155 */ |
|
156 { |
|
157 RMobilePhone::TMobilePhoneCBCondition condition = RMobilePhone::EBarUnspecified; |
|
158 switch(aCBCondition) |
|
159 { |
|
160 case CTelephony::EBarAllIncoming: |
|
161 condition = RMobilePhone::EBarAllIncoming; |
|
162 break; |
|
163 case CTelephony::EBarIncomingRoaming: |
|
164 condition = RMobilePhone::EBarIncomingRoaming; |
|
165 break; |
|
166 case CTelephony::EBarAllOutgoing: |
|
167 condition = RMobilePhone::EBarAllOutgoing; |
|
168 break; |
|
169 case CTelephony::EBarOutgoingInternational: |
|
170 condition = RMobilePhone::EBarOutgoingInternational; |
|
171 break; |
|
172 case CTelephony::EBarOutgoingInternationalExHC: |
|
173 condition = RMobilePhone::EBarOutgoingInternationalExHC; |
|
174 break; |
|
175 default: |
|
176 condition = RMobilePhone::EBarUnspecified; |
|
177 break; |
|
178 }; |
|
179 return condition; |
|
180 } |
|
181 |
|
182 RMobilePhone::TMobilePhoneCFCondition CGetSupplementaryServiceStatusAct::GetMobileCFCondition(const CTelephony::TCallForwardingCondition aCFCondition) const |
|
183 /** |
|
184 Maps CTelephony::TCallForwardingCondition to RMobilePhone::TMobilePhoneCFCondition |
|
185 */ |
|
186 { |
|
187 RMobilePhone::TMobilePhoneCFCondition condition = RMobilePhone::ECallForwardingUnspecified; |
|
188 |
|
189 switch(aCFCondition) |
|
190 { |
|
191 case CTelephony::ECallForwardingUnconditional: |
|
192 condition = RMobilePhone::ECallForwardingUnconditional; |
|
193 break; |
|
194 case CTelephony::ECallForwardingBusy: |
|
195 condition = RMobilePhone::ECallForwardingBusy; |
|
196 break; |
|
197 case CTelephony::ECallForwardingNoReply: |
|
198 condition = RMobilePhone::ECallForwardingNoReply; |
|
199 break; |
|
200 case CTelephony::ECallForwardingNotReachable: |
|
201 condition = RMobilePhone::ECallForwardingNotReachable; |
|
202 break; |
|
203 default: |
|
204 condition = RMobilePhone::ECallForwardingUnspecified; |
|
205 break; |
|
206 }; |
|
207 return condition; |
|
208 } |
|
209 |
|
210 RMobilePhone::TMobileService CGetSupplementaryServiceStatusAct::GetMobileServiceGroup(const CTelephony::TServiceGroup aServiceGroup) |
|
211 /** |
|
212 Map CTelephony::TServiceGroup to RMobilePhone::TMobileService |
|
213 */ |
|
214 { |
|
215 RMobilePhone::TMobileService serviceGroup; |
|
216 |
|
217 switch(aServiceGroup) |
|
218 { |
|
219 case CTelephony::EFaxService: |
|
220 serviceGroup = RMobilePhone::EFaxService; |
|
221 break; |
|
222 case CTelephony::EDataService: |
|
223 serviceGroup = RMobilePhone::ECircuitDataService; |
|
224 break; |
|
225 case CTelephony::EVoiceService: |
|
226 default: |
|
227 serviceGroup = RMobilePhone::EVoiceService; |
|
228 } |
|
229 return serviceGroup; |
|
230 } |
|
231 |
|
232 |
|
233 void CGetSupplementaryServiceStatusAct::Complete() |
|
234 /** |
|
235 Service Completed request. |
|
236 */ |
|
237 { |
|
238 TInt leaveCode=iStatus.Int(); |
|
239 |
|
240 if(iISVSSType != CTelephonyFunctions::EMaxNumberOperations && iTelephonyFunctions->IsRequestPending(iISVSSType)) |
|
241 { |
|
242 if(leaveCode==KErrNone) |
|
243 { |
|
244 switch(iISVSSType) |
|
245 { |
|
246 case CTelephonyFunctions::EGetCFSupplServicesStatus: |
|
247 TRAP(leaveCode, ResolveCFListL()); |
|
248 break; |
|
249 case CTelephonyFunctions::EGetCBSupplServicesStatus: |
|
250 TRAP(leaveCode, ResolveCBListL()); |
|
251 break; |
|
252 case CTelephonyFunctions::EGetCWSupplServicesStatus: |
|
253 TRAP(leaveCode, ResolveCWListL()); |
|
254 break; |
|
255 default: |
|
256 leaveCode = KErrNotSupported; |
|
257 } |
|
258 } |
|
259 iTelephonyFunctions->CompleteRequest(iISVSSType, iStatus.Int()); |
|
260 } |
|
261 } |
|
262 |
|
263 void CGetSupplementaryServiceStatusAct::ResolveCBListL() |
|
264 /** |
|
265 Resolve the CB list. The CB list only contains conditions that are active for a particular service group. |
|
266 We want to know the status for a specific service group AND CB condition. |
|
267 |
|
268 The following scenarios are covered. |
|
269 |
|
270 1.We do not successfully retrieve the list. |
|
271 If this is true then return the status as EUnknown. |
|
272 2.An entry has the same service group OR is EAllServices AND the same CB condition as requested. |
|
273 If this is true then return the status of the entry. |
|
274 3.An entry has the same service group OR is EAllServices AND the entry condition is EAllOutgoingServices. |
|
275 If the requested CB condition was either EBarAllOutgoing, EBarOutgoingInternational or EBarOutgoingInternationalExHC then return the status of the entry. |
|
276 4.An entry has the same service group OR is EAllServices AND the entry condition is EAllIncomingServices. |
|
277 If the requested CB condition was either EBarAllIncoming or EBarIncomingRoaming then return the status of the entry. |
|
278 5.Default case |
|
279 return the status as ENotActive. |
|
280 */ |
|
281 { |
|
282 iISVCBInfo->iCallBarringCondition = iCBCondition; |
|
283 iISVCBInfo->iCallBarring = CTelephony::EUnknown; //(Scenario 1) |
|
284 |
|
285 CMobilePhoneCBList* callBarringList=NULL; |
|
286 TInt leaveCode=KErrNone; |
|
287 TRAP(leaveCode, callBarringList=iGetCBList->RetrieveListL();); |
|
288 if (callBarringList) |
|
289 { |
|
290 CleanupStack::PushL(callBarringList); |
|
291 iISVCBInfo->iCallBarring = CTelephony::ENotActive; //(Scenario 5) |
|
292 |
|
293 TInt count = callBarringList->Enumerate(); |
|
294 RMobilePhone::TMobilePhoneCBInfoEntryV1 entry; |
|
295 for (TInt i=0; i<count; ++i) |
|
296 { |
|
297 leaveCode = KErrNone; |
|
298 TRAP(leaveCode,entry=callBarringList->GetEntryL(i)); |
|
299 if (leaveCode == KErrNone && (iServiceGroup == entry.iServiceGroup || entry.iServiceGroup == RMobilePhone::EAllServices)) |
|
300 { |
|
301 if( iMobileCBCondition == entry.iCondition || //(Scenario 2) |
|
302 ( entry.iCondition == RMobilePhone::EBarAllOutgoingServices && //(Scenario 3) |
|
303 (iMobileCBCondition == RMobilePhone::EBarAllOutgoing || |
|
304 iMobileCBCondition == RMobilePhone::EBarOutgoingInternational || |
|
305 iMobileCBCondition == RMobilePhone::EBarOutgoingInternationalExHC) ) || |
|
306 ( entry.iCondition == RMobilePhone::EBarAllIncomingServices && //(Scenario 4) |
|
307 (iMobileCBCondition == RMobilePhone::EBarAllIncoming || |
|
308 iMobileCBCondition == RMobilePhone::EBarIncomingRoaming) ) ) |
|
309 { |
|
310 iISVCBInfo->iCallBarring = GetCBSupplServiceStatus(entry.iStatus); |
|
311 break; |
|
312 } |
|
313 } |
|
314 } |
|
315 CleanupStack::PopAndDestroy(callBarringList); //callBarringList |
|
316 } |
|
317 } |
|
318 |
|
319 CTelephony::TSupplServiceStatus CGetSupplementaryServiceStatusAct::GetCBSupplServiceStatus(RMobilePhone::TMobilePhoneCBStatus aStatus) |
|
320 /** |
|
321 Map RMobilePhone::TMobilePhoneCBStatus to CTelephony::TSupplServiceStatus |
|
322 */ |
|
323 { |
|
324 CTelephony::TSupplServiceStatus supplServiceStatus; |
|
325 |
|
326 switch(aStatus) |
|
327 { |
|
328 case RMobilePhone::ECallBarringStatusActive: |
|
329 supplServiceStatus = CTelephony::EStatusActive; |
|
330 break; |
|
331 case RMobilePhone::ECallBarringStatusNotActive: |
|
332 supplServiceStatus = CTelephony::ENotActive; |
|
333 break; |
|
334 case RMobilePhone::ECallBarringStatusNotProvisioned: |
|
335 supplServiceStatus = CTelephony::ENotProvisioned; |
|
336 break; |
|
337 case RMobilePhone::ECallBarringStatusNotAvailable: |
|
338 supplServiceStatus = CTelephony::ENotAvailable; |
|
339 break; |
|
340 case RMobilePhone::ECallBarringStatusUnknown: |
|
341 default: |
|
342 supplServiceStatus = CTelephony::EUnknown; |
|
343 break; |
|
344 } |
|
345 return supplServiceStatus; |
|
346 } |
|
347 |
|
348 void CGetSupplementaryServiceStatusAct::ResolveCFListL() |
|
349 /** |
|
350 Resolve the CF list. The CF list should contain an entry for each condition of a particular service group regardless of whether the |
|
351 status is active or inactive.. |
|
352 We want to know the status for a specific service group AND CF condition. |
|
353 |
|
354 The following scenarios are covered. |
|
355 |
|
356 1.We do not successfully retrieve the list. |
|
357 If this is true then return the status as EUnknown. |
|
358 2.An entry has the the same service group OR is EAllServices AND the same CF condition as requested. |
|
359 If this is true then return the status of the entry. |
|
360 3.An entry has the the same service group OR is EAllServices AND the entry condition is ECallForwardingAllCases. |
|
361 If this is true then return the status of the entry. |
|
362 4.An entry has the the same service group OR is EAllServices AND the entry condition is ECallForwardingAllConditionalCases. |
|
363 If the requested CF condition was either ECallForwardingBusy, ECallForwardingNoReply or ECallForwardingNotReachable then return the status of the entry. |
|
364 */ |
|
365 { |
|
366 iISVCFInfo->iCallForwardingCondition = iCFCondition; |
|
367 iISVCFInfo->iCallForwarding = CTelephony::EUnknown; //(Scenario 1) Initially set to unknown until we are sure we successfully get the list. |
|
368 |
|
369 CMobilePhoneCFList* callForwardingList=NULL; |
|
370 TInt leaveCode=KErrNone; |
|
371 TRAP(leaveCode, callForwardingList=iGetCFList->RetrieveListL();); |
|
372 if (callForwardingList) |
|
373 { |
|
374 CleanupStack::PushL(callForwardingList); |
|
375 |
|
376 TInt count = callForwardingList->Enumerate(); |
|
377 |
|
378 RMobilePhone::TMobilePhoneCFInfoEntryV1 entry; |
|
379 |
|
380 for (TInt i=0; i<count; ++i) |
|
381 { |
|
382 leaveCode = KErrNone; |
|
383 TRAP(leaveCode,entry=callForwardingList->GetEntryL(i)); |
|
384 if (leaveCode == KErrNone && (iServiceGroup == entry.iServiceGroup || entry.iServiceGroup == RMobilePhone::EAllServices)) |
|
385 { |
|
386 if( iMobileCFCondition == entry.iCondition || //(Scenario 2) |
|
387 entry.iCondition == RMobilePhone::ECallForwardingAllCases || //(Scenario 3) |
|
388 ( entry.iCondition == RMobilePhone::ECallForwardingAllConditionalCases && //(Scenario 4) |
|
389 (iMobileCFCondition == RMobilePhone::ECallForwardingBusy || |
|
390 iMobileCFCondition == RMobilePhone::ECallForwardingNoReply || |
|
391 iMobileCFCondition == RMobilePhone::ECallForwardingNotReachable ) ) ) |
|
392 { |
|
393 iISVCFInfo->iCallForwarding = GetCFSupplServiceStatus(entry.iStatus); |
|
394 break; |
|
395 } |
|
396 } |
|
397 } |
|
398 CleanupStack::PopAndDestroy(callForwardingList); //callForwardingList |
|
399 } |
|
400 } |
|
401 |
|
402 CTelephony::TSupplServiceStatus CGetSupplementaryServiceStatusAct::GetCFSupplServiceStatus(RMobilePhone::TMobilePhoneCFStatus aStatus) |
|
403 /** |
|
404 Map RMobilePhone::TMobilePhoneCFStatus to CTelephony::TSupplServiceStatus |
|
405 */ |
|
406 { |
|
407 CTelephony::TSupplServiceStatus supplServiceStatus; |
|
408 |
|
409 switch(aStatus) |
|
410 { |
|
411 case RMobilePhone::ECallForwardingStatusActive: |
|
412 supplServiceStatus = CTelephony::EStatusActive; |
|
413 break; |
|
414 case RMobilePhone::ECallForwardingStatusNotActive: |
|
415 case RMobilePhone::ECallForwardingStatusNotRegistered: |
|
416 supplServiceStatus = CTelephony::ENotActive; |
|
417 break; |
|
418 case RMobilePhone::ECallForwardingStatusNotProvisioned: |
|
419 supplServiceStatus = CTelephony::ENotProvisioned; |
|
420 break; |
|
421 case RMobilePhone::ECallForwardingStatusNotAvailable: |
|
422 supplServiceStatus = CTelephony::ENotAvailable; |
|
423 break; |
|
424 case RMobilePhone::ECallForwardingStatusUnknown: |
|
425 case RMobilePhone::ECallForwardingStatusActivePIAllowed: |
|
426 case RMobilePhone::ECallForwardingStatusActivePINotAvailable: |
|
427 case RMobilePhone::ECallForwardingStatusActivePIClir: |
|
428 case RMobilePhone::ECallForwardingStatusActivePIClirSIVerified: |
|
429 case RMobilePhone::ECallForwardingStatusActivePIClirSINotScreened: |
|
430 case RMobilePhone::ECallForwardingStatusActivePIClirSINetwork: |
|
431 default: |
|
432 supplServiceStatus = CTelephony::EUnknown; |
|
433 break; |
|
434 } |
|
435 return supplServiceStatus; |
|
436 } |
|
437 |
|
438 void CGetSupplementaryServiceStatusAct::ResolveCWListL() |
|
439 /** |
|
440 Resolve the CB list. The CB list only entries for active status's for a particular service group. |
|
441 We want to know the status for a specific service group. |
|
442 |
|
443 There are four scenarios to cover. |
|
444 |
|
445 1.We do not successfully retrieve the list. If this is true we shall set the status as EUnknown. |
|
446 2.An entry in the list matches the requested service group. If this is true we return the status as defined in the entry. |
|
447 3.An entry in the list has the EAllServices service group. If this is true we return the status as defined in the entry. |
|
448 4.Default case: return the status as ENotActive. |
|
449 */ |
|
450 { |
|
451 iISVCWInfo->iCallWaiting = CTelephony::EUnknown; //(Scenario 1) |
|
452 |
|
453 CMobilePhoneCWList* callWaitingList=NULL; |
|
454 TInt leaveCode=KErrNone; |
|
455 TRAP(leaveCode, callWaitingList=iGetCWList->RetrieveListL();); |
|
456 if (callWaitingList) |
|
457 { |
|
458 CleanupStack::PushL(callWaitingList); |
|
459 |
|
460 iISVCWInfo->iCallWaiting = CTelephony::ENotActive; //(Scenario 4) |
|
461 |
|
462 TInt count = callWaitingList->Enumerate(); |
|
463 RMobilePhone::TMobilePhoneCWInfoEntryV1 entry; |
|
464 |
|
465 for (TInt i=0; i<count; ++i) |
|
466 { |
|
467 leaveCode = KErrNone; |
|
468 TRAP(leaveCode,entry=callWaitingList->GetEntryL(i)); |
|
469 if (leaveCode == KErrNone && (iServiceGroup == entry.iServiceGroup || entry.iServiceGroup == RMobilePhone::EAllServices)) |
|
470 { |
|
471 iISVCWInfo->iCallWaiting = GetCWSupplServiceStatus(entry.iStatus); //(Scenario 2 & 3) |
|
472 break; |
|
473 } |
|
474 } |
|
475 CleanupStack::PopAndDestroy(callWaitingList); //callWaitingList |
|
476 } |
|
477 |
|
478 } |
|
479 |
|
480 CTelephony::TSupplServiceStatus CGetSupplementaryServiceStatusAct::GetCWSupplServiceStatus(RMobilePhone::TMobilePhoneCWStatus aStatus) |
|
481 /** |
|
482 Map RMobilePhone::TMobilePhoneCWStatus to CTelephony::TSupplServiceStatus |
|
483 */ |
|
484 { |
|
485 CTelephony::TSupplServiceStatus supplServiceStatus; |
|
486 |
|
487 switch(aStatus) |
|
488 { |
|
489 case RMobilePhone::ECallWaitingStatusActive: |
|
490 supplServiceStatus = CTelephony::EStatusActive; |
|
491 break; |
|
492 case RMobilePhone::ECallWaitingStatusNotActive: |
|
493 supplServiceStatus = CTelephony::ENotActive; |
|
494 break; |
|
495 case RMobilePhone::ECallWaitingStatusNotProvisioned: |
|
496 supplServiceStatus = CTelephony::ENotProvisioned; |
|
497 break; |
|
498 case RMobilePhone::ECallWaitingStatusNotAvailable: |
|
499 supplServiceStatus = CTelephony::ENotAvailable; |
|
500 break; |
|
501 case RMobilePhone::ECallWaitingStatusUnknown: |
|
502 default: |
|
503 supplServiceStatus = CTelephony::EUnknown; |
|
504 break; |
|
505 } |
|
506 return supplServiceStatus; |
|
507 } |
|
508 |
|
509 TInt CGetSupplementaryServiceStatusAct::RunError(TInt aLeaveCode) |
|
510 /** |
|
511 Handle any Leave() from inside RunL(). |
|
512 |
|
513 @param aLeaveCode passed in if RunL Leaves. |
|
514 @return KErrNone. |
|
515 */ |
|
516 { |
|
517 if(iISVSSType != CTelephonyFunctions::EMaxNumberOperations) |
|
518 { |
|
519 iTelephonyFunctions->CompleteRequest(iISVSSType, aLeaveCode); |
|
520 } |
|
521 return KErrNone; // to ActiveScheduler. |
|
522 } |
|
523 |
|
524 void CGetSupplementaryServiceStatusAct::DoCancel() |
|
525 /** |
|
526 Cancel request. |
|
527 |
|
528 Async request to be cancelled. |
|
529 */ |
|
530 { |
|
531 if(iGetCFList) |
|
532 { |
|
533 iGetCFList->Cancel(); |
|
534 } |
|
535 if(iGetCBList) |
|
536 { |
|
537 iGetCBList->Cancel(); |
|
538 } |
|
539 if(iGetCWList) |
|
540 { |
|
541 iGetCWList->Cancel(); |
|
542 } |
|
543 } |
|
544 |
|
545 |
|
546 CGetSupplementaryServiceStatusAct::CGetSupplementaryServiceStatusAct(CTelephonyFunctions* aTelephonyFunctions) |
|
547 : CAsyncRequestBaseAct(), |
|
548 iTelephonyFunctions(aTelephonyFunctions), |
|
549 iISVSSType(CTelephonyFunctions::EMaxNumberOperations) |
|
550 /** |
|
551 First-phase constructor which cannot Leave(). |
|
552 |
|
553 @param aTelephonyFunctions Object that constructs us. |
|
554 */ |
|
555 { |
|
556 } |
|
557 |
|
558 |
|
559 CGetIdentityServiceStatusAct* CGetIdentityServiceStatusAct::NewL(CTelephonyFunctions* aTelephonyFunctions) |
|
560 /** |
|
561 Public constructor which can Leave(). |
|
562 |
|
563 @param aTelephonyFunctions Object that constructs us. |
|
564 @leave Leaves if no memory. |
|
565 */ |
|
566 { |
|
567 CGetIdentityServiceStatusAct* self = new(ELeave) CGetIdentityServiceStatusAct(aTelephonyFunctions); |
|
568 CActiveScheduler::Add(self); |
|
569 return self; |
|
570 } |
|
571 |
|
572 CGetIdentityServiceStatusAct::~CGetIdentityServiceStatusAct() |
|
573 /** |
|
574 Destructor |
|
575 */ |
|
576 { |
|
577 Cancel(); |
|
578 Complete(); |
|
579 } |
|
580 |
|
581 void CGetIdentityServiceStatusAct::GetIdentityServiceStatus(const CTelephony::TIdentityService aService, TDes8& aId) |
|
582 /** |
|
583 Issue Request |
|
584 */ |
|
585 { |
|
586 iISVServiceStatus = reinterpret_cast<CTelephony::TIdentityServiceV1*> ( const_cast<TUint8*> ( aId.Ptr() ) ); |
|
587 |
|
588 RMobilePhone::TMobilePhoneIdService thisService; |
|
589 |
|
590 switch(aService) |
|
591 { |
|
592 case CTelephony::EIdServiceUnspecified: |
|
593 thisService=RMobilePhone::EIdServiceUnspecified; |
|
594 break; |
|
595 case CTelephony::EIdServiceCallerPresentation: |
|
596 thisService=RMobilePhone::EIdServiceCallerPresentation; |
|
597 break; |
|
598 case CTelephony::EIdServiceCallerRestriction: |
|
599 thisService=RMobilePhone::EIdServiceCallerRestriction; |
|
600 break; |
|
601 default: |
|
602 thisService=RMobilePhone::EIdServiceUnspecified; |
|
603 break; |
|
604 } |
|
605 |
|
606 iTelephonyFunctions->Phone()->GetIdentityServiceStatus(iStatus, thisService, iMMServiceStatus); |
|
607 SetActive(); |
|
608 } |
|
609 |
|
610 void CGetIdentityServiceStatusAct::Complete() |
|
611 /** |
|
612 Service Completed request. |
|
613 */ |
|
614 { |
|
615 if(iTelephonyFunctions->IsRequestPending(CTelephonyFunctions::EGetIdentityServiceStatus)) |
|
616 { |
|
617 if(iStatus==KErrNone) |
|
618 { |
|
619 switch(iMMServiceStatus) |
|
620 { |
|
621 case RMobilePhone::EIdServiceActivePermanent: |
|
622 iISVServiceStatus->iIdentityStatus=CTelephony::EIdServiceActivePermanent; |
|
623 break; |
|
624 case RMobilePhone::EIdServiceActiveDefaultRestricted: |
|
625 iISVServiceStatus->iIdentityStatus=CTelephony::EIdServiceActiveDefaultRestricted; |
|
626 break; |
|
627 case RMobilePhone::EIdServiceActiveDefaultAllowed: |
|
628 iISVServiceStatus->iIdentityStatus=CTelephony::EIdServiceActiveDefaultAllowed; |
|
629 break; |
|
630 case RMobilePhone::EIdServiceNotProvisioned: |
|
631 iISVServiceStatus->iIdentityStatus=CTelephony::EIdServiceNotProvisioned; |
|
632 break; |
|
633 case RMobilePhone::EIdServiceUnknown: |
|
634 iISVServiceStatus->iIdentityStatus=CTelephony::EIdServiceUnknown; |
|
635 break; |
|
636 default: |
|
637 iISVServiceStatus->iIdentityStatus=CTelephony::EIdServiceUnknown; |
|
638 } |
|
639 } |
|
640 iTelephonyFunctions->CompleteRequest(CTelephonyFunctions::EGetIdentityServiceStatus, iStatus.Int()); |
|
641 } |
|
642 } |
|
643 |
|
644 TInt CGetIdentityServiceStatusAct::RunError(TInt aLeaveCode) |
|
645 /** |
|
646 Handle any Leave() from inside RunL(). |
|
647 |
|
648 @param aLeaveCode passed in if RunL Leaves. |
|
649 @return KErrNone. |
|
650 */ |
|
651 { |
|
652 iTelephonyFunctions->CompleteRequest(CTelephonyFunctions::EGetIdentityServiceStatus, aLeaveCode); |
|
653 return KErrNone; // to ActiveScheduler. |
|
654 } |
|
655 |
|
656 void CGetIdentityServiceStatusAct::DoCancel() |
|
657 /** |
|
658 Cancel request. |
|
659 |
|
660 Async request to dial is cancelled. |
|
661 */ |
|
662 { |
|
663 iTelephonyFunctions->Phone()->CancelAsyncRequest(EMobilePhoneGetIdentityServiceStatus); |
|
664 } |
|
665 |
|
666 |
|
667 CGetIdentityServiceStatusAct::CGetIdentityServiceStatusAct(CTelephonyFunctions* aTelephonyFunctions) |
|
668 : CAsyncRequestBaseAct(), |
|
669 iTelephonyFunctions(aTelephonyFunctions) |
|
670 /** |
|
671 First-phase constructor which cannot Leave(). |
|
672 |
|
673 @param aTelephonyFunctions Object that constructs us. |
|
674 */ |
|
675 { |
|
676 } |
|
677 |