14 * Description: USSD Manager. |
14 * Description: USSD Manager. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 // INCLUDE FILES |
18 // INCLUDE FILES |
19 #include "CPhSrvUssdManager.h" |
19 #include "cphsrvussdmanager.h" |
20 #include "PhSrvUtils.h" |
20 #include "phsrvutils.h" |
21 #include "CPhSrvUssdSendHandler.h" |
21 #include "cphsrvussdsendhandler.h" |
22 #include "CPhSrvUssdReceiveHandler.h" |
22 #include "cphsrvussdreceivehandler.h" |
23 #include "CPhSrvUssdNotifyNWRelease.h" |
23 #include "cphsrvussdnotifynwrelease.h" |
24 #include "CPhSrvResourceManager.h" |
24 #include "cphsrvresourcemanager.h" |
25 #include "CPhSrvUssdReplyTimer.h" |
25 #include "cphsrvussdreplytimer.h" |
26 #include "MPhSrvUssdMessageSentObserver.h" |
26 #include "mphsrvussdmessagesentobserver.h" |
27 #include "MPhSrvPhoneInterface.h" |
27 #include "mphsrvphoneinterface.h" |
28 #include "CPhSrvUssdSessionCancelWaiter.h" |
28 #include "cphsrvussdsessioncancelwaiter.h" |
29 |
29 |
30 #include <AknGlobalNote.h> |
|
31 #include <aknnotedialog.h> |
|
32 #include <aknstaticnotedialog.h> |
|
33 #include <AknProgressDialog.h> |
|
34 #include <apacmdln.h> |
30 #include <apacmdln.h> |
35 #include <apgtask.h> |
31 #include <apgtask.h> |
36 #include <bautils.h> |
32 #include <bautils.h> |
37 #include <StringLoader.h> |
|
38 #include <AknGlobalMsgQuery.h> |
|
39 #include <textresolver.h> |
33 #include <textresolver.h> |
40 #include <charconv.h> |
34 #include <charconv.h> |
41 #include <gsmuelem.h> |
35 #include <gsmuelem.h> |
42 #include <exterror.h> |
36 #include <exterror.h> |
43 #include <rmmcustomapi.h> |
37 #include <rmmcustomapi.h> |
44 |
38 |
45 #include <w32std.h> |
39 #include <w32std.h> |
46 #include <apgcli.h> |
40 #include <apgcli.h> |
47 #include <CPhCltUssd.h> |
41 #include <cphcltussd.h> |
48 #include <avkon.rsg> |
42 #include <hbtextresolversymbian.h> |
49 #include <PhoneServer.rsg> |
43 #include <phoneserver.rsg> |
50 #include <telservicesvariant.hrh> |
44 #include "phsrvdebuginfo.h" |
51 #include "PhSrvDebugInfo.h" |
|
52 #include <e32property.h> |
45 #include <e32property.h> |
53 |
|
54 #include <NcnListInternalPSKeys.h> |
|
55 #include <centralrepository.h> |
46 #include <centralrepository.h> |
56 #include <telservicesinternalcrkeys.h> |
|
57 #include <coreapplicationuisdomainpskeys.h> |
47 #include <coreapplicationuisdomainpskeys.h> |
58 |
48 |
59 //RM-RIM 417-66528 |
|
60 #include <CUssdExtensionInterface.h> |
|
61 |
49 |
62 // CONSTANTS |
50 // CONSTANTS |
63 const TInt KPhSrvDefaultValue = 0x00000000; |
51 const TInt KPhSrvDefaultValue = 0x00000000; |
64 // const TInt KPhSrvUssdNoTone = 0; // See SharedDataKeysVariant.h or NcnListInternalPSKeys.h |
52 // See SharedDataKeysVariant.h or NcnListInternalPSKeys.h |
65 const TInt KPhSrvUssdTone = 2; // See SharedDataKeysVariant.h or NcnListInternalPSKeys.h |
53 // const TInt KPhSrvUssdNoTone = 0; |
66 |
|
67 // const TInt KPhSrvUssdTimeOutObserverGranularity = 2; |
54 // const TInt KPhSrvUssdTimeOutObserverGranularity = 2; |
68 // const TInt KPhSrvUssdSentMessageObserverGranularity = 2; |
55 // const TInt KPhSrvUssdSentMessageObserverGranularity = 2; |
69 const TInt KPhSrvUssdAppUID = 0x10005955; |
56 // See KUssdSecureId in phcltclientserver.h |
|
57 //const TInt KPhSrvUssdAppUID = 0x10005955; |
70 |
58 |
71 const TInt KPhSrvUssdMessageQueryInterval = 500000; // 0.5 sec |
59 const TInt KPhSrvUssdMessageQueryInterval = 500000; // 0.5 sec |
72 const TInt KPhSrvUssdNoteExitPeriod = 500000; // 0.5 sec |
60 //const TInt KPhSrvUssdNoteExitPeriod = 500000; // 0.5 sec |
73 // |
61 // |
74 const TUint KPhSrvUssdDefaultDCS = 0x0f; // 00001111 |
62 const TUint KPhSrvUssdDefaultDCS = 0x0f; // 00001111 |
75 |
63 |
76 const TUint KPhSrvUssdDcsAlphabetDefaultPrecededLanguage = 0x10;// 00010000 |
64 const TUint KPhSrvUssdDcsAlphabetDefaultPrecededLanguage = 0x10;// 00010000 |
77 const TUint KPhSrvUssdDcsAlphabetDefaultPrecededLanguageSkipChars3 = 3; |
65 const TUint KPhSrvUssdDcsAlphabetDefaultPrecededLanguageSkipChars3 = 3; |
515 // |
513 // |
516 CPhSrvUssdSendHandler& CPhSrvUssdManager::SendHandlerL() |
514 CPhSrvUssdSendHandler& CPhSrvUssdManager::SendHandlerL() |
517 { |
515 { |
518 // If SendHandler is not created, first check that MO Ussd |
516 // If SendHandler is not created, first check that MO Ussd |
519 // is supported by the TSY. |
517 // is supported by the TSY. |
520 _DPRINT( 4, "PhSrv.SendHandlerL.Start" ); // debug print |
518 _DPRINT( 4, "PhSrv.SendHandlerL.Start" ); |
521 if ( iUssdSendHandler == NULL ) |
519 if ( iUssdSendHandler == NULL ) |
522 { |
520 { |
523 _DPRINT( 4, "PhSrv.SendHandlerL.iUssdSendHandler.NULL" ); // debug print |
521 _DPRINT( 4, "PhSrv.SendHandlerL.iUssdSendHandler.NULL" ); |
524 RMobileUssdMessaging::TMobileUssdCapsV1 caps; |
522 RMobileUssdMessaging::TMobileUssdCapsV1 caps; |
525 RMobileUssdMessaging::TMobileUssdCapsV1Pckg pckgCaps( caps ); |
523 RMobileUssdMessaging::TMobileUssdCapsV1Pckg pckgCaps( caps ); |
526 User::LeaveIfError( iMobileUssdMessaging.GetCaps( pckgCaps ) ); |
524 User::LeaveIfError( iMobileUssdMessaging.GetCaps( pckgCaps ) ); |
527 _DPRINT( 4, "PhSrv.SendHandlerL.iMobileUssdMessaging.GetCaps" ); // debug print |
525 _DPRINT( 4, "PhSrv.SendHandlerL.iMobileUssdMessaging.GetCaps" ); |
528 |
526 |
529 if ( ( caps.iUssdTypes & RMobileUssdMessaging::KCapsMOUssd ) == 0 || |
527 if ( ( caps.iUssdTypes & RMobileUssdMessaging::KCapsMOUssd ) == 0 || |
530 ( caps.iUssdFormat & RMobileUssdMessaging::KCapsPackedString ) |
528 ( caps.iUssdFormat & RMobileUssdMessaging::KCapsPackedString ) |
531 == 0 ) |
529 == 0 ) |
532 { |
530 { |
533 _DPRINT( 4, "PhSrv.SendHandlerL.KErrNotSupported" ); // debug print |
531 _DPRINT( 4, "PhSrv.SendHandlerL.KErrNotSupported" ); |
534 User::Leave( KErrNotSupported ); |
532 User::Leave( KErrNotSupported ); |
535 } |
533 } |
536 |
534 |
537 iUssdSendHandler = |
535 iUssdSendHandler = |
538 new( ELeave ) CPhSrvUssdSendHandler( |
536 new( ELeave ) CPhSrvUssdSendHandler( |
539 *this, |
537 *this, |
540 iMobileUssdMessaging, |
538 iMobileUssdMessaging, |
541 *iPhoneInterface ); |
539 *iPhoneInterface ); |
542 } |
540 } |
543 _DPRINT( 4, "PhSrv.SendHandlerL.End" ); // debug print |
541 _DPRINT( 4, "PhSrv.SendHandlerL.End" ); |
544 return *iUssdSendHandler; |
542 return *iUssdSendHandler; |
545 } |
543 } |
546 |
544 |
547 |
545 |
548 // ----------------------------------------------------------------------------- |
546 // ----------------------------------------------------------------------------- |
555 void CPhSrvUssdManager::SendUssdL( |
553 void CPhSrvUssdManager::SendUssdL( |
556 const TDesC8& aMsgData, |
554 const TDesC8& aMsgData, |
557 RMobileUssdMessaging::TMobileUssdAttributesV1& aMsgAttribute, |
555 RMobileUssdMessaging::TMobileUssdAttributesV1& aMsgAttribute, |
558 MPhSrvUssdMessageSentObserver& aObserver ) |
556 MPhSrvUssdMessageSentObserver& aObserver ) |
559 { |
557 { |
560 _DPRINT( 4, "PhSrv.SendUssdL.Start ######" ); // debug print |
558 _DPRINT( 4, "PhSrv.SendUssdL.Start ######" ); |
561 _DPRINT_FLAGS(); |
559 _DPRINT_FLAGS(); |
562 |
|
563 //417-66528 |
|
564 if (iUssdExtnInterface) |
|
565 { |
|
566 if(!iUssdExtnInterface->ValidateUssdMsgSending(aMsgData,aMsgAttribute)) |
|
567 { |
|
568 // invalid attempt to send USSD message. Show the note |
|
569 User::Leave( KErrAccessDenied ); |
|
570 } |
|
571 } |
|
572 |
560 |
573 if ( iObserver && iNetworkReleased ) |
561 if ( iObserver && iNetworkReleased ) |
574 { |
562 { |
575 // Network has been released but the previous send request is still alive. |
563 // Network has been released but the previous send request is still alive. |
576 // Cancel the pervious send operation, complete the old request with error |
564 // Cancel the pervious send operation, complete the old request with error |
577 // and clean up the pointer. |
565 // and clean up the pointer. |
578 _DPRINT( 4, "PhSrv.SendUssdL.Error.Complete.Existing" ); // debug print |
566 _DPRINT( 4, "PhSrv.SendUssdL.Error.Complete.Existing" ); |
579 if ( iUssdSendHandler ) |
567 if ( iUssdSendHandler ) |
580 { |
568 { |
581 iUssdSendHandler->Cancel(); |
569 iUssdSendHandler->Cancel(); |
582 } |
570 } |
583 iObserver->UssdMessageSentObserverHandleResult( KErrSessionClosed ); |
571 iObserver->UssdMessageSentObserverHandleResult( KErrSessionClosed ); |
584 iObserver = NULL; |
572 iObserver = NULL; |
585 } |
573 } |
586 |
574 |
587 if ( iObserver || iSendingAck ) |
575 if ( iObserver || iSendingAck ) |
588 { |
576 { |
589 _DPRINT( 4, "PhSrv.SendUssdL.KErrInUse" ); // debug print |
577 _DPRINT( 4, "PhSrv.SendUssdL.KErrInUse" ); |
590 // Other client is using the service. |
578 // Other client is using the service. |
591 User::Leave( KErrInUse ); |
579 User::Leave( KErrInUse ); |
592 } |
580 } |
593 |
581 |
594 // Check that message type is set |
582 // Check that message type is set |
595 if( ( aMsgAttribute.iFlags & RMobileUssdMessaging::KUssdMessageType ) |
583 if( ( aMsgAttribute.iFlags & RMobileUssdMessaging::KUssdMessageType ) |
596 == 0 ) |
584 == 0 ) |
597 _DPRINT( 4, "PhSrv.SendUssdL.KUssdMessageType.0" ); // debug print |
585 _DPRINT( 4, "PhSrv.SendUssdL.KUssdMessageType.0" ); |
598 { |
586 { |
599 // Mesasge type not set -> Set it. |
587 // Mesasge type not set -> Set it. |
600 aMsgAttribute.iFlags |= RMobileUssdMessaging::KUssdMessageType; |
588 aMsgAttribute.iFlags |= RMobileUssdMessaging::KUssdMessageType; |
601 if ( NetworkWaitingForAnAnswer() ) |
589 if ( NetworkWaitingForAnAnswer() ) |
602 { |
590 { |
603 // Network is waiting for an answer |
591 // Network is waiting for an answer |
604 _DPRINT( 4, "PhSrv.SendUssdL.EUssdMOReply" ); // debug print |
592 _DPRINT( 4, "PhSrv.SendUssdL.EUssdMOReply" ); // debug print |
605 aMsgAttribute.iType = RMobileUssdMessaging::EUssdMOReply; |
593 aMsgAttribute.iType = RMobileUssdMessaging::EUssdMOReply; |
606 } |
594 } |
607 else |
595 else |
608 { |
596 { |
609 _DPRINT( 4, "PhSrv.SendUssdL.EUssdMORequest" ); // debug print |
597 _DPRINT( 4, "PhSrv.SendUssdL.EUssdMORequest" ); // debug print |
827 iReceivedMessage.Zero(); |
813 iReceivedMessage.Zero(); |
828 DecodeL(aMsgData, iDecodedMessage, dcs); |
814 DecodeL(aMsgData, iDecodedMessage, dcs); |
829 if(iDecodedMessage.Length() > 0) |
815 if(iDecodedMessage.Length() > 0) |
830 { |
816 { |
831 iReceivedMessage = iDecodedMessage; |
817 iReceivedMessage = iDecodedMessage; |
832 } |
|
833 // 4. Invoke UssdExtensionPlugin |
|
834 // 417-66528 |
|
835 TBool isResponseValidated = EFalse; |
|
836 if (iUssdExtnInterface) |
|
837 { |
|
838 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.InvokeExtension" ); |
|
839 isResponseValidated = iUssdExtnInterface->ValidateUssdResponse(aMsgData); |
|
840 } |
818 } |
841 // 5. Show note. |
819 // 5. Show note. |
842 // debug print |
820 // debug print |
843 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.Note" ); |
821 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.Note" ); |
844 if ( !( aMsgAttributes.iFlags & RMobileUssdMessaging::KUssdMessageType ) || |
822 if ( !( aMsgAttributes.iFlags & RMobileUssdMessaging::KUssdMessageType ) || |
845 aMsgAttributes.iType != RMobileUssdMessaging::EUssdMTRequest ) |
823 aMsgAttributes.iType != RMobileUssdMessaging::EUssdMTRequest ) |
846 { |
824 { |
847 if ( !ShowNotesL() ) |
825 if ( !ShowNotesL() ) |
848 { |
826 { |
849 // debug print |
827 |
850 _DPRINT( 4, |
828 _DPRINT( 4, |
851 "PhSrv.UssdHandleReceivedEventL.SAtReturn" ); |
829 "PhSrv.UssdHandleReceivedEventL.SAtReturn" ); |
852 return; |
830 return; |
853 } |
831 } |
854 } |
832 } |
855 //6. Check if the response is valid for the extension |
833 |
856 //RM-RIM 417-66528 |
834 // empty string is handled as ok message |
857 if (iUssdExtnInterface && isResponseValidated) |
835 if ( !iDecodedMessage.Length() ) |
858 PorcessReceivedMessageInExtesnionL(aMsgData, aMsgAttributes); |
836 { |
|
837 TurnLightsOn(); //Ensure lights on |
|
838 |
|
839 _DPRINT( 4, |
|
840 "PhSrv.UssdHandleReceivedEventL.EmptyString" ); |
|
841 |
|
842 ShowDoneNoteL(); |
|
843 |
|
844 |
|
845 _DPRINT( 4, |
|
846 "PhSrv.UssdHandleReceivedEventL.EmptyString.OK" ); |
|
847 } |
859 else |
848 else |
860 ProcessReceivedMessageL(aMsgData, aMsgAttributes); |
849 { |
|
850 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.String" ); |
|
851 iNotifyMessage = ( aMsgAttributes.iType == RMobileUssdMessaging::EUssdMTNotify ); |
|
852 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
|
853 _DDPRINT( 4, "PhSrv.UssdNOHREventL.iNotifyMessage: ", iNotifyMessage ); |
|
854 iMsgTypeReply = ( aMsgAttributes.iType == RMobileUssdMessaging::EUssdMTReply ); |
|
855 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iMsgTypeReply: ", iMsgTypeReply ); |
861 |
856 |
862 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.Editor" ); |
857 if ( iNotifyMessage ) |
863 if (aMsgAttributes.iType == RMobileUssdMessaging::EUssdMTRequest |
|
864 && UssdAppTaskExistsL()) |
|
865 { |
|
866 iEmptyEditor = ETrue; |
|
867 } _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.End" ); |
|
868 } |
|
869 // ----------------------------------------------------------------------------- |
|
870 // CPhSrvUssdManager::ProcessReceivedMessageL |
|
871 // |
|
872 // |
|
873 // |
|
874 // ----------------------------------------------------------------------------- |
|
875 // |
|
876 void CPhSrvUssdManager::ProcessReceivedMessageL(const TDes8& /*aMsgData*/, |
|
877 const RMobileUssdMessaging::TMobileUssdAttributesV1& aMsgAttributes) |
|
878 { |
|
879 // empty string is handled as ok message |
|
880 if (!iDecodedMessage.Length()) |
|
881 { |
|
882 TurnLightsOn(); //Ensure lights on |
|
883 |
|
884 // debug print |
|
885 _DPRINT( 4, |
|
886 "PhSrv.UssdHandleReceivedEventL.EmptyString" ); |
|
887 ShowDoneNoteL(); |
|
888 // debug print |
|
889 _DPRINT( 4, |
|
890 "PhSrv.UssdHandleReceivedEventL.EmptyString.OK" ); |
|
891 } |
|
892 else |
|
893 { |
|
894 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.String" ); |
|
895 iNotifyMessage = (aMsgAttributes.iType |
|
896 == RMobileUssdMessaging::EUssdMTNotify); |
|
897 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
|
898 _DDPRINT( 4, "PhSrv.UssdNOHREventL.iNotifyMessage: ", iNotifyMessage ); |
|
899 iMsgTypeReply = (aMsgAttributes.iType |
|
900 == RMobileUssdMessaging::EUssdMTReply); |
|
901 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iMsgTypeReply: ", iMsgTypeReply ); |
|
902 |
|
903 if (iNotifyMessage) |
|
904 { |
858 { |
905 // need to send an MO ack |
859 // need to send an MO ack |
906 iAcksToBeSent++; |
860 iAcksToBeSent ++; |
907 } |
861 } |
908 |
862 |
909 if (iNotifyMessage || iMsgTypeReply) |
863 if ( !iDeviceDialog ){ |
|
864 iDeviceDialog = CHbDeviceMessageBoxSymbian::NewL( |
|
865 CHbDeviceMessageBoxSymbian::EInformation ); |
|
866 iDeviceDialog->SetObserver( this ); |
|
867 iDeviceDialog->SetTimeout( KPhSrvUssdTimeout ); |
|
868 iDeviceDialog->SetDismissPolicy ( KPhSrvUssdPopupDismissPolicy ); |
|
869 iDeviceDialog->SetIconVisible(EFalse); |
|
870 |
|
871 // Show left key with empty string accoring to ui concept |
|
872 iDeviceDialog->SetButton( |
|
873 CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); |
|
874 // Show Exit Key always |
|
875 iDeviceDialog->SetButton( |
|
876 CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); |
|
877 iDeviceDialog->SetButtonTextL( |
|
878 CHbDeviceMessageBoxSymbian::ERejectButton, |
|
879 LoadDefaultString( KUssdExit ) ); |
|
880 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.Exit" ); |
|
881 } |
|
882 |
|
883 if ( iNotifyMessage || iMsgTypeReply ) |
910 { |
884 { |
911 //This is for reply message in notifyarray |
885 //This is for reply message in notifyarray |
912 iNotifyMessage = ETrue; |
886 iNotifyMessage = ETrue; |
913 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
887 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
914 |
888 |
915 //Notify added to array |
889 //Notify added to array |
916 iNotifyArray->AppendL(iReceivedMessage); |
890 iNotifyArray->AppendL( iReceivedMessage ); |
917 |
891 |
918 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.AppendL" ); // debug print |
892 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.AppendL" ); |
919 UpdateNotifyMessage(); |
893 UpdateNotifyMessageL(); |
920 |
894 |
921 if (!iSendRelease && NotifyCount() <= 1) |
895 if ( !iSendRelease && NotifyCount() <= 1 ) |
922 { |
896 { |
923 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.!SendRelease.Cancel" ); // debug print |
897 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.!SendRelease.Cancel" ); |
924 Cancel(); |
898 Cancel(); |
925 } |
899 } |
926 } |
900 } |
927 else |
901 else |
928 { |
902 { |
929 // New message deletes old message, i.e. Cancel existing query. |
903 // New message deletes old message, i.e. Cancel existing query. |
930 Cancel(); |
904 Cancel(); |
931 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NewAnswerable" ); // debug print |
905 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NewAnswerable" ); |
932 } |
906 } |
933 CreateGlobalMessageQueryL(aMsgAttributes); |
907 |
|
908 // Remove Reply key |
|
909 if( !( aMsgAttributes.iFlags & RMobileUssdMessaging::KUssdMessageType ) |
|
910 || aMsgAttributes.iType != RMobileUssdMessaging::EUssdMTRequest ) |
|
911 { |
|
912 // Remove Answer key |
|
913 iDeviceDialog->SetButton( |
|
914 CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); |
|
915 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NoAnswer" ); |
|
916 } |
|
917 // Show Reply key |
|
918 else |
|
919 { |
|
920 iDeviceDialog->SetButton( |
|
921 CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue ); |
|
922 iDeviceDialog->SetButtonTextL( |
|
923 CHbDeviceMessageBoxSymbian::EAcceptButton, |
|
924 LoadDefaultString( KUssdReply ) ); |
|
925 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.WithAnswer" ); |
|
926 } |
|
927 |
|
928 |
|
929 _DPRINT( 4, |
|
930 "PhSrv.UssdHandleReceivedEventL.String.Middle" ); |
|
931 |
|
932 // Play the USSD tone if needed. Logically should be in RunL, but here |
|
933 // to give better balancing with voice and visible message. |
|
934 // <-- QT PHONE START--> |
|
935 /* |
|
936 if ( IsTelephonyFeatureSupported( KTelephonyLVFlagUssdTone ) ) |
|
937 { |
|
938 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.PlayTone" ); |
|
939 PlayUssdTone(); |
|
940 } |
|
941 */ |
|
942 // <-- QT PHONE END--> |
|
943 // Launch the new message query |
|
944 if ( !IsActive() ) |
|
945 { |
|
946 iLaunchGMQ = ETrue; |
|
947 iTimer.After( iStatus , KPhSrvUssdMessageQueryInterval ); |
|
948 SetActive(); |
|
949 } |
934 AsyncProcessMoAcks(); |
950 AsyncProcessMoAcks(); |
935 } |
951 } |
936 _DPRINT( 4, "PhSrv.ProcesdReceivedMessageL.End" ); |
952 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.Editor" ); |
937 } |
953 if( aMsgAttributes.iType == RMobileUssdMessaging::EUssdMTRequest && UssdAppTaskExistsL() ) |
938 |
954 { |
939 // ----------------------------------------------------------------------------- |
955 iEmptyEditor = ETrue; |
940 // CPhSrvUssdManager::PorcessReceivedMessageInExtesnionL |
956 } |
941 // |
957 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.End" ); |
942 // |
958 } |
943 // |
959 |
944 // ----------------------------------------------------------------------------- |
|
945 // |
|
946 void CPhSrvUssdManager::PorcessReceivedMessageInExtesnionL( |
|
947 const TDes8& /*aMsgData*/, |
|
948 const RMobileUssdMessaging::TMobileUssdAttributesV1& aMsgAttributes) |
|
949 { |
|
950 TInt errfromextension = KErrNone; |
|
951 // empty string is handled as ok message |
|
952 if (!iDecodedMessage.Length()) |
|
953 { |
|
954 // debug print |
|
955 _DPRINT( 4, |
|
956 "PhSrv.UssdHandleReceivedEventL.EmptyString" ); |
|
957 //RM-RIM 417-66528 |
|
958 TRAP_IGNORE(iUssdExtnInterface->ProcessReceivedUssdL(iDecodedMessage, errfromextension)); |
|
959 // debug print |
|
960 _DPRINT( 4, |
|
961 "PhSrv.UssdHandleReceivedEventL.EmptyString.OK" ); |
|
962 } |
|
963 else |
|
964 { |
|
965 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.String" ); |
|
966 iNotifyMessage = (aMsgAttributes.iType |
|
967 == RMobileUssdMessaging::EUssdMTNotify); |
|
968 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
|
969 _DDPRINT( 4, "PhSrv.UssdNOHREventL.iNotifyMessage: ", iNotifyMessage ); |
|
970 iMsgTypeReply = (aMsgAttributes.iType |
|
971 == RMobileUssdMessaging::EUssdMTReply); |
|
972 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iMsgTypeReply: ", iMsgTypeReply ); |
|
973 |
|
974 if (iNotifyMessage) |
|
975 { |
|
976 // need to send an MO ack |
|
977 iAcksToBeSent++; |
|
978 } |
|
979 |
|
980 if (iNotifyMessage || iMsgTypeReply) |
|
981 { |
|
982 //This is for reply message in notifyarray |
|
983 iNotifyMessage = ETrue; |
|
984 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
|
985 if (!iSendRelease && NotifyCount() <= 1) |
|
986 { |
|
987 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.!SendRelease.Cancel" ); // debug print |
|
988 Cancel(); |
|
989 } |
|
990 } |
|
991 else |
|
992 { |
|
993 // New message deletes old message, i.e. Cancel existing query. |
|
994 Cancel(); |
|
995 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NewAnswerable" ); // debug print |
|
996 } |
|
997 TInt errfromextension = KErrNone; |
|
998 ProcessMoAcksL(); |
|
999 iLaunchGMQ = EFalse; |
|
1000 TRAP_IGNORE(iUssdExtnInterface->ProcessReceivedUssdL(iDecodedMessage, errfromextension)); |
|
1001 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.Extn.ProcessReceivedUssdL.ErrCode", errfromextension); |
|
1002 } |
|
1003 } |
|
1004 // ----------------------------------------------------------------------------- |
960 // ----------------------------------------------------------------------------- |
1005 // CPhSrvUssdManager::RestartReplyTimerL |
961 // CPhSrvUssdManager::RestartReplyTimerL |
1006 // |
962 // |
1007 // |
963 // |
1008 // |
964 // |
1034 // ----------------------------------------------------------------------------- |
990 // ----------------------------------------------------------------------------- |
1035 // |
991 // |
1036 void CPhSrvUssdManager::UssdNetworkObserverHandleNotifyNWReleaseL( |
992 void CPhSrvUssdManager::UssdNetworkObserverHandleNotifyNWReleaseL( |
1037 const RMobilePhone::TMobilePhoneSendSSRequestV3 & aReturnResult, |
993 const RMobilePhone::TMobilePhoneSendSSRequestV3 & aReturnResult, |
1038 TInt aError ) |
994 TInt aError ) |
1039 { |
995 { |
1040 _DDPRINT( 4, "PhSrv.UssdNotifyNWRelease ##### ", aError ); // debug print |
996 _DDPRINT( 4, "PhSrv.UssdNotifyNWRelease ##### ", aError ); // debug print |
1041 _DPRINT_FLAGS(); |
997 _DPRINT_FLAGS(); |
1042 TBool showNotes = ShowNotesL(); |
998 TBool showNotes = ShowNotesL(); |
1043 iNetworkReleased = ETrue; |
999 iNetworkReleased = ETrue; |
1044 iSendingAck = EFalse; |
1000 iSendingAck = EFalse; |
1045 iSendRelease = EFalse; |
1001 iSendRelease = EFalse; |
1046 iAcksToBeSent = 0; |
1002 iAcksToBeSent = 0; |
1047 |
1003 |
1048 if ( iHavePendingSatMessagePointer ) |
1004 if ( iHavePendingSatMessagePointer ) |
1049 { |
1005 { |
1050 iReturnResult = aReturnResult; |
1006 iReturnResult = aReturnResult; |
1051 if ( !iSatCanceled ) |
1007 if ( !iSatCanceled ) |
1052 { |
1008 { |
1053 CompleteSatL(&iReceivedMessage, aError ); |
1009 CompleteSatL(&iReceivedMessage, aError ); |
1054 _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleNotifyNWReleaseL.CompleteSat" ); // debug print |
1010 _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleNotifyNWReleaseL.CompleteSat" ); |
1055 } |
1011 } |
1056 } |
1012 } |
1057 if ( iUssdReplyTimer && iUssdReplyTimer->IsTimerActive() ) |
1013 if ( iUssdReplyTimer && iUssdReplyTimer->IsTimerActive() ) |
1058 { |
1014 { |
1059 _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleNotifyNWReleaseL.Timer.Stop" ); |
1015 _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleNotifyNWReleaseL.Timer.Stop" ); |
1060 iUssdReplyTimer->Stop(); |
1016 iUssdReplyTimer->Stop(); |
1061 Cancel(); |
1017 Cancel(); |
1062 CheckArray(); |
1018 CheckArray(); |
1063 } |
1019 } |
1064 if ( showNotes && iShowDone ) |
1020 if ( showNotes && iShowDone ) |
1065 { |
1021 { |
1066 ShowDoneNoteL(); |
1022 ShowDoneNoteL(); |
1067 } |
1023 } |
1068 if ( iUssdSendHandler && iSendingAck ) |
1024 if ( iUssdSendHandler && iSendingAck ) |
1069 { |
1025 { |
1070 // if we are sending ack, it can be canceled. |
1026 // if we are sending ack, it can be canceled. |
1071 iUssdSendHandler->Cancel(); |
1027 iUssdSendHandler->Cancel(); |
1072 } |
1028 } |
1073 //417-66528 |
1029 |
1074 //Notify Extension on NWRelease |
|
1075 if(iUssdExtnInterface) |
|
1076 { |
|
1077 iUssdExtnInterface->NotifyNWError(aError); |
|
1078 } |
|
1079 iSatCanceled = EFalse; |
1030 iSatCanceled = EFalse; |
1080 _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleNotifyNWReleaseL.iSatCanceled.EFalse" ); |
1031 _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleNotifyNWReleaseL.iSatCanceled.EFalse" ); |
1081 iShowDone = EFalse; |
1032 iShowDone = EFalse; |
1082 _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleNotifyNWReleaseL.Ending" ); |
1033 _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleNotifyNWReleaseL.Ending" ); |
1083 _DPRINT_FLAGS(); |
1034 _DPRINT_FLAGS(); |
1084 _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleNotifyNWReleaseL.End" ); |
1035 _DPRINT( 4, "PhSrv.UssdNetworkObserverHandleNotifyNWReleaseL.End" ); |
1085 } |
1036 } |
1086 |
1037 |
1087 // ----------------------------------------------------------------------------- |
1038 // ----------------------------------------------------------------------------- |
1088 // CPhSrvUssdManager::ShowDoneNoteL |
1039 // CPhSrvUssdManager::ShowDoneNoteL |
1089 // |
1040 // |
1090 // ----------------------------------------------------------------------------- |
1041 // ----------------------------------------------------------------------------- |
1091 // |
1042 // |
1092 void CPhSrvUssdManager::ShowDoneNoteL() |
1043 void CPhSrvUssdManager::ShowDoneNoteL() |
1093 { |
1044 { |
1094 _DDPRINT( 4, "PhSrv.ShowDoneNoteL.iShowDone", iShowDone ); |
1045 _DDPRINT( 4, "PhSrv.ShowDoneNoteL.iShowDone", iShowDone ); |
1095 // Show global confirmation note "Done" |
1046 // Show global confirmation note "Done" |
1096 HBufC* noteText = iResourceManager.ReadResourceLC( R_PHSRV_TEXT_DONE ); |
1047 CHbDeviceMessageBoxSymbian::InformationL( |
1097 CAknGlobalNote* note = CAknGlobalNote::NewLC(); |
1048 LoadDefaultString( KUssdDone ) ); |
1098 note->ShowNoteL( EAknGlobalConfirmationNote, *noteText ); |
|
1099 CleanupStack::PopAndDestroy( note ); |
|
1100 CleanupStack::PopAndDestroy( noteText ); |
|
1101 iShowDone = EFalse; |
1049 iShowDone = EFalse; |
1102 } |
1050 } |
1103 |
1051 |
1104 // ----------------------------------------------------------------------------- |
1052 // ----------------------------------------------------------------------------- |
1105 // CPhSrvUssdManager::ShowErrorNoteL |
1053 // CPhSrvUssdManager::ShowErrorNoteL |
1329 _DPRINT( 4, "PhSrv.ReplyTimer.End" ); // debug print |
1279 _DPRINT( 4, "PhSrv.ReplyTimer.End" ); // debug print |
1330 } |
1280 } |
1331 |
1281 |
1332 |
1282 |
1333 // ----------------------------------------------------------------------------- |
1283 // ----------------------------------------------------------------------------- |
|
1284 // CPhSrvUssdManager::MessageBoxClosed |
|
1285 // ----------------------------------------------------------------------------- |
|
1286 // |
|
1287 void CPhSrvUssdManager::MessageBoxClosed( |
|
1288 const CHbDeviceMessageBoxSymbian* aMessageBox, |
|
1289 CHbDeviceMessageBoxSymbian::TButtonId aButton) |
|
1290 { |
|
1291 _DPRINT( 4, "PhSrv.MsgClose.Start" ); |
|
1292 // ussd device dialog observer callback function |
|
1293 TPtrC leftBtn = aMessageBox->ButtonText( |
|
1294 CHbDeviceMessageBoxSymbian::EAcceptButton ); |
|
1295 TPtrC rightBtn = aMessageBox->ButtonText( |
|
1296 CHbDeviceMessageBoxSymbian::ERejectButton ); |
|
1297 |
|
1298 TInt err = KErrNone; |
|
1299 // Click Yes on Confirmation note (Yes, No) |
|
1300 if ( !leftBtn.Compare( |
|
1301 LoadDefaultString( KUssdYes ) ) && |
|
1302 ( CHbDeviceMessageBoxSymbian::EAcceptButton == aButton ) ) |
|
1303 { |
|
1304 _DPRINT( 4, "PhSrv.MsgClose.SK.Yes" ); |
|
1305 iClearArray = EFalse; |
|
1306 iNotifyArray->Reset(); |
|
1307 TryCloseSession(); |
|
1308 } |
|
1309 // Click "No" on Confirmation note (Yes, No) |
|
1310 else if ( !rightBtn.Compare( |
|
1311 LoadDefaultString( KUssdNo ) ) && |
|
1312 ( CHbDeviceMessageBoxSymbian::ERejectButton == aButton ) ) |
|
1313 { |
|
1314 _DPRINT( 4, "PhSrv.MsgClose.SK.No" ); |
|
1315 iClearArray = EFalse; |
|
1316 iNotifyMessage = ETrue; // for removing the yes/no query |
|
1317 CheckArray(); |
|
1318 TryCloseSession(); |
|
1319 } |
|
1320 // Click "Next" on Notification note (Next, Exit) |
|
1321 else if ( !leftBtn.Compare( |
|
1322 LoadDefaultString( KUssdNext ) ) && |
|
1323 ( CHbDeviceMessageBoxSymbian::EAcceptButton == aButton ) ) |
|
1324 { |
|
1325 _DPRINT( 4, "PhSrv.MsgClose.SK.Next" ); |
|
1326 CheckArray(); |
|
1327 TryCloseSession(); |
|
1328 } |
|
1329 // Click "Exit" on Notification note (Next, Exit or only Exit) |
|
1330 else if ( !rightBtn.Compare( |
|
1331 LoadDefaultString( KUssdExit ) ) && |
|
1332 ( CHbDeviceMessageBoxSymbian::ERejectButton == aButton ) ) |
|
1333 { |
|
1334 TRAP( err, ClearArrayL() ); |
|
1335 _DDPRINT( 4, "PhSrv.MsgClose.SK.Clear.%d", err ); |
|
1336 TryCloseSession(); |
|
1337 _DPRINT( 4, "PhSrv.MsgClose.SK.Exit" ); |
|
1338 } |
|
1339 // Click "Reply" on Message note (Reply, Exit) |
|
1340 else if ( !leftBtn.Compare( |
|
1341 LoadDefaultString( KUssdReply ) ) && |
|
1342 ( CHbDeviceMessageBoxSymbian::EAcceptButton == aButton ) ) |
|
1343 { |
|
1344 // Answer |
|
1345 iStartEditor = ETrue; |
|
1346 iShowDone = EFalse; |
|
1347 // Start the USSD editor now. |
|
1348 TRAP( err, RequestStartEditingL() ); |
|
1349 _DDPRINT( 4, "PhSrv.MsgClose.RequestStartEditingL.%d", err ); |
|
1350 } |
|
1351 else |
|
1352 { |
|
1353 _DPRINT( 4, "PhSrv.MsgClose.SK.Default" ); |
|
1354 } |
|
1355 |
|
1356 _DPRINT( 4, "PhSrv.MsgClose.End" ); |
|
1357 } |
|
1358 |
|
1359 // ----------------------------------------------------------------------------- |
1334 // CPhSrvUssdManager::RunL |
1360 // CPhSrvUssdManager::RunL |
1335 // ----------------------------------------------------------------------------- |
1361 // ----------------------------------------------------------------------------- |
1336 // |
1362 // |
1337 void CPhSrvUssdManager::RunL() |
1363 void CPhSrvUssdManager::RunL() |
1338 { |
1364 { |
1339 _DPRINT( 4, "PhSrv.RunL.Start" ); // debug print |
1365 _DPRINT( 4, "PhSrv.RunL.Start" ); |
1340 |
1366 |
1341 ProcessMoAcksL(); |
1367 ProcessMoAcksL(); |
1342 |
1368 |
1343 if ( iLaunchGMQ ) |
1369 if ( iLaunchGMQ ) |
1344 { |
1370 { |
1348 _DPRINT( 4, "PhSrv.iLaunchGMQ.EFalse" ); |
1374 _DPRINT( 4, "PhSrv.iLaunchGMQ.EFalse" ); |
1349 } |
1375 } |
1350 else |
1376 else |
1351 { |
1377 { |
1352 iStartEditor = EFalse; |
1378 iStartEditor = EFalse; |
1353 |
1379 // update device dialog |
1354 TInt key = iStatus.Int(); |
|
1355 if ( key == EEikBidOk ) // OK key |
|
1356 { |
|
1357 if ( NetworkWaitingForAnAnswer() ) |
|
1358 { |
|
1359 key = EAknSoftkeyShow; |
|
1360 } |
|
1361 else |
|
1362 { |
|
1363 key = EAknSoftkeyExit; |
|
1364 } |
|
1365 } |
|
1366 |
|
1367 switch( key ) |
|
1368 { |
|
1369 case EAknSoftkeyShow: |
|
1370 { |
|
1371 // Answer |
|
1372 iStartEditor = ETrue; |
|
1373 iShowDone = EFalse; |
|
1374 // Start the USSD editor now. |
|
1375 _DPRINT( 4, "PhSrv.RunL.RequestStartEditingL" ); // debug print |
|
1376 RequestStartEditingL(); |
|
1377 break; |
|
1378 } |
|
1379 case EAknSoftkeyYes: |
|
1380 { |
|
1381 _DPRINT( 4, "PhSrv.RunL.SK.Yes" ); |
|
1382 iClearArray = EFalse; |
|
1383 iNotifyArray->Reset(); |
|
1384 TryCloseSession(); |
|
1385 break; |
|
1386 } |
|
1387 case EAknSoftkeyCancel: |
|
1388 _DPRINT( 4, "PhSrv.RunL.SK.Cancel" ); |
|
1389 if ( iHavePendingSatMessagePointer ) |
|
1390 { |
|
1391 iSatCanceled = ETrue; |
|
1392 CompleteSatL( &iReceivedMessage, KErrCancel ); |
|
1393 _DPRINT( 4, "PhSrv.RunL.CompleteSatL" ); |
|
1394 } |
|
1395 // fall through. |
|
1396 case EAknSoftkeyExit: |
|
1397 _DPRINT( 4, "PhSrv.RunL.SK.Exit" ); |
|
1398 ClearArrayL(); |
|
1399 TryCloseSession(); |
|
1400 break; |
|
1401 case EAknSoftkeyBack: |
|
1402 _DPRINT( 4, "PhSrv.RunL.SK.Back" ); |
|
1403 ClearArrayL(); |
|
1404 TryCloseSession(); |
|
1405 break; |
|
1406 case EAknSoftkeyNo: |
|
1407 _DPRINT( 4, "PhSrv.RunL.SK.No" ); |
|
1408 iClearArray = EFalse; |
|
1409 iNotifyMessage = ETrue; // for removing the yes/no query |
|
1410 // fall through. |
|
1411 case EAknSoftkeyNext: |
|
1412 _DPRINT( 4, "PhSrv.RunL.SK.Next" ); |
|
1413 CheckArray(); |
|
1414 TryCloseSession(); |
|
1415 break; |
|
1416 default: |
|
1417 _DPRINT( 4, "PhSrv.RunL.SK.Default" ); |
|
1418 break; |
|
1419 } |
|
1420 _DPRINT( 4, "PhSrv.RunL.End" ); // debug print |
1380 _DPRINT( 4, "PhSrv.RunL.End" ); // debug print |
1421 } |
1381 } |
1422 } |
1382 } |
1423 // RM-RIM 417-66528 |
1383 |
1424 // ----------------------------------------------------------------------------- |
|
1425 // CPhSrvUssdManager::CreateGlobalMessageQueryL |
|
1426 // ----------------------------------------------------------------------------- |
|
1427 // |
|
1428 void CPhSrvUssdManager::CreateGlobalMessageQueryL( |
|
1429 const RMobileUssdMessaging::TMobileUssdAttributesV1& aMsgAttributes) |
|
1430 { |
|
1431 if (!iGlobalMsgQuery) |
|
1432 { |
|
1433 iGlobalMsgQuery = CAknGlobalMsgQuery::NewL(); |
|
1434 } |
|
1435 |
|
1436 // Delay after message query so that application execution order will |
|
1437 // be correct. |
|
1438 iGlobalMsgQuery->SetExitDelay(KPhSrvUssdNoteExitPeriod); |
|
1439 |
|
1440 TInt softkeys = R_AVKON_SOFTKEYS_USSD_ANSWER_EXIT__ANSWER; |
|
1441 if (!(aMsgAttributes.iFlags & RMobileUssdMessaging::KUssdMessageType) |
|
1442 || aMsgAttributes.iType != RMobileUssdMessaging::EUssdMTRequest) |
|
1443 { |
|
1444 softkeys = R_AVKON_SOFTKEYS_EXIT; |
|
1445 } |
|
1446 |
|
1447 // Set timer that lauches Global MessageQuery after time interval. |
|
1448 iSoftkeys = softkeys; |
|
1449 |
|
1450 // debug print |
|
1451 _DPRINT( 4, |
|
1452 "PhSrv.UssdHandleReceivedEventL.String.Middle" ); |
|
1453 |
|
1454 // Play the USSD tone if needed. Logically should be in RunL, but here |
|
1455 // to give better balancing with voice and visible message. |
|
1456 if (IsTelephonyFeatureSupported(KTelSrvLVFlagUssdTone)) |
|
1457 { |
|
1458 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.PlayTone" ); |
|
1459 PlayUssdTone(); |
|
1460 } |
|
1461 // Launch the new message query |
|
1462 if (!IsActive()) |
|
1463 { |
|
1464 iLaunchGMQ = ETrue; |
|
1465 iTimer.After(iStatus, KPhSrvUssdMessageQueryInterval); |
|
1466 SetActive(); |
|
1467 } |
|
1468 } |
|
1469 // ----------------------------------------------------------------------------- |
1384 // ----------------------------------------------------------------------------- |
1470 // CPhSrvUssdManager::LaunchGlobalMessageQueryL |
1385 // CPhSrvUssdManager::LaunchGlobalMessageQueryL |
1471 // ----------------------------------------------------------------------------- |
1386 // ----------------------------------------------------------------------------- |
1472 // |
1387 // |
1473 void CPhSrvUssdManager::LaunchGlobalMessageQueryL() |
1388 void CPhSrvUssdManager::LaunchGlobalMessageQueryL() |
1474 { |
1389 { |
1475 _DPRINT( 4, "PhSrv.LGMQ.start" ); |
1390 _DPRINT( 4, "PhSrv.LGMQ.start" ); |
1476 _DPRINT_FLAGS(); |
1391 _DPRINT_FLAGS(); |
|
1392 |
1477 if ( iNotifyMessage ) |
1393 if ( iNotifyMessage ) |
1478 { |
1394 { |
1479 _DDPRINT( 4, "PhSrv.LGMQ.NotifyMessage", iNotifyMessage ); |
1395 _DDPRINT( 4, "PhSrv.LGMQ.NotifyMessage", iNotifyMessage ); |
1480 iNotifyMessage = ETrue; |
1396 iNotifyMessage = ETrue; |
1481 TInt count = NotifyCount(); |
1397 TInt count = NotifyCount(); |
|
1398 //check softkey in avkon.rss |
1482 if ( count > 1 ) |
1399 if ( count > 1 ) |
1483 { |
1400 { |
1484 iSoftkeys = R_AVKON_SOFTKEYS_NEXT_EXIT__NEXT; |
1401 // Next, Exit |
|
1402 iDeviceDialog->SetButton( |
|
1403 CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue ); |
|
1404 iDeviceDialog->SetButtonTextL( |
|
1405 CHbDeviceMessageBoxSymbian::EAcceptButton, |
|
1406 LoadDefaultString( KUssdNext ) ); |
|
1407 iDeviceDialog->SetButton( |
|
1408 CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); |
|
1409 iDeviceDialog->SetButtonTextL( |
|
1410 CHbDeviceMessageBoxSymbian::ERejectButton, |
|
1411 LoadDefaultString( KUssdExit ) ); |
|
1412 _DPRINT( 4, "PhSrv.LGMQ.Next&Exit" ); |
1485 } |
1413 } |
1486 else |
1414 else |
1487 { |
1415 { |
1488 iSoftkeys = R_AVKON_SOFTKEYS_EXIT; |
1416 // Only Exit |
|
1417 iDeviceDialog->SetButton( |
|
1418 CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); |
|
1419 iDeviceDialog->SetButton( |
|
1420 CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); |
|
1421 iDeviceDialog->SetButtonTextL( |
|
1422 CHbDeviceMessageBoxSymbian::ERejectButton, |
|
1423 LoadDefaultString( KUssdExit ) ); |
|
1424 _DPRINT( 4, "PhSrv.LGMQ.onlyExit" ); |
1489 } |
1425 } |
1490 if ( iClearArray ) |
1426 if ( iClearArray ) |
1491 { |
1427 { |
1492 iSoftkeys = R_AVKON_SOFTKEYS_YES_NO; |
1428 HbTextResolverSymbian::Init( KCommonLocFilename, KLocPath ); |
|
1429 _DPRINT( 4, "PhSrv.LGMQ.use common loc file" ); |
|
1430 // Yes, No |
|
1431 iDeviceDialog->SetButton( |
|
1432 CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue ); |
|
1433 iDeviceDialog->SetButtonTextL( |
|
1434 CHbDeviceMessageBoxSymbian::EAcceptButton, |
|
1435 LoadDefaultString( KUssdYes ) ); |
|
1436 iDeviceDialog->SetButton( |
|
1437 CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); |
|
1438 iDeviceDialog->SetButtonTextL( |
|
1439 CHbDeviceMessageBoxSymbian::ERejectButton, |
|
1440 LoadDefaultString( KUssdNo ) ); |
|
1441 _DPRINT( 4, "PhSrv.LGMQ.Yes&No" ); |
|
1442 HbTextResolverSymbian::Init( KUssdLocFilename, KLocPath ); |
|
1443 _DPRINT( 4, "PhSrv.LGMQ.back up to use ussd loc file" ); |
1493 } |
1444 } |
1494 iReceivedMessage.Zero(); |
1445 iReceivedMessage.Zero(); |
1495 iReceivedMessage = (*iNotifyArray)[0]; |
1446 iReceivedMessage = (*iNotifyArray)[0]; |
1496 } |
1447 } |
1497 TurnLightsOn(); //Ensure lights on |
1448 TurnLightsOn(); //Ensure lights on |
1498 |
1449 |
1499 _DPRINT( 4, "PhSrv.LGMQ.ShMsgQuery" ); // debug print |
1450 _DPRINT( 4, "PhSrv.LGMQ.ShMsgQuery" ); // debug print |
1500 // Launch Global MessageQuery as requested. |
1451 // Launch Global MessageQuery as requested. |
1501 iGlobalMsgQuery->ShowMsgQueryL(iStatus, iReceivedMessage, iSoftkeys, |
1452 // Dialog not support header text, this code is only |
1502 *iMeQuHeaderText, KNullDesC); |
1453 // for testing, not final solution. |
1503 _DPRINT( 4, "PhSrv.LGMQ.SetActive" ); |
1454 TInt receiveLength = iReceivedMessage.Length(); |
1504 SetActive(); |
1455 _DDPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.MsgLength", receiveLength ); |
|
1456 |
|
1457 TInt titleLength = LoadDefaultString( KUssdTitle ).Length(); |
|
1458 _DDPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.TilteLength", titleLength ); |
|
1459 |
|
1460 TInt length = receiveLength + titleLength; |
|
1461 _DDPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.TotalLength", length ); |
|
1462 |
|
1463 HBufC* titleAndText = HBufC::NewLC( length ); |
|
1464 titleAndText->Des().Append( LoadDefaultString( KUssdTitle ) ); |
|
1465 titleAndText->Des().Append( iReceivedMessage ); |
|
1466 iDeviceDialog->SetTextL( titleAndText->Des() ); |
|
1467 CleanupStack::Pop( titleAndText ); |
|
1468 |
|
1469 iDeviceDialog->Close(); |
|
1470 iDeviceDialog->ShowL(); |
1505 iShowDone = EFalse; |
1471 iShowDone = EFalse; |
|
1472 |
1506 // Do nothing else in RunL this time. |
1473 // Do nothing else in RunL this time. |
1507 _DPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.ret" ); // debug print |
1474 _DPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.ret" ); // debug print |
1508 } |
1475 } |
1509 |
1476 |
1510 // ----------------------------------------------------------------------------- |
1477 // ----------------------------------------------------------------------------- |
1604 // ----------------------------------------------------------------------------- |
1571 // ----------------------------------------------------------------------------- |
1605 // CPhSrvUssdManager::CheckArray() |
1572 // CPhSrvUssdManager::CheckArray() |
1606 // ----------------------------------------------------------------------------- |
1573 // ----------------------------------------------------------------------------- |
1607 // |
1574 // |
1608 void CPhSrvUssdManager::CheckArray() |
1575 void CPhSrvUssdManager::CheckArray() |
1609 { |
1576 { |
1610 _DPRINT( 4, "PhSrv.CheckArray.Start" ); // debug print |
1577 _DPRINT( 4, "PhSrv.CheckArray.Start" ); // debug print |
1611 if (iNotifyArray && NotifyCount() > 0) |
1578 if (iNotifyArray && NotifyCount() > 0) |
1612 { |
1579 { |
1613 if ( !iNotifyMessage && !iClearArray ) |
1580 if ( !iNotifyMessage && !iClearArray ) |
1614 { |
1581 { |
1615 iLaunchGMQ = ETrue; |
1582 iLaunchGMQ = ETrue; |
1616 iNotifyMessage = ETrue; |
1583 iNotifyMessage = ETrue; |
1617 _DPRINT( 4, "PhSrv.CheckArray.iNotifyMessage.ETrue" ); |
1584 _DPRINT( 4, "PhSrv.CheckArray.iNotifyMessage.ETrue" ); |
1618 iTimer.After( iStatus , KPhSrvUssdMessageQueryInterval ); |
1585 iTimer.After( iStatus , KPhSrvUssdMessageQueryInterval ); |
1619 _DDPRINT( 4, "PhSrv.CheckArray.SetActive.NoNotifyMessage ", iStatus.Int() ); |
1586 _DDPRINT( 4, "PhSrv.CheckArray.SetActive.NoNotifyMessage ", iStatus.Int() ); |
1620 SetActive(); |
1587 SetActive(); |
1621 } |
1588 } |
1622 else if( NotifyCount() > 1 ) |
1589 else if( NotifyCount() > 1 ) |
1623 { |
1590 { |
1624 ( iNotifyArray )->Delete( 0 ); |
1591 ( iNotifyArray )->Delete( 0 ); |
1625 ( iNotifyArray )->Compress(); |
1592 ( iNotifyArray )->Compress(); |
1626 iLaunchGMQ = ETrue; |
1593 iLaunchGMQ = ETrue; |
1627 iNotifyMessage = ETrue; |
1594 iNotifyMessage = ETrue; |
1628 _DPRINT( 4, "PhSrv.CheckArray.iNotifyMessage.ETrue" ); |
1595 _DPRINT( 4, "PhSrv.CheckArray.iNotifyMessage.ETrue" ); |
1629 iTimer.After( iStatus , KPhSrvUssdMessageQueryInterval ); |
1596 iTimer.After( iStatus , KPhSrvUssdMessageQueryInterval ); |
1630 _DDPRINT( 4, "PhSrv.CheckArray.SetActive.NotifyCount>1 ", iStatus.Int() ); |
1597 _DDPRINT( 4, "PhSrv.CheckArray.SetActive.NotifyCount>1 ", iStatus.Int() ); |
1631 SetActive(); |
1598 SetActive(); |
1632 } |
1599 } |
1633 else |
1600 else |
1634 { |
1601 { |
1635 iNotifyArray->Reset(); |
1602 iNotifyArray->Reset(); |
1636 iNotifyMessage = EFalse; |
1603 iNotifyMessage = EFalse; |
1637 _DPRINT( 4, "PhSrv.CheckArray.iNotifyMessage.EFalse" ); |
1604 _DPRINT( 4, "PhSrv.CheckArray.iNotifyMessage.EFalse" ); |
1638 } |
1605 } |
1639 } |
1606 } |
1640 _DPRINT_FLAGS(); |
1607 _DPRINT_FLAGS(); |
1641 _DPRINT( 4, "PhSrv.CheckArray.End" ); // debug print |
1608 _DPRINT( 4, "PhSrv.CheckArray.End" ); // debug print |
1642 } |
1609 } |
1643 |
1610 |
1644 // ----------------------------------------------------------------------------- |
1611 // ----------------------------------------------------------------------------- |
1645 // CPhSrvUssdManager::ClearArray() |
1612 // CPhSrvUssdManager::ClearArray() |
1646 // ----------------------------------------------------------------------------- |
1613 // ----------------------------------------------------------------------------- |
1647 // |
1614 // |
1648 void CPhSrvUssdManager::ClearArrayL() |
1615 void CPhSrvUssdManager::ClearArrayL() |
1649 { |
1616 { |
1650 _DPRINT( 4, "PhSrv.ClearArrayL.Start" ); // debug print |
1617 _DPRINT( 4, "PhSrv.ClearArrayL.Start" ); // debug print |
1651 if (iNotifyArray && NotifyCount() > 0) |
1618 if (iNotifyArray && NotifyCount() > 0) |
1652 { |
1619 { |
1653 if (iNotifyMessage && NotifyCount()== 1 ) |
1620 if (iNotifyMessage && NotifyCount()== 1 ) |
1654 { |
1621 { |
1655 iNotifyArray->Reset(); |
1622 iNotifyArray->Reset(); |
1656 } |
1623 } |
1657 else |
1624 else |
1658 { |
1625 { |
1659 iReceivedMessage.Zero(); |
1626 iReceivedMessage.Zero(); |
1660 HBufC* unreadText = iResourceManager.ReadResourceLC( R_PHSRV_TEXT_UNREAD ); |
1627 iReceivedMessage.Append( |
1661 TPtr pMessage( unreadText->Des() ); |
1628 LoadDefaultString( KUssdConfirm ) ); |
1662 iReceivedMessage.Append( pMessage ); |
1629 iNotifyArray->InsertL( 0, iReceivedMessage ); |
1663 iNotifyArray->InsertL( 0, iReceivedMessage ); |
1630 iLaunchGMQ = ETrue; |
1664 CleanupStack::PopAndDestroy( unreadText ); |
1631 iNotifyMessage = ETrue; |
1665 iLaunchGMQ = ETrue; |
1632 _DPRINT( 4, "PhSrv.ClearArrayL.iNotifyMessage.ETrue" ); |
1666 iNotifyMessage = ETrue; |
1633 iClearArray = ETrue; |
1667 _DPRINT( 4, "PhSrv.ClearArrayL.iNotifyMessage.ETrue" ); |
1634 iTimer.After( iStatus , KPhSrvUssdMessageQueryInterval ); |
1668 iClearArray = ETrue; |
1635 _DDPRINT( 4, "PhSrv.ClearArrayL.iTimer ", iStatus.Int() ); |
1669 iTimer.After( iStatus , KPhSrvUssdMessageQueryInterval ); |
1636 SetActive(); |
1670 _DDPRINT( 4, "PhSrv.ClearArrayL.iTimer ", iStatus.Int() ); |
1637 } |
1671 SetActive(); |
1638 } |
1672 } |
|
1673 } |
|
1674 _DPRINT_FLAGS(); |
1639 _DPRINT_FLAGS(); |
1675 _DPRINT( 4, "PhSrv.ClearArrayL.End" ); // debug print |
1640 _DPRINT( 4, "PhSrv.ClearArrayL.End" ); // debug print |
1676 } |
1641 } |
1677 |
1642 |
1678 // ----------------------------------------------------------------------------- |
1643 // ----------------------------------------------------------------------------- |
1679 // CPhSrvUssdManager::NotifyCount() |
1644 // CPhSrvUssdManager::NotifyCount() |
1680 // ----------------------------------------------------------------------------- |
1645 // ----------------------------------------------------------------------------- |
1681 // |
1646 // |
1682 TInt CPhSrvUssdManager::NotifyCount() |
1647 TInt CPhSrvUssdManager:: NotifyCount() |
1683 { |
1648 { |
1684 if( iNotifyArray ) |
1649 TInt count = iNotifyArray->Count(); |
1685 { |
1650 _DDPRINT( 4, "PhSrv.NotifyCount:", count ); // debug print |
1686 return iNotifyArray->Count(); |
1651 return count; |
1687 } |
1652 } |
1688 else |
1653 |
1689 { |
1654 // ----------------------------------------------------------------------------- |
1690 return 0; |
1655 // CPhSrvUssdManager::UpdateNotifyMessageL() |
1691 } |
1656 // ----------------------------------------------------------------------------- |
1692 } |
1657 // |
1693 |
1658 void CPhSrvUssdManager:: UpdateNotifyMessageL() |
1694 // ----------------------------------------------------------------------------- |
1659 { |
1695 // CPhSrvUssdManager::UpdateNotifyMessage() |
1660 _DDPRINT( 4, "PhSrv.UpdateNotifyMessageL.Start, clear: ", iClearArray ); // debug print |
1696 // ----------------------------------------------------------------------------- |
1661 |
1697 // |
1662 // Show left softkey - "Next" |
1698 void CPhSrvUssdManager::UpdateNotifyMessage() |
1663 if (NotifyCount() > 1 && !iClearArray ) |
1699 { |
1664 { |
1700 _DDPRINT( 4, "PhSrv.UpdateNotifyMessage.Start, clear: ", iClearArray ); // debug print |
1665 _DPRINT( 4, "PhSrv.UpdateNotifyMessageL" ); // debug print |
1701 if (NotifyCount() > 1 && !iClearArray ) |
1666 iDeviceDialog->SetButton( |
1702 { |
1667 CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue ); |
1703 _DPRINT( 4, "PhSrv.UpdateNotifyMessage" ); // debug print |
1668 iDeviceDialog->SetButtonTextL( |
1704 iGlobalMsgQuery->UpdateMsgQuery( R_AVKON_SOFTKEYS_NEXT_EXIT__NEXT ); |
1669 CHbDeviceMessageBoxSymbian::EAcceptButton, |
1705 } |
1670 LoadDefaultString( KUssdNext ) ); |
1706 _DPRINT( 4, "PhSrv.UpdateNotifyMessage.End" ); // debug print |
1671 } |
1707 } |
1672 // Remove left softkey |
|
1673 else |
|
1674 { |
|
1675 iDeviceDialog->SetButton( |
|
1676 CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); |
|
1677 } |
|
1678 iDeviceDialog->UpdateL(); |
|
1679 |
|
1680 _DPRINT( 4, "PhSrv.UpdateNotifyMessageL.End" ); // debug print |
|
1681 } |
1708 |
1682 |
1709 // ----------------------------------------------------------------------------- |
1683 // ----------------------------------------------------------------------------- |
1710 // CPhSrvUssdManager::DoCancel |
1684 // CPhSrvUssdManager::DoCancel |
1711 // ----------------------------------------------------------------------------- |
1685 // ----------------------------------------------------------------------------- |
1712 // |
1686 // |
1713 void CPhSrvUssdManager::DoCancel() |
1687 void CPhSrvUssdManager::DoCancel() |
1714 { |
1688 { |
1715 _DPRINT( 4, "PhSrv.DoCancel.Start" ); // debug print |
1689 _DPRINT( 4, "PhSrv.DoCancel.Start" ); // debug print |
1716 iTimer.Cancel(); |
1690 iTimer.Cancel(); |
1717 iLaunchGMQ = EFalse; |
1691 iLaunchGMQ = EFalse; |
1718 |
1692 if ( iDeviceDialog ) |
1719 if ( iGlobalMsgQuery ) |
|
1720 { |
1693 { |
1721 _DPRINT( 4, "PhSrv.DoCancel" ); // debug print |
1694 _DPRINT( 4, "PhSrv.DoCancel" ); // debug print |
1722 iGlobalMsgQuery->CancelMsgQuery(); |
1695 iDeviceDialog->Close(); |
|
1696 delete iDeviceDialog; |
|
1697 iDeviceDialog = NULL; |
1723 } |
1698 } |
1724 _DPRINT( 4, "PhSrv.DoCancel.End" ); // debug print |
1699 _DPRINT( 4, "PhSrv.DoCancel.End" ); // debug print |
1725 } |
1700 } |
1726 |
1701 |
1727 // ----------------------------------------------------------------------------- |
1702 // ----------------------------------------------------------------------------- |
1767 User::LeaveIfError( apaLsSession.Connect() ); |
1742 User::LeaveIfError( apaLsSession.Connect() ); |
1768 _DPRINT( 4, "PhSrv.RequestStartEditingL.apaLsSession.connect" ); // debug print |
1743 _DPRINT( 4, "PhSrv.RequestStartEditingL.apaLsSession.connect" ); // debug print |
1769 CleanupClosePushL( apaLsSession ); |
1744 CleanupClosePushL( apaLsSession ); |
1770 |
1745 |
1771 TApaAppInfo appInfo; |
1746 TApaAppInfo appInfo; |
1772 TInt err = apaLsSession.GetAppInfo( |
1747 |
1773 appInfo, |
1748 TInt err = apaLsSession.GetAppInfo( appInfo, KUssdSecureId ); |
1774 TUid::Uid( KPhSrvUssdAppUID ) ); |
1749 _DDPRINT( 4, "PhSrv.RequestStartEditingL.GetAppInfo ", err ); // debug print |
|
1750 |
1775 if ( err == KErrNone ) |
1751 if ( err == KErrNone ) |
1776 { |
1752 { |
1777 _DDPRINT( 4, "PhSrv.RequestStartEditingL.GetAppInfo ", err ); // debug print |
|
1778 |
|
1779 #ifndef SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1 |
1753 #ifndef SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1 |
1780 CApaCommandLine* apaCommandLine = CApaCommandLine::NewLC(); |
1754 CApaCommandLine* apaCommandLine = CApaCommandLine::NewLC(); |
1781 apaCommandLine->SetExecutableNameL( appInfo.iFullName ); |
1755 apaCommandLine->SetExecutableNameL( appInfo.iFullName ); |
1782 #else // SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1 |
1756 #else // SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1 |
1783 CApaCommandLine* apaCommandLine = |
1757 CApaCommandLine* apaCommandLine = |
1784 CApaCommandLine::NewLC( appInfo.iFullName ); |
1758 CApaCommandLine::NewLC( appInfo.iFullName ); |
1785 #endif // SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1 |
1759 #endif // SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1 |
1786 |
1760 |
1787 err = apaLsSession.StartApp( *apaCommandLine ); |
1761 TThreadId id( static_cast<TInt64>( 0 ) ); |
|
1762 err = apaLsSession.StartApp( *apaCommandLine, id ); |
|
1763 _DDPRINT( 4, "PhSrv.RequestStartEditingL.ThreadId ", id ); |
1788 CleanupStack::PopAndDestroy( apaCommandLine ); |
1764 CleanupStack::PopAndDestroy( apaCommandLine ); |
1789 } |
1765 } |
1790 CleanupStack::PopAndDestroy(); // apaLsSession |
1766 CleanupStack::PopAndDestroy( &apaLsSession ); // apaLsSession |
|
1767 |
|
1768 // bring the ussd editor to foreground, only for testing |
|
1769 TApaTaskList tasklist( wsSession ); |
|
1770 TApaTask task = tasklist.FindApp( KUssdSecureId ); |
|
1771 if ( task.Exists() ) |
|
1772 { |
|
1773 _DPRINT( 4, "PhSrv.UssdM.RequestStartEditingL.task.BringToForeground" ); |
|
1774 task.BringToForeground(); |
|
1775 } |
|
1776 // bring the ussd editor to foreground, only for testing |
1791 } |
1777 } |
1792 CleanupStack::PopAndDestroy(); // wsSession |
1778 CleanupStack::PopAndDestroy(); // wsSession |
1793 |
1779 |
1794 _DPRINT( 4, "PhSrv.UssdM.RequestStartEditingL.end" ); // debug print |
1780 _DPRINT( 4, "PhSrv.UssdM.RequestStartEditingL.end" ); // debug print |
1795 } |
1781 } |
2138 msgAttribs.iDcs = KPhSrvUssdDefaultDCS; |
2128 msgAttribs.iDcs = KPhSrvUssdDefaultDCS; |
2139 |
2129 |
2140 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg attribs = msgAttribs; |
2130 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg attribs = msgAttribs; |
2141 SendHandlerL().SendUssdL( KNullDesC8() , attribs ); |
2131 SendHandlerL().SendUssdL( KNullDesC8() , attribs ); |
2142 |
2132 |
2143 _DPRINT( 4, "PhSrv.SendMoAckL.End" ); // debug print |
2133 _DPRINT( 4, "PhSrv.SendMoAckL.End" ); |
2144 } |
2134 } |
2145 |
2135 |
2146 // ----------------------------------------------------------------------------- |
2136 // ----------------------------------------------------------------------------- |
2147 // CPhSrvUssdManager::TurnLightsOn |
2137 // CPhSrvUssdManager::TurnLightsOn |
2148 // |
2138 // |
2149 // ----------------------------------------------------------------------------- |
2139 // ----------------------------------------------------------------------------- |
2150 // |
2140 // |
2151 void CPhSrvUssdManager::TurnLightsOn() |
2141 void CPhSrvUssdManager::TurnLightsOn() |
2152 { |
2142 { |
2153 _DPRINT( 4, "PhSrv.TurnLightsOn Start" ); // debug print |
2143 _DPRINT( 4, "PhSrv.TurnLightsOn.Start" ); |
2154 |
2144 |
2155 |
2145 |
2156 // Change the bit on and off. SysAp will detect that |
2146 // Change the bit on and off. SysAp will detect that |
2157 // the lights should be switched on for the specified time. |
2147 // the lights should be switched on for the specified time. |
2158 // |
2148 // |
2159 RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOn); |
2149 RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOn); |
2160 TInt err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOff); |
2150 TInt err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOff); |
2161 |
2151 |
2162 if ( err != KErrNone ) |
2152 if ( err != KErrNone ) |
2163 { |
2153 { |
2164 _DDPRINT( 4,"PhSrv.TurnLightsOn.Error: ",err );// debug print |
2154 _DDPRINT( 4,"PhSrv.TurnLightsOn.Error: ",err );// debug print |
2165 } |
2155 } |
2166 |
2156 |
2167 _DPRINT( 4, "PhSrv.TurnLightsOn.End" ); // debug print |
2157 _DPRINT( 4, "PhSrv.TurnLightsOn.End" ); |
2168 } |
2158 } |
|
2159 |
|
2160 // ----------------------------------------------------------------------------- |
|
2161 // CPhSrvUssdManager::LoadDefaultString |
|
2162 // ----------------------------------------------------------------------------- |
|
2163 // |
|
2164 const TPtrC CPhSrvUssdManager::LoadDefaultString( const TDesC& aText ) |
|
2165 { |
|
2166 _DPRINT( 4, "PhSrv.LoadDefaultString.Start" ); |
|
2167 |
|
2168 if ( iTextBuffer ) |
|
2169 { |
|
2170 delete iTextBuffer; |
|
2171 iTextBuffer = NULL; |
|
2172 _DPRINT( 4, "PhSrv.LoadDefaultString.Clear" ); |
|
2173 } |
|
2174 TInt err = KErrNone; |
|
2175 TPtrC ptr( aText ); |
|
2176 if ( ptr.Length() ) |
|
2177 { |
|
2178 TRAP( err, iTextBuffer = HbTextResolverSymbian::LoadL( ptr ) ); |
|
2179 _DDPRINT( 4, "PhSrv.LoadDefaultString.LoadL.%d", err ); |
|
2180 if ( iTextBuffer ) |
|
2181 { |
|
2182 ptr.Set( iTextBuffer->Des() ); |
|
2183 _DPRINT( 4, "PhSrv.LoadDefaultString.Set" ); |
|
2184 } |
|
2185 } |
|
2186 _DPRINT( 4, "PhSrv.LoadDefaultString.End" ); |
|
2187 return ptr; |
|
2188 } |
|
2189 |
2169 // End of File |
2190 // End of File |