|
1 /* |
|
2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of the handover trigger |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include <e32base.h> |
|
21 |
|
22 #include <vccsubscribekeys.h> |
|
23 #include "vccuipsproperty.h" |
|
24 #include "vcchotrigger.h" |
|
25 #include "vccsignallevelhandler.h" |
|
26 #include "vccwlansignallevelhandler.h" |
|
27 #include "vccgsmsignallevelhandler.h" |
|
28 #include "rubydebug.h" |
|
29 #include "vcchopolicyreader.h" |
|
30 #include "vcccchmonitor.h" |
|
31 #include "vccengpsproperty.h" |
|
32 #include "cvccperformer.h" |
|
33 |
|
34 // Min. signal strength. |
|
35 static const TInt32 KStrengthMin = 110; |
|
36 |
|
37 // ======== MEMBER FUNCTIONS ======== |
|
38 |
|
39 // --------------------------------------------------------------------------- |
|
40 // Symbian constructor |
|
41 // --------------------------------------------------------------------------- |
|
42 // |
|
43 EXPORT_C CVccHoTrigger* CVccHoTrigger::NewL() |
|
44 { |
|
45 RUBY_DEBUG_BLOCKL( "CVccHoTrigger::NewL" ); |
|
46 |
|
47 CVccHoTrigger* self = new ( ELeave ) CVccHoTrigger(); |
|
48 |
|
49 CleanupStack::PushL( self ); |
|
50 |
|
51 self->ConstructL(); |
|
52 |
|
53 CleanupStack::Pop( self ); |
|
54 |
|
55 return self; |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------------------------- |
|
59 // Destructor |
|
60 // --------------------------------------------------------------------------- |
|
61 // |
|
62 CVccHoTrigger::~CVccHoTrigger() |
|
63 { |
|
64 RUBY_DEBUG0( "CVccHoTrigger::~CVccHoTrigger() - ENTER" ); |
|
65 |
|
66 delete iProperty; |
|
67 delete iWlanSignalLevelHandler; |
|
68 delete iGsmSignalLevelHandler; |
|
69 delete iHoPolicyReader; |
|
70 delete iCchMonitor; |
|
71 delete iEngPsProperty; |
|
72 |
|
73 RUBY_DEBUG0( "CVccHoTrigger::~CVccHoTrigger() - EXIT" ); |
|
74 } |
|
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // CVccHoTrigger::CVccHoTrigger() |
|
78 // C++ default constructor can NOT contain any code, that might leave. |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 CVccHoTrigger::CVccHoTrigger() : //: CActive( EPriorityStandard ) |
|
82 iGsmClass( ESignalClassUndefined ), |
|
83 iWlanClass( ESignalClassUndefined ), |
|
84 iManualHoDone( EFalse ), |
|
85 iHoNotAllowed( EFalse ), |
|
86 iHoAllowedIfCsOriginated( ETrue ) |
|
87 { |
|
88 RUBY_DEBUG_BLOCK( "CVccHoTrigger::CVccHoTrigger" ); |
|
89 } |
|
90 // --------------------------------------------------------------------------- |
|
91 // 2nd phase constructor |
|
92 // --------------------------------------------------------------------------- |
|
93 // |
|
94 void CVccHoTrigger::ConstructL() |
|
95 { |
|
96 RUBY_DEBUG_BLOCKL( "CVccHoTrigger::ConstructL" ); |
|
97 |
|
98 iProperty = CVccUiPsProperty::NewL(); |
|
99 iHoPolicyReader = CVccHoPolicyReader::NewL(); |
|
100 iHoPolicyReader->ReadSettingsL(); |
|
101 |
|
102 iEngPsProperty = CVccEngPsProperty::NewL(); |
|
103 iPolicy = iHoPolicyReader->HoPolicy(); |
|
104 TSignalLevelParams gsm = iHoPolicyReader->CsSignalLevelParams(); |
|
105 TSignalLevelParams wlan = iHoPolicyReader->PsSignalLevelParams(); |
|
106 |
|
107 |
|
108 iWlanSignalLevelHandler = |
|
109 CVccWlanSignalLevelHandler::NewL( *this, wlan, *iEngPsProperty ); |
|
110 |
|
111 |
|
112 iGsmSignalLevelHandler = |
|
113 CVccGsmSignalLevelHandler::NewL( *this, gsm ); |
|
114 |
|
115 iHoAllowedIfCsOriginated = iPolicy.DtAllowedWhenCsOriginated(); |
|
116 // Previous signal level class must be undefined |
|
117 iPreviousGsmClass = ESignalClassUndefined; |
|
118 iPreviousWlanClass = ESignalClassUndefined; |
|
119 // In the beginning the VoIP service is not available. |
|
120 // This will be changed when the cch monitor calls us |
|
121 // when the service is available. |
|
122 iCchServiceStatus = EServiceUnavailable; |
|
123 |
|
124 // CS network has signal level zero if the service is not |
|
125 // available. |
|
126 iCsSignalLevel = KStrengthMin; |
|
127 |
|
128 // We are not stared yet. |
|
129 iStarted = EFalse; |
|
130 |
|
131 // Update P&S keys to tell if we can do ho or not. |
|
132 UpdatePsKeysL(); |
|
133 // Create the CCH monitor. We are the observer to be |
|
134 // notified when the status changes. |
|
135 iCchMonitor = CVccCchMonitor::NewL( *this ); |
|
136 } |
|
137 |
|
138 // ----------------------------------------------------------------------------- |
|
139 // Stop monitoring |
|
140 // ----------------------------------------------------------------------------- |
|
141 // |
|
142 EXPORT_C void CVccHoTrigger::Stop() |
|
143 { |
|
144 RUBY_DEBUG_BLOCK( "CVccHoTrigger::Stop" ); |
|
145 Stop( *iWhoStartedMe ); |
|
146 } |
|
147 |
|
148 // ----------------------------------------------------------------------------- |
|
149 // Stop monitoring |
|
150 // ----------------------------------------------------------------------------- |
|
151 // |
|
152 EXPORT_C void CVccHoTrigger::Stop( CVccPerformer& aStopper ) |
|
153 { |
|
154 RUBY_DEBUG_BLOCK( "CVccHoTrigger::Stop" ); |
|
155 // If someone else that the one who started us tries |
|
156 // to stop us, we do not allow it. |
|
157 // There may be several performers that are in differnet state |
|
158 // and in those state they do not need trigger and thus try |
|
159 // to stop us. |
|
160 if ( iWhoStartedMe == &aStopper ) |
|
161 { |
|
162 iWhoStartedMe = NULL; |
|
163 iStarted = EFalse; |
|
164 TRAP_IGNORE( UpdatePsKeysL() ); |
|
165 TRAP_IGNORE( iProperty->NotifySubscriberL( EVccNoRequestOngoing ) ); |
|
166 iWlanSignalLevelHandler->Stop(); |
|
167 iGsmSignalLevelHandler->Stop(); |
|
168 |
|
169 iGsmClass = ESignalClassUndefined; |
|
170 iWlanClass = ESignalClassUndefined; |
|
171 |
|
172 // Reset CS signal strength to min |
|
173 iCsSignalLevel = KStrengthMin; |
|
174 |
|
175 // Disable (do not send notifications). |
|
176 // The service is not actually disabled. |
|
177 // It will be disabled (if needed) when the monitor |
|
178 // is deleted. |
|
179 iCchMonitor->DisableService(); |
|
180 RUBY_DEBUG0( " -Trigger stopped"); |
|
181 } |
|
182 } |
|
183 |
|
184 // ----------------------------------------------------------------------------- |
|
185 // Start monitoring |
|
186 // We must not leave. |
|
187 // ----------------------------------------------------------------------------- |
|
188 // |
|
189 EXPORT_C void CVccHoTrigger::Start( CVccPerformer& aWhoStartedMe, |
|
190 TBool aCsOriginated ) |
|
191 { |
|
192 RUBY_DEBUG_BLOCK( "CVccHoTrigger::Start" ); |
|
193 if( iHoAllowedIfCsOriginated == EFalse && aCsOriginated ) |
|
194 { |
|
195 RUBY_DEBUG0( "HO not allowed for CS originated calls" ); |
|
196 |
|
197 Stop(); |
|
198 return; |
|
199 } |
|
200 //anyone can start, but only the last one who started can stop the trigger |
|
201 iWhoStartedMe = &aWhoStartedMe; |
|
202 if( !iStarted ) |
|
203 { |
|
204 |
|
205 // Previous signal level class must be undefined |
|
206 iPreviousGsmClass = ESignalClassUndefined; |
|
207 iPreviousWlanClass = ESignalClassUndefined; |
|
208 |
|
209 // read signal high/low levels, timers etc. |
|
210 TRAPD( err, iHoPolicyReader->ReadSettingsL() ); |
|
211 RUBY_DEBUG1( "reading ho settings, err = %d", err ); |
|
212 |
|
213 if ( !err ) |
|
214 { |
|
215 TSignalLevelParams gsm = iHoPolicyReader->CsSignalLevelParams(); |
|
216 TSignalLevelParams wlan = iHoPolicyReader->PsSignalLevelParams(); |
|
217 iPolicy = iHoPolicyReader->HoPolicy(); |
|
218 |
|
219 iWlanSignalLevelHandler->SetParams( wlan ); |
|
220 iGsmSignalLevelHandler->SetParams( gsm ); |
|
221 |
|
222 TRAPD( err_wlan, iWlanSignalLevelHandler->StartL() ); |
|
223 RUBY_DEBUG1( "starting wlan signal level handler, err = %d", err_wlan ); |
|
224 TRAPD( err_gsm, iGsmSignalLevelHandler->StartL() ); |
|
225 RUBY_DEBUG1( "starting gsm signal level handler, err = %d", err_gsm ); |
|
226 |
|
227 if ( !err_wlan && !err_gsm ) |
|
228 { |
|
229 // Enable the VoIP service to be able to do VoIP calls. |
|
230 TRAPD( err_cch, iCchMonitor->EnableServiceL() ); |
|
231 RUBY_DEBUG1( "enabling service, err = %d", err_cch ); |
|
232 |
|
233 if ( !err_cch ) |
|
234 { |
|
235 // Everything was started ok |
|
236 iStarted = ETrue; |
|
237 } |
|
238 } |
|
239 else |
|
240 { |
|
241 // Stop the handlers just in case either one was started |
|
242 iWlanSignalLevelHandler->Stop(); |
|
243 iGsmSignalLevelHandler->Stop(); |
|
244 } |
|
245 } |
|
246 |
|
247 TRAP_IGNORE( UpdatePsKeysL() ); |
|
248 } |
|
249 } |
|
250 |
|
251 // ----------------------------------------------------------------------------- |
|
252 // Set the domain type of the current call |
|
253 // ----------------------------------------------------------------------------- |
|
254 // |
|
255 EXPORT_C void CVccHoTrigger::SetCurrentDomainType( TCallDomainType aDomainType ) |
|
256 { |
|
257 RUBY_DEBUG_BLOCK( "CVccHoTrigger::SetCurrentDomainType" ); |
|
258 iDomainType = aDomainType; |
|
259 } |
|
260 |
|
261 // ----------------------------------------------------------------------------- |
|
262 // Set the preferred domain type |
|
263 // ----------------------------------------------------------------------------- |
|
264 // |
|
265 EXPORT_C void CVccHoTrigger::SetPreferredDomainType( |
|
266 TVccHoPolicyPreferredDomain aDomainType ) |
|
267 { |
|
268 RUBY_DEBUG1( "CVccHoTrigger::SetPreferredDomainType(%d)", aDomainType ); |
|
269 iPolicy.SetPreferredDomain( aDomainType ); |
|
270 } |
|
271 |
|
272 // ----------------------------------------------------------------------------- |
|
273 // Set Immediate Domain Transfer on/off |
|
274 // ----------------------------------------------------------------------------- |
|
275 // |
|
276 EXPORT_C void CVccHoTrigger::SetImmediateDomainTransfer( TBool aImmediateDT ) |
|
277 { |
|
278 RUBY_DEBUG1( "CVccHoTrigger::SetImmediateDomainTransfer(%d)", aImmediateDT ); |
|
279 iPolicy.SetDoImmediateHo( aImmediateDT ); |
|
280 } |
|
281 |
|
282 // ----------------------------------------------------------------------------- |
|
283 // Handles wlan signal change notifications |
|
284 // ----------------------------------------------------------------------------- |
|
285 // |
|
286 void CVccHoTrigger::WlanSignalChanged( |
|
287 TInt32 /*aSignalStrength*/, |
|
288 TSignalStrengthClass aClass ) |
|
289 { |
|
290 RUBY_DEBUG_BLOCK( "CVccHoTrigger::WlanSignalChanged" ); |
|
291 |
|
292 //Store signal strength class to that we know later what is the strength |
|
293 iWlanClass = aClass; |
|
294 |
|
295 RUBY_DEBUG1( " -iWlanClass=%x ", iWlanClass ); |
|
296 RUBY_DEBUG1( " -iDomainType=%x ", iDomainType ); |
|
297 RUBY_DEBUG1( " -iGsmClass=%x ", iGsmClass ); |
|
298 RUBY_DEBUG1( " -DoImmediateHO=%x ", iPolicy.DoImmediateHo() ); |
|
299 RUBY_DEBUG1( " -PreferredDomain=%x ", iPolicy.PreferredDomain() ); |
|
300 RUBY_DEBUG1( " -iGsmClass=%x ", iGsmClass ); |
|
301 RUBY_DEBUG1( " -DoHoInHeldWaitingCalls=%x ", iPolicy.DoHoInHeldWaitingCalls() ); |
|
302 RUBY_DEBUG0( "0 = GOOD, 1 = WEAK, 2 = UNDEFINED" ); |
|
303 |
|
304 // If the previous class is the same as the new one |
|
305 // - do nothing. |
|
306 |
|
307 if ( iPreviousWlanClass == iWlanClass ) |
|
308 { |
|
309 RUBY_DEBUG0( "No change in WLAN signal class -> return" ); |
|
310 |
|
311 return; |
|
312 } |
|
313 else |
|
314 { |
|
315 iPreviousWlanClass = iWlanClass; |
|
316 } |
|
317 |
|
318 TriggerHo(); |
|
319 } |
|
320 |
|
321 // ----------------------------------------------------------------------------- |
|
322 // Handles GSM singnal change notifications |
|
323 // ----------------------------------------------------------------------------- |
|
324 // |
|
325 void CVccHoTrigger::GsmSignalChanged( |
|
326 TInt32 aSignalStrength, |
|
327 TSignalStrengthClass aClass ) |
|
328 { |
|
329 RUBY_DEBUG_BLOCK( "VccHoTrigger::GsmSignalChanged" ); |
|
330 RUBY_DEBUG1( " -iCsSignalLevel=%d ", aSignalStrength ); |
|
331 |
|
332 //Store signal strength class to that we know later what is the strength |
|
333 iGsmClass = aClass; |
|
334 |
|
335 // Save the signal strength as "status". |
|
336 // Zero (0) means that the service is not available. |
|
337 iCsSignalLevel = aSignalStrength; |
|
338 |
|
339 // Update P&S keys to tell if we can do ho or not. |
|
340 // If the signal level has gone to zero, we are unable to |
|
341 // do hondover. |
|
342 |
|
343 TVccHoStatus hoStatus( EVccHoStateUnknown ); |
|
344 iEngPsProperty->GetCurrentHoStatus( hoStatus ); |
|
345 |
|
346 if( hoStatus != EVccCsToPsHoStarted || hoStatus != EVccCsToPsHoInprogress ) |
|
347 { |
|
348 RUBY_DEBUG0( "CS to PS HO in progress, not updating keys" ); |
|
349 TRAP_IGNORE( UpdatePsKeysL() ); |
|
350 } |
|
351 |
|
352 RUBY_DEBUG1( " -iWlanClass=%x ", iWlanClass ); |
|
353 RUBY_DEBUG1( " -iDomainType=%x ", iDomainType ); |
|
354 RUBY_DEBUG1( " -iGsmClass=%x ", iGsmClass ); |
|
355 RUBY_DEBUG1( " -DoImmediateHO=%x ", iPolicy.DoImmediateHo() ); |
|
356 RUBY_DEBUG1( " -PreferredDomain=%x ", iPolicy.PreferredDomain() ); |
|
357 RUBY_DEBUG1( " -DoHoInHeldWaitingCalls=%x ", iPolicy.DoHoInHeldWaitingCalls() ); |
|
358 RUBY_DEBUG0( "0 = GOOD, 1 = WEAK, 2 = UNDEFINED" ); |
|
359 |
|
360 // If the previous class is the same as the new one |
|
361 // - do nothing. |
|
362 |
|
363 if ( iPreviousGsmClass == iGsmClass ) |
|
364 { |
|
365 RUBY_DEBUG0( "No change in GSM signal class -> return" ); |
|
366 |
|
367 return; |
|
368 } |
|
369 else |
|
370 { |
|
371 iPreviousGsmClass = iGsmClass; |
|
372 } |
|
373 |
|
374 TriggerHo(); |
|
375 } |
|
376 |
|
377 // ----------------------------------------------------------------------------- |
|
378 // Handles CCH monitor notifications |
|
379 // ----------------------------------------------------------------------------- |
|
380 // |
|
381 void CVccHoTrigger::CchServiceStatusChanged( TServiceStatus aStatus ) |
|
382 { |
|
383 RUBY_DEBUG_BLOCK( "VccHoTrigger::CchServiceStateChanged" ); |
|
384 RUBY_DEBUG1( " -Service status = %d", aStatus ); |
|
385 |
|
386 // Save the status |
|
387 iCchServiceStatus = aStatus; |
|
388 |
|
389 TRAP_IGNORE( UpdatePsKeysL() ); |
|
390 TriggerHo(); |
|
391 } |
|
392 |
|
393 // ----------------------------------------------------------------------------- |
|
394 // Check if the CS or PS services are available or not |
|
395 // ----------------------------------------------------------------------------- |
|
396 // |
|
397 TBool CVccHoTrigger::ServicesAvailable() |
|
398 { |
|
399 RUBY_DEBUG_BLOCK( "CVccHoTrigger::AreServicesAvailable" ); |
|
400 |
|
401 TBool retVal( ETrue ); |
|
402 |
|
403 // If PS service (VoIP service) is unavailable or |
|
404 // the CS service == 0 (i.e. signal level), |
|
405 // we cannot do handover. |
|
406 |
|
407 if ( iCchServiceStatus == EServiceUnavailable || |
|
408 iCsSignalLevel == KStrengthMin ) |
|
409 { |
|
410 RUBY_DEBUG0( " -VoIP/CS service(s) not available" ); |
|
411 retVal = EFalse; |
|
412 } |
|
413 |
|
414 return retVal; |
|
415 } |
|
416 |
|
417 // ----------------------------------------------------------------------------- |
|
418 // Update (write) service status state to P&S. |
|
419 // ----------------------------------------------------------------------------- |
|
420 // |
|
421 void CVccHoTrigger::UpdatePsKeysL() |
|
422 { |
|
423 RUBY_DEBUG_BLOCK( "CVccHoTrigger::UpdatePsKeysL" ); |
|
424 |
|
425 // If we are started and both services are available, |
|
426 // handover can be done. |
|
427 // Services available in CS means that we have |
|
428 // signal strength != KStrengthMin (which is 110, returned |
|
429 // from the CS signal level monitor). |
|
430 |
|
431 RUBY_DEBUG1( " -iStarted = %d", iStarted ); |
|
432 RUBY_DEBUG1( " -iHoNotAllowed = %d", iHoNotAllowed ); |
|
433 RUBY_DEBUG1( " -Service status = %d (0=unavailable, 1=available)", iCchServiceStatus ); |
|
434 RUBY_DEBUG1( " -CS signal min level = 110, current level = %d", iCsSignalLevel ); |
|
435 |
|
436 if ( iStarted && |
|
437 ( iCchServiceStatus == EServiceAvailable ) && |
|
438 ( iCsSignalLevel != KStrengthMin ) && |
|
439 ( !iHoNotAllowed ) ) |
|
440 { |
|
441 RUBY_DEBUG0( " -We are started and both services are available" ); |
|
442 // Check HO direction restrictions |
|
443 if ( ( iPolicy.AllowedDirection() & ECsToPsAllowed ) && |
|
444 ( iPolicy.AllowedDirection() & EPsToCsAllowed ) ) |
|
445 { |
|
446 if( iPolicy.DoHoInHeldWaitingCalls() ) |
|
447 { |
|
448 RUBY_DEBUG0( " -Services available and ho allowed to both \ |
|
449 directions, also in multicall" ); |
|
450 iEngPsProperty->NotifySubscriberL( EVccHoStateIdle, KErrNone ); |
|
451 } |
|
452 else |
|
453 { |
|
454 RUBY_DEBUG0( " -Services available and ho allowed to both \ |
|
455 directions but not in multicall" ); |
|
456 iEngPsProperty->NotifySubscriberL( EVccHoStateIdleIfSingleCall, KErrNone ); |
|
457 } |
|
458 } |
|
459 else if ( !( iPolicy.AllowedDirection() & ECsToPsAllowed ) && |
|
460 ( iPolicy.AllowedDirection() & EPsToCsAllowed ) ) |
|
461 { |
|
462 if( iPolicy.DoHoInHeldWaitingCalls() ) |
|
463 { |
|
464 RUBY_DEBUG0( " -HO allowed only to CS" ); |
|
465 iEngPsProperty->NotifySubscriberL( EVccCsToPsNotAllowed, KErrNone ); |
|
466 } |
|
467 else |
|
468 { |
|
469 RUBY_DEBUG0( " -HO allowed only to CS, in single call situation" ); |
|
470 iEngPsProperty->NotifySubscriberL( EVccHoAllowedToCsIfSingleCall, KErrNone ); |
|
471 } |
|
472 } |
|
473 else if ( !( iPolicy.AllowedDirection() & EPsToCsAllowed ) && |
|
474 ( iPolicy.AllowedDirection() & ECsToPsAllowed ) ) |
|
475 { |
|
476 if( iPolicy.DoHoInHeldWaitingCalls() ) |
|
477 { |
|
478 RUBY_DEBUG0( " -HO allowed only to PS" ); |
|
479 iEngPsProperty->NotifySubscriberL( EVccPsToCsNotAllowed, KErrNone ); |
|
480 } |
|
481 else |
|
482 { |
|
483 RUBY_DEBUG0( " -HO allowed only to PS, in single call situation" ); |
|
484 iEngPsProperty->NotifySubscriberL( EVccHoAllowedToPsIfSingleCall, KErrNone ); |
|
485 } |
|
486 } |
|
487 } |
|
488 else |
|
489 { |
|
490 RUBY_DEBUG0( " -We are stopped or services are unavailable:" ); |
|
491 iEngPsProperty->NotifySubscriberL( EVccHoUnavailable, KErrNotReady ); |
|
492 } |
|
493 } |
|
494 |
|
495 // ----------------------------------------------------------------------------- |
|
496 // If manual HO is done, no automatic should be made. |
|
497 // ----------------------------------------------------------------------------- |
|
498 // |
|
499 EXPORT_C void CVccHoTrigger::ManualHoCallStarted() |
|
500 { |
|
501 RUBY_DEBUG_BLOCK( "CVccHoTrigger::ManualHoCallStarted" ); |
|
502 iManualHoDone = ETrue; |
|
503 } |
|
504 |
|
505 // ----------------------------------------------------------------------------- |
|
506 // After manual HO call has been released automatic HOs can be made again. |
|
507 // ----------------------------------------------------------------------------- |
|
508 // |
|
509 EXPORT_C void CVccHoTrigger::ManualHoCallReleased() |
|
510 { |
|
511 RUBY_DEBUG_BLOCK( "CVccHoTrigger::ManualHoCallReleased" ); |
|
512 iManualHoDone = EFalse; |
|
513 } |
|
514 |
|
515 // ----------------------------------------------------------------------------- |
|
516 // During conference HO is not allowed |
|
517 // ----------------------------------------------------------------------------- |
|
518 // |
|
519 EXPORT_C void CVccHoTrigger::HoNotAllowedL() |
|
520 { |
|
521 RUBY_DEBUG_BLOCK( "CVccHoTrigger::HoNotAllowedL" ); |
|
522 iHoNotAllowed = ETrue; |
|
523 UpdatePsKeysL(); |
|
524 } |
|
525 |
|
526 // ----------------------------------------------------------------------------- |
|
527 // After conference HO is allowed again |
|
528 // ----------------------------------------------------------------------------- |
|
529 // |
|
530 EXPORT_C void CVccHoTrigger::HoAllowed() |
|
531 { |
|
532 RUBY_DEBUG_BLOCK( "CVccHoTrigger::HoAllowed" ); |
|
533 iHoNotAllowed = EFalse; |
|
534 TRAP_IGNORE( UpdatePsKeysL() ); |
|
535 } |
|
536 |
|
537 // ----------------------------------------------------------------------------- |
|
538 // Read settings |
|
539 // ----------------------------------------------------------------------------- |
|
540 // |
|
541 EXPORT_C void CVccHoTrigger::ReadHoAllowedWhenCsOriginatedSettingL() |
|
542 { |
|
543 iHoPolicyReader->ReadSettingsL(); |
|
544 iPolicy = iHoPolicyReader->HoPolicy(); |
|
545 iHoAllowedIfCsOriginated = iPolicy.DtAllowedWhenCsOriginated(); |
|
546 } |
|
547 |
|
548 // ----------------------------------------------------------------------------- |
|
549 // Initiate the actual ho when its ok |
|
550 // ----------------------------------------------------------------------------- |
|
551 // |
|
552 void CVccHoTrigger::TriggerHo() |
|
553 { |
|
554 RUBY_DEBUG_BLOCK( "CVccHoTrigger::TriggerHo" ); |
|
555 //Check if manual ho is already made during this call and the |
|
556 //service availability. |
|
557 if( iManualHoDone || !ServicesAvailable() || iHoNotAllowed ) |
|
558 { |
|
559 return; |
|
560 } |
|
561 |
|
562 //If immediate ho is "ON" do it first and then return. |
|
563 if( iPolicy.DoImmediateHo() ) |
|
564 { |
|
565 if ( DoImmediateHo() ) |
|
566 { |
|
567 RUBY_DEBUG0( "VccHoTrigger::TriggerHo - immediate HO was initiated" ); |
|
568 return; |
|
569 } |
|
570 RUBY_DEBUG0( "VccHoTrigger::TriggerHo - no immediate HO" ); |
|
571 } |
|
572 |
|
573 if ( iWlanClass == ESignalClassWeak && |
|
574 iGsmClass == ESignalClassNormal && |
|
575 ( iPolicy.AllowedDirection() & EPsToCsAllowed )) |
|
576 { |
|
577 RUBY_DEBUG0( "VccHoTrigger::WlanSignalChanged - NotifySubscriberL" ); |
|
578 |
|
579 // First empty the key, so that director |
|
580 // gets notified about all changes |
|
581 |
|
582 TRAP_IGNORE( iProperty->NotifySubscriberL( EVccNoRequestOngoing ) ); |
|
583 // Check whether HO is allowed in multicall situation |
|
584 if( iPolicy.DoHoInHeldWaitingCalls() ) |
|
585 { |
|
586 TRAP_IGNORE( iProperty->NotifySubscriberL( |
|
587 EVccAutomaticStartPsToCsHoRequest ) ); |
|
588 } |
|
589 else |
|
590 { |
|
591 TRAP_IGNORE( iProperty->NotifySubscriberL( |
|
592 EVccAutomaticStartPsToCsHoRequestIfSingleCall ) ); |
|
593 } |
|
594 |
|
595 } |
|
596 |
|
597 else if ( iGsmClass == ESignalClassWeak && |
|
598 iWlanClass == ESignalClassNormal && |
|
599 ( iPolicy.AllowedDirection() & ECsToPsAllowed )) |
|
600 { |
|
601 RUBY_DEBUG0( "VccHoTrigger::GsmSignalChanged - NotifySubscriberL" ); |
|
602 |
|
603 // First empty the key, so that director |
|
604 // gets notified about all changes |
|
605 |
|
606 TRAP_IGNORE( iProperty->NotifySubscriberL( EVccNoRequestOngoing ) ); |
|
607 // Check whether HO is allowed in multicall situation |
|
608 if( iPolicy.DoHoInHeldWaitingCalls() ) |
|
609 { |
|
610 TRAP_IGNORE( iProperty->NotifySubscriberL( |
|
611 EVccAutomaticStartCsToPsHoRequest ) ); |
|
612 } |
|
613 else |
|
614 { |
|
615 TRAP_IGNORE( iProperty->NotifySubscriberL( |
|
616 EVccAutomaticStartCsToPsHoRequestIfSingleCall ) ); |
|
617 } |
|
618 } |
|
619 } |
|
620 |
|
621 // ----------------------------------------------------------------------------- |
|
622 // Initiate immediate ho |
|
623 // ----------------------------------------------------------------------------- |
|
624 // |
|
625 TBool CVccHoTrigger::DoImmediateHo() |
|
626 { |
|
627 RUBY_DEBUG_BLOCK( "CVccHoTrigger::DoImmediateHo" ); |
|
628 TBool ret( EFalse ); |
|
629 if( ( iPolicy.PreferredDomain() == ECsPreferred ) && |
|
630 iGsmClass == ESignalClassNormal && |
|
631 ( iPolicy.AllowedDirection() & EPsToCsAllowed ) ) |
|
632 { |
|
633 // Current call is PS, CS signal is ok, preferred domain is CS |
|
634 // and immediate HO is requested -> HANDOVER to CS |
|
635 |
|
636 RUBY_DEBUG0( "VccHoTrigger::GsmSignalChanged - NotifySubscriberL ->\ |
|
637 IMMEDIATE HO to CS" ); |
|
638 |
|
639 // First empty the key, so that director gets |
|
640 // notified about all changes |
|
641 |
|
642 TRAP_IGNORE( iProperty->NotifySubscriberL( EVccNoRequestOngoing ) ); |
|
643 |
|
644 // Check whether HO is allowed in multicall situation |
|
645 if( iPolicy.DoHoInHeldWaitingCalls() ) |
|
646 { |
|
647 TRAP_IGNORE( iProperty->NotifySubscriberL( |
|
648 EVccAutomaticStartPsToCsHoRequest ) ); |
|
649 ret = ETrue; |
|
650 } |
|
651 else |
|
652 { |
|
653 TRAP_IGNORE( iProperty->NotifySubscriberL( |
|
654 EVccAutomaticStartPsToCsHoRequestIfSingleCall ) ); |
|
655 ret = ETrue; |
|
656 } |
|
657 } |
|
658 |
|
659 else if ( (iPolicy.PreferredDomain() == EPsPreferred) && |
|
660 iWlanClass == ESignalClassNormal && |
|
661 ( iPolicy.AllowedDirection() & ECsToPsAllowed ) ) |
|
662 { |
|
663 // Current call is CS, PS signal is ok, preferred domain is PS and |
|
664 // immediate HO is requested -> HANDOVER to PS |
|
665 |
|
666 RUBY_DEBUG0( "VccHoTrigger::WlanSignalChanged - NotifySubscriberL ->\ |
|
667 IMMEDIATE HO to PS" ); |
|
668 |
|
669 // First empty the key, so that director gets |
|
670 // notified about all changes |
|
671 |
|
672 TRAP_IGNORE( iProperty->NotifySubscriberL( EVccNoRequestOngoing ) ); |
|
673 |
|
674 // Check whether HO is allowed in multicall situation |
|
675 if( iPolicy.DoHoInHeldWaitingCalls() ) |
|
676 { |
|
677 TRAP_IGNORE( iProperty->NotifySubscriberL( |
|
678 EVccAutomaticStartCsToPsHoRequest ) ); |
|
679 ret = ETrue; |
|
680 } |
|
681 else |
|
682 { |
|
683 TRAP_IGNORE( iProperty->NotifySubscriberL( |
|
684 EVccAutomaticStartCsToPsHoRequestIfSingleCall ) ); |
|
685 ret = ETrue; |
|
686 } |
|
687 } |
|
688 return ret; |
|
689 } |