1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
14 // |
14 // |
15 |
15 |
16 |
16 |
17 |
17 |
18 // INCLUDE FILES |
18 // INCLUDE FILES |
|
19 |
|
20 #include "OstTraceDefinitions.h" |
|
21 #ifdef OST_TRACE_COMPILER_IN_USE |
|
22 #include "CMmMessageRouterProxyTraces.h" |
|
23 #endif |
|
24 |
19 #include "cmmmessagerouterproxy.h" |
25 #include "cmmmessagerouterproxy.h" |
20 #include "cmmvoicecalltsy.h" |
26 #include "cmmvoicecalltsy.h" |
21 #include "cmmdatacalltsy.h" |
27 #include "cmmdatacalltsy.h" |
22 #include "cmmcallextinterface.h" |
28 #include "cmmcallextinterface.h" |
23 #include "cmmconferencecalltsy.h" |
29 #include "cmmconferencecalltsy.h" |
61 } |
67 } |
62 |
68 |
63 CMmMessageRouterProxy* CMmMessageRouterProxy::NewL( |
69 CMmMessageRouterProxy* CMmMessageRouterProxy::NewL( |
64 CTsyDelegates& aTsyDelegates ) |
70 CTsyDelegates& aTsyDelegates ) |
65 { |
71 { |
66 TFLOGSTRING("TSY: CMmMessageRouterProxy::NewL." ); |
72 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMESSAGEROUTERPROXY_CTOR_1, "TSY: CMmMessageRouterProxy::NewL." ); |
67 CMmMessageRouterProxy* const routerproxy = |
73 CMmMessageRouterProxy* const routerproxy = |
68 new ( ELeave ) CMmMessageRouterProxy(); |
74 new ( ELeave ) CMmMessageRouterProxy(); |
69 CleanupStack::PushL( routerproxy ); |
75 CleanupStack::PushL( routerproxy ); |
70 routerproxy->iTsyDelegates = &aTsyDelegates; |
76 routerproxy->iTsyDelegates = &aTsyDelegates; |
71 routerproxy->ConstructL(); |
77 routerproxy->ConstructL(); |
90 void CMmMessageRouterProxy::Complete( |
96 void CMmMessageRouterProxy::Complete( |
91 TInt aIpc, |
97 TInt aIpc, |
92 CMmDataPackage* aData, |
98 CMmDataPackage* aData, |
93 TInt aResult ) |
99 TInt aResult ) |
94 { |
100 { |
95 TFLOGSTRING3("TSY: CMmMessageRouterProxy::Complete. IPC = %d, result: %d", aIpc, aResult); |
101 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMESSAGEROUTERPROXY_COMPLETE_1, "TSY: CMmMessageRouterProxy::Complete. IPC = %d, result: %d", aIpc, aResult); |
96 RouteCompletion( aIpc, aData, aResult ); |
102 RouteCompletion( aIpc, aData, aResult ); |
97 } |
103 } |
98 |
104 |
99 // --------------------------------------------------------------------------- |
105 // --------------------------------------------------------------------------- |
100 // CMmMessageRouterProxy::Complete |
106 // CMmMessageRouterProxy::Complete |
254 const CPhoneBookDataPackage* phonebookData = REINTERPRET_CAST( |
260 const CPhoneBookDataPackage* phonebookData = REINTERPRET_CAST( |
255 const CPhoneBookDataPackage*, aDataPackage ); |
261 const CPhoneBookDataPackage*, aDataPackage ); |
256 |
262 |
257 TName phoneBookName; |
263 TName phoneBookName; |
258 phonebookData->GetPhoneBookName( phoneBookName ); |
264 phonebookData->GetPhoneBookName( phoneBookName ); |
259 TFLOGSTRING2("TSY: CMmMessageRouterProxy::RouteCompletion: PB Name: %S", &phoneBookName); |
265 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMESSAGEROUTERPROXY_ROUTECOMPLETIONL_1, "TSY: CMmMessageRouterProxy::RouteCompletion: PB Name: %S", phoneBookName); |
260 |
266 |
261 for( TInt i = 0; i < iMmPhone->PBList()->GetNumberOfObjects(); i++ ) |
267 for( TInt i = 0; i < iMmPhone->PBList()->GetNumberOfObjects(); i++ ) |
262 { |
268 { |
263 CMmPhoneBookStoreTsy* pbStore = iMmPhone->PBList()-> |
269 CMmPhoneBookStoreTsy* pbStore = iMmPhone->PBList()-> |
264 GetMmPBByIndex( i ); |
270 GetMmPBByIndex( i ); |
268 mmObject = static_cast<CBase*>( pbStore ); |
274 mmObject = static_cast<CBase*>( pbStore ); |
269 } |
275 } |
270 } |
276 } |
271 if ( NULL == mmObject ) |
277 if ( NULL == mmObject ) |
272 { |
278 { |
273 TFLOGSTRING("TSY: CMmMessageRouterProxy::RouteCompletion: PB object not found!"); |
279 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMESSAGEROUTERPROXY_ROUTECOMPLETIONL_2, "TSY: CMmMessageRouterProxy::RouteCompletion: PB object not found!"); |
274 iMmPhone->SetPBInitActiveStatus( EFalse ); |
280 iMmPhone->SetPBInitActiveStatus( EFalse ); |
275 } |
281 } |
276 } |
282 } |
277 break; |
283 break; |
278 // ENStore functionality |
284 // ENStore functionality |
780 // NOTE: The statement above is redundant, as the loop below calls CompletePBStoreInitializationL |
786 // NOTE: The statement above is redundant, as the loop below calls CompletePBStoreInitializationL |
781 // on every phonebook store. However, we need to be certain that changing the order in which |
787 // on every phonebook store. However, we need to be certain that changing the order in which |
782 // phonebook stores are initialised won't introduce side effects. (One future improvement) |
788 // phonebook stores are initialised won't introduce side effects. (One future improvement) |
783 for( TInt i = 0; i < iMmPhone->PBList()->GetNumberOfObjects(); i++ ) |
789 for( TInt i = 0; i < iMmPhone->PBList()->GetNumberOfObjects(); i++ ) |
784 { |
790 { |
785 TFLOGSTRING("TSY: CMmMessageRouterProxy::RouteCompletion:EMmTsyPhoneBookStoreInitIPC for loop, check init statuses "); |
791 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMESSAGEROUTERPROXY_ROUTECOMPLETIONL_3, "TSY: CMmMessageRouterProxy::RouteCompletion:EMmTsyPhoneBookStoreInitIPC for loop, check init statuses "); |
786 CMmPhoneBookStoreTsy* pbStore = iMmPhone->PBList()-> |
792 CMmPhoneBookStoreTsy* pbStore = iMmPhone->PBList()-> |
787 GetMmPBByIndex( i ); |
793 GetMmPBByIndex( i ); |
788 done = pbStore->IsPBInitDone(); |
794 done = pbStore->IsPBInitDone(); |
789 TFLOGSTRING3("TSY: CMmMessageRouterProxy::RouteCompletion: active: %i, done: %i",iMmPhone->IsPBInitActive(), done); |
795 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMESSAGEROUTERPROXY_ROUTECOMPLETIONL_4, "TSY: CMmMessageRouterProxy::RouteCompletion: active: %u, done: %u",(TUint)iMmPhone->IsPBInitActive(), (TUint)done); |
790 if ( iMmPhone->IsPBInitActive() && !done ) |
796 if ( iMmPhone->IsPBInitActive() && !done ) |
791 { |
797 { |
792 TFLOGSTRING2("TSY: CMmMessageRouterProxy::RouteCompletion: complete also to: %S",pbStore->PhoneBookName()); |
798 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMESSAGEROUTERPROXY_ROUTECOMPLETIONL_5, "TSY: CMmMessageRouterProxy::RouteCompletion: complete also to: %S",*(pbStore->PhoneBookName())); |
793 mmObject = static_cast<CBase*>( pbStore ); |
799 mmObject = static_cast<CBase*>( pbStore ); |
794 static_cast<CMmPhoneBookStoreTsy*>( mmObject )-> |
800 static_cast<CMmPhoneBookStoreTsy*>( mmObject )-> |
795 CompletePBStoreInitializationL( |
801 CompletePBStoreInitializationL( |
796 aResult, aDataPackage ); |
802 aResult, aDataPackage ); |
797 } |
803 } |
2604 static_cast<CMmPhoneTsy*>( mmObject )-> |
2610 static_cast<CMmPhoneTsy*>( mmObject )-> |
2605 GetSecurityTsy()->CompleteNotifySecurityCodeInfoChange( |
2611 GetSecurityTsy()->CompleteNotifySecurityCodeInfoChange( |
2606 aDataPackage, aResult ); |
2612 aDataPackage, aResult ); |
2607 break; |
2613 break; |
2608 case EMmTsyPhoneBookStoreFdnInfoIPC: |
2614 case EMmTsyPhoneBookStoreFdnInfoIPC: |
2609 TFLOGSTRING("TSY: CMmMessageRouterProxy::RouteCompletion: route to phonetsy EMmTsyPhoneBookStoreFdnInfoIPC"); |
2615 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMESSAGEROUTERPROXY_ROUTECOMPLETIONL_6, "TSY: CMmMessageRouterProxy::RouteCompletion: route to phonetsy EMmTsyPhoneBookStoreFdnInfoIPC"); |
2610 static_cast<CMmPhoneTsy*>( mmObject )-> |
2616 static_cast<CMmPhoneTsy*>( mmObject )-> |
2611 SaveFdnInfoDetails( aResult, aDataPackage ); |
2617 SaveFdnInfoDetails( aResult, aDataPackage ); |
2612 break; |
2618 break; |
2613 default: |
2619 default: |
2614 break; |
2620 break; |
2647 mmObject = REINTERPRET_CAST( CBase*, |
2653 mmObject = REINTERPRET_CAST( CBase*, |
2648 iMmPhone->LineList()->GetMmLineByMode( callMode ) ); |
2654 iMmPhone->LineList()->GetMmLineByMode( callMode ) ); |
2649 |
2655 |
2650 if ( NULL == mmObject ) |
2656 if ( NULL == mmObject ) |
2651 { |
2657 { |
2652 TFLOGSTRING("TSY: CMmMessageRouterProxy::RouteCompletion: Call object not found for mobile Call Info!"); |
2658 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMESSAGEROUTERPROXY_ROUTECOMPLETIONL_7, "TSY: CMmMessageRouterProxy::RouteCompletion: Call object not found for mobile Call Info!"); |
2653 } |
2659 } |
2654 else |
2660 else |
2655 { |
2661 { |
2656 // complete call added notification directly from here |
2662 // complete call added notification directly from here |
2657 static_cast<CMmLineTsy*>( mmObject )-> |
2663 static_cast<CMmLineTsy*>( mmObject )-> |
2686 iMmPhone->CallList()-> |
2692 iMmPhone->CallList()-> |
2687 GetMmCallByMode( callMode ) ); |
2693 GetMmCallByMode( callMode ) ); |
2688 |
2694 |
2689 if ( NULL == mmCall ) |
2695 if ( NULL == mmCall ) |
2690 { |
2696 { |
2691 TFLOGSTRING("TSY: CMmMessageRouterProxy::RouteCompletion: Call object not found for Dial!"); |
2697 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMESSAGEROUTERPROXY_ROUTECOMPLETIONL_8, "TSY: CMmMessageRouterProxy::RouteCompletion: Call object not found for Dial!"); |
2692 } |
2698 } |
2693 else |
2699 else |
2694 { |
2700 { |
2695 //find object that requested dial |
2701 //find object that requested dial |
2696 if ( ( mmCall->IsServiceLocallyRequested( |
2702 if ( ( mmCall->IsServiceLocallyRequested( |
2715 && mmCall->CallMode() == callMode ) |
2721 && mmCall->CallMode() == callMode ) |
2716 || ( mmCall->ServiceRequested( |
2722 || ( mmCall->ServiceRequested( |
2717 CMmCallTsy::EMultimodeCallDialISV ) |
2723 CMmCallTsy::EMultimodeCallDialISV ) |
2718 && mmCall->CallMode() == callMode ) ) |
2724 && mmCall->CallMode() == callMode ) ) |
2719 { |
2725 { |
2720 TFLOGSTRING("TSY: CMmMessageRouterProxy::RouteCompletion: Special case before CompleteDial"); |
2726 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMESSAGEROUTERPROXY_ROUTECOMPLETIONL_9, "TSY: CMmMessageRouterProxy::RouteCompletion: Special case before CompleteDial"); |
2721 mmCall->CompleteDial( aResult ); |
2727 mmCall->CompleteDial( aResult ); |
2722 break; |
2728 break; |
2723 } |
2729 } |
2724 |
2730 |
2725 if ( mmCall->ServiceRequested( |
2731 if ( mmCall->ServiceRequested( |
2726 CMmCallTsy::EMultimodeCallDialNoFdnCheck ) |
2732 CMmCallTsy::EMultimodeCallDialNoFdnCheck ) |
2727 && mmCall->CallMode() == callMode ) |
2733 && mmCall->CallMode() == callMode ) |
2728 { |
2734 { |
2729 TFLOGSTRING("TSY: CMmMessageRouterProxy::RouteCompletion: Special case before CompleteDialNoFdn"); |
2735 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMESSAGEROUTERPROXY_ROUTECOMPLETIONL_10, "TSY: CMmMessageRouterProxy::RouteCompletion: Special case before CompleteDialNoFdn"); |
2730 mmCall->CompleteDialNoFdn( aResult ); |
2736 mmCall->CompleteDialNoFdn( aResult ); |
2731 break; |
2737 break; |
2732 } |
2738 } |
2733 } |
2739 } |
2734 } |
2740 } |