31 #include <e32property.h> |
31 #include <e32property.h> |
32 |
32 |
33 |
33 |
34 // CONSTANTS |
34 // CONSTANTS |
35 |
35 |
|
36 // Max number of digits in unsigned 32 bit integer (TInt32) |
|
37 const TUint KMaxInt32Length = 16; |
|
38 |
|
39 |
36 using namespace MultimediaSharing; |
40 using namespace MultimediaSharing; |
37 |
41 |
38 // ----------------------------------------------------------------------------- |
42 // ----------------------------------------------------------------------------- |
39 // |
43 // |
40 // ----------------------------------------------------------------------------- |
44 // ----------------------------------------------------------------------------- |
173 |
177 |
174 // ----------------------------------------------------------------------------- |
178 // ----------------------------------------------------------------------------- |
175 // |
179 // |
176 // ----------------------------------------------------------------------------- |
180 // ----------------------------------------------------------------------------- |
177 // |
181 // |
|
182 void CMusAvailabilityPluginManager::PrepareForReceivedInviteL() |
|
183 { |
|
184 MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ |
|
185 PrepareForReceivedInviteL()" ) |
|
186 |
|
187 iPlugin->PrepareForReceivedInviteL(); |
|
188 |
|
189 MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ |
|
190 PrepareForReceivedInviteL()" ) |
|
191 } |
|
192 |
|
193 // ----------------------------------------------------------------------------- |
|
194 // |
|
195 // ----------------------------------------------------------------------------- |
|
196 // |
178 void CMusAvailabilityPluginManager::InvitationReceivedL() |
197 void CMusAvailabilityPluginManager::InvitationReceivedL() |
179 { |
198 { |
180 MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ |
199 MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ |
181 InvitationReceivedL()" ) |
200 InvitationReceivedL()" ) |
182 |
201 |
266 MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ |
285 MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ |
267 ManualQueryL()" ) |
286 ManualQueryL()" ) |
268 MMusAvaSettings& settings = iPlugin->Settings(); |
287 MMusAvaSettings& settings = iPlugin->Settings(); |
269 |
288 |
270 MUS_LOG( "mus: [MUSSRV] Status available" ) |
289 MUS_LOG( "mus: [MUSSRV] Status available" ) |
271 |
290 if( !iIndicator ) |
272 settings.SetManualActivation( MMusAvaSettings::EActivationAllowed ); |
291 { |
273 iPlugin->StartL(); |
292 MUS_LOG( "mus: [MUSSRV] Create indicator" ) |
274 |
293 iIndicator = CMusIndicatorApi::NewL( *this ); |
|
294 if( iIndicator->ConfirmationQueryL( CMusIndicatorApi::EVsRoamingActivationQuery ) ) |
|
295 { |
|
296 settings.SetManualActivation( MMusAvaSettings::EActivationAllowed ); |
|
297 iPlugin->StartL(); |
|
298 } |
|
299 else |
|
300 { |
|
301 settings.SetManualActivation( MMusAvaSettings::EActivationNotAllowed ); |
|
302 } |
|
303 delete iIndicator; |
|
304 iIndicator = NULL; |
|
305 } |
|
306 else |
|
307 { |
|
308 if( iIndicator->ConfirmationQueryL( CMusIndicatorApi::EVsRoamingActivationQuery ) ) |
|
309 { |
|
310 settings.SetManualActivation( MMusAvaSettings::EActivationAllowed ); |
|
311 iPlugin->StartL(); |
|
312 } |
|
313 else |
|
314 { |
|
315 settings.SetManualActivation( MMusAvaSettings::EActivationNotAllowed ); |
|
316 } |
|
317 } |
275 MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ |
318 MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ |
276 ManualQueryL()" ) |
319 ManualQueryL()" ) |
277 } |
320 } |
278 |
321 |
279 TBool CMusAvailabilityPluginManager::PossibleToLaunch() |
322 TBool CMusAvailabilityPluginManager::PossibleToLaunch() |
304 |
347 |
305 MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ |
348 MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ |
306 AvailabilityChanged()" ) |
349 AvailabilityChanged()" ) |
307 } |
350 } |
308 |
351 |
309 |
|
310 // ----------------------------------------------------------------------------- |
|
311 // |
|
312 // ----------------------------------------------------------------------------- |
|
313 // |
|
314 void CMusAvailabilityPluginManager::AvailabilitiesAbleToShowIndicator() |
|
315 { |
|
316 TInt err = 0; |
|
317 TRAP( err, IndicateAvailabilityL() ); |
|
318 if ( err ) |
|
319 { |
|
320 // Not sure about what to do. Very rare situation. |
|
321 MUS_LOG1( "mus: [MUSSRV] AvailabilitiesAbleToShowIndicator() leave code: %d",err ) |
|
322 } |
|
323 } |
|
324 // ----------------------------------------------------------------------------- |
352 // ----------------------------------------------------------------------------- |
325 // |
353 // |
326 // ----------------------------------------------------------------------------- |
354 // ----------------------------------------------------------------------------- |
327 // |
355 // |
328 void CMusAvailabilityPluginManager::AvailabilityError( |
356 void CMusAvailabilityPluginManager::AvailabilityError( |
348 MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ |
376 MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ |
349 AvailabilityError()" ) |
377 AvailabilityError()" ) |
350 } |
378 } |
351 |
379 |
352 // ----------------------------------------------------------------------------- |
380 // ----------------------------------------------------------------------------- |
353 // |
381 // From MMusAvaSettingsObserver |
354 // ----------------------------------------------------------------------------- |
382 // ----------------------------------------------------------------------------- |
355 // |
383 // |
356 MMusAvaSettingsObserver::TApplicationState CMusAvailabilityPluginManager:: |
384 MMusAvaSettingsObserver::TApplicationState CMusAvailabilityPluginManager:: |
357 ApplicationState() |
385 ApplicationState() |
358 { |
386 { |
372 ApplicationState()" ) |
400 ApplicationState()" ) |
373 return ret; |
401 return ret; |
374 } |
402 } |
375 |
403 |
376 // ----------------------------------------------------------------------------- |
404 // ----------------------------------------------------------------------------- |
377 // |
405 // From MMusAvaSettingsObserver |
378 // ----------------------------------------------------------------------------- |
406 // ----------------------------------------------------------------------------- |
379 // |
407 // |
380 TBool CMusAvailabilityPluginManager::OptionAllowed() |
408 TBool CMusAvailabilityPluginManager::OptionAllowed() |
381 { |
409 { |
382 MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ |
410 MUS_LOG( "mus: [MUSSRV] -> CMusAvailabilityPluginManager::\ |
387 return iPlugin->AvailabilityState( MMusAvaObserver::EMusAvaOptionHandler ) |
415 return iPlugin->AvailabilityState( MMusAvaObserver::EMusAvaOptionHandler ) |
388 >= EMusAvaStatusNotExecuted; |
416 >= EMusAvaStatusNotExecuted; |
389 } |
417 } |
390 |
418 |
391 // ----------------------------------------------------------------------------- |
419 // ----------------------------------------------------------------------------- |
|
420 // From MMusAvaSettingsObserver |
|
421 // ----------------------------------------------------------------------------- |
|
422 // |
|
423 void CMusAvailabilityPluginManager::StartApplicationL( |
|
424 MultimediaSharing::TMusUseCase aUseCase ) |
|
425 { |
|
426 iObserver.StartSharingWithUseCaseL( aUseCase ); |
|
427 } |
|
428 |
|
429 // ----------------------------------------------------------------------------- |
392 // From MMusIndicatorObserver. |
430 // From MMusIndicatorObserver. |
393 // Starts live video sharing. |
431 // Starts live video sharing. |
394 // ----------------------------------------------------------------------------- |
432 // ----------------------------------------------------------------------------- |
395 // |
433 // |
396 void CMusAvailabilityPluginManager::StartLiveSharingL() |
434 void CMusAvailabilityPluginManager::StartLiveSharingL() |
397 { |
435 { |
398 iObserver.StartLiveSharingL(); |
436 iObserver.StartSharingWithUseCaseL( MultimediaSharing::EMusLiveVideo ); |
399 } |
437 } |
400 |
438 |
401 // ----------------------------------------------------------------------------- |
439 // ----------------------------------------------------------------------------- |
402 // This functions cross-links TAvailabilityStatus and |
440 // This functions cross-links TAvailabilityStatus and |
403 // MultimediaSharing::TMusAvailabilityStatus |
441 // MultimediaSharing::TMusAvailabilityStatus |
573 MMusAvaSettings& settings = iPlugin->Settings(); |
611 MMusAvaSettings& settings = iPlugin->Settings(); |
574 |
612 |
575 // append sip address proposal |
613 // append sip address proposal |
576 iSessionParameters->AppendL( settings.SipAddressProposal() ); |
614 iSessionParameters->AppendL( settings.SipAddressProposal() ); |
577 |
615 |
578 // Unsafe Magic number 16 is used but unsigned 32 bit integer (TInt32) |
616 TBuf<KMaxInt32Length> contactIdBuf; |
579 // can't go beyond 16 digits . |
|
580 TBuf<16> contactIdBuf; |
|
581 contactIdBuf.Num( settings.ContactId() ); |
617 contactIdBuf.Num( settings.ContactId() ); |
582 |
618 |
583 // append contact id |
619 // append contact id |
584 iSessionParameters->AppendL( contactIdBuf ); |
620 iSessionParameters->AppendL( contactIdBuf ); |
585 |
|
586 // append video codec |
621 // append video codec |
587 HBufC* videoCodecs = VideoCodecsLC(); |
622 HBufC* videoCodecs = VideoCodecsLC(); |
588 iSessionParameters->AppendL( *videoCodecs ); |
623 iSessionParameters->AppendL( *videoCodecs ); |
589 CleanupStack::PopAndDestroy( videoCodecs ); |
624 CleanupStack::PopAndDestroy( videoCodecs ); |
590 |
625 |
591 // Unsafe Magic number 16 is used but unsigned 32 bit integer (TInt32) |
626 TBuf<KMaxInt32Length> sipProfileIdBuf; |
592 // can't go beyond 16 digits . |
|
593 TBuf<16> sipProfileIdBuf; |
|
594 sipProfileIdBuf.Num( settings.SipProfileId() ); |
627 sipProfileIdBuf.Num( settings.SipProfileId() ); |
595 |
628 |
596 MUS_LOG1("iSessionParameters -> SIP Profile ID = %d ", |
629 MUS_LOG1("iSessionParameters -> SIP Profile ID = %d ", |
597 settings.SipProfileId() ) |
630 settings.SipProfileId() ) |
598 |
631 |
600 iSessionParameters->AppendL( sipProfileIdBuf ); |
633 iSessionParameters->AppendL( sipProfileIdBuf ); |
601 |
634 |
602 HBufC* contactName = ContactNameLC(); |
635 HBufC* contactName = ContactNameLC(); |
603 iSessionParameters->AppendL( *contactName ); |
636 iSessionParameters->AppendL( *contactName ); |
604 CleanupStack::PopAndDestroy( contactName ); |
637 CleanupStack::PopAndDestroy( contactName ); |
|
638 |
|
639 TBuf<KMaxInt32Length> fastModeBuf; |
|
640 fastModeBuf.Num( settings.FastMode() ); |
|
641 MUS_LOG1("iSessionParameters -> fast mode = %d ", |
|
642 settings.FastMode() ) |
|
643 |
|
644 // append fast mode |
|
645 iSessionParameters->AppendL( fastModeBuf ); |
605 |
646 |
606 // append call privacy indication |
|
607 MUS_LOG1("iSessionParameters -> Call Privacy = %d ", |
|
608 settings.CallPrivacy() ) |
|
609 TBuf<16> callPrivacy; |
|
610 callPrivacy.Num( settings.CallPrivacy() ); |
|
611 iSessionParameters->AppendL( callPrivacy ); |
|
612 |
|
613 |
|
614 MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ |
647 MUS_LOG( "mus: [MUSSRV] <- CMusAvailabilityPluginManager::\ |
615 UpdateSessionParametersL()" ) |
648 UpdateSessionParametersL()" ) |
616 } |
649 } |
617 |
650 |
618 |
651 |
760 MUS_LOG( "mus: [MUSSRV] Status available" ) |
793 MUS_LOG( "mus: [MUSSRV] Status available" ) |
761 if( !iIndicator ) |
794 if( !iIndicator ) |
762 { |
795 { |
763 MUS_LOG( "mus: [MUSSRV] Create indicator" ) |
796 MUS_LOG( "mus: [MUSSRV] Create indicator" ) |
764 iIndicator = CMusIndicatorApi::NewL( *this ); |
797 iIndicator = CMusIndicatorApi::NewL( *this ); |
765 } |
798 iIndicator->IndicateAvailabilityL(); |
766 iIndicator->IndicateAvailabilityL(); |
799 } |
767 iApplicationManager.SetIndicatorStatusL( ETrue ); |
800 iApplicationManager.SetIndicatorStatusL( ETrue ); |
768 } |
801 } |
769 else |
802 else |
770 { |
803 { |
771 MUS_LOG( "mus: [MUSSRV] Not available" ) |
804 MUS_LOG( "mus: [MUSSRV] Not available" ) |