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 "phsrvdebuginfo.h" |
44 #include "phsrvdebuginfo.h" |
51 #include <e32property.h> |
45 #include <e32property.h> |
52 #include <centralrepository.h> |
46 #include <centralrepository.h> |
53 #include <coreapplicationuisdomainpskeys.h> |
47 #include <coreapplicationuisdomainpskeys.h> |
83 const TUint KPhSrvUssdDcsGeneralInformationAlphabetUCS2 = 0x08; // xxxx10xx |
77 const TUint KPhSrvUssdDcsGeneralInformationAlphabetUCS2 = 0x08; // xxxx10xx |
84 |
78 |
85 const TUint KPhSrvUssdDcsMessageHandlingAlphabetMask = 0xf4; // 11110100 |
79 const TUint KPhSrvUssdDcsMessageHandlingAlphabetMask = 0xf4; // 11110100 |
86 const TUint KPhSrvUssdDcsMessageHandlingAlphabet8Bit = 0xf4; // 1111x1xx |
80 const TUint KPhSrvUssdDcsMessageHandlingAlphabet8Bit = 0xf4; // 1111x1xx |
87 const TInt KPhrUssdNotifyArraySize = 1; |
81 const TInt KPhrUssdNotifyArraySize = 1; |
|
82 |
|
83 // Refers to HbPopup::NoDismiss = 0 |
|
84 const TInt KPhSrvUssdPopupDismissPolicy = 0; |
|
85 // The time out only for testing, from CPhSrvUssdReplyTimer.cpp |
|
86 const TUint KPhSrvUssdTimeout = 300000000; |
|
87 |
|
88 // Use QT style localization |
|
89 _LIT(KUssdLocFilename, "phcltsrvussd.ts"); |
|
90 _LIT(KUssdLocPath, "z://data"); |
|
91 _LIT(KUssdReply, "txt_ussd_button_reply"); // Reply |
|
92 _LIT(KUssdExit, "txt_ussd_button_exit"); // Exit |
|
93 _LIT(KUssdNext, "txt_ussd_button_next"); //Next |
|
94 _LIT(KUssdYes, "txt_common_button_yes"); // Yes |
|
95 _LIT(KUssdNo, "txt_common_button_no"); // No |
|
96 _LIT(KUssdTitle, "txt_ussd_title_message"); // Message |
|
97 _LIT(KUssdDone, "txt_ussd_dpopinfo_done"); // Done |
|
98 _LIT(KUssdConfirm, "txt_ussd_info_there_are_still_unread_notifications"); |
88 |
99 |
89 // MACROS |
100 // MACROS |
90 |
101 |
91 #define _DPRINT_FLAGS() \ |
102 #define _DPRINT_FLAGS() \ |
92 _DDPRINT( 4, "PhSrv.FLAGS.MsgTypeReply ", iMsgTypeReply ); \ |
103 _DDPRINT( 4, "PhSrv.FLAGS.MsgTypeReply ", iMsgTypeReply ); \ |
371 CPhSrvResourceManager& aResourceManager |
382 CPhSrvResourceManager& aResourceManager |
372 ) |
383 ) |
373 :CActive( EPriorityLow ), |
384 :CActive( EPriorityLow ), |
374 iFsSession( aFsSession ), |
385 iFsSession( aFsSession ), |
375 iResourceManager( aResourceManager ), |
386 iResourceManager( aResourceManager ), |
|
387 iDeviceDialog( NULL ), |
376 iDCS ( KPhCltDcsUnknown ), |
388 iDCS ( KPhCltDcsUnknown ), |
377 iReturnResultPckg ( iReturnResult ) |
389 iReturnResultPckg ( iReturnResult ), |
378 |
390 iTextResolver ( EFalse ), |
|
391 iTextBuffer ( NULL ) |
379 { |
392 { |
380 CActiveScheduler::Add( this ); |
393 CActiveScheduler::Add( this ); |
381 } |
394 } |
382 |
395 |
383 |
396 |
477 |
493 |
478 iVariantReadOnlyValues = KPhSrvDefaultValue; |
494 iVariantReadOnlyValues = KPhSrvDefaultValue; |
479 |
495 |
480 User::LeaveIfError( GetTelephonyVariantData() ); |
496 User::LeaveIfError( GetTelephonyVariantData() ); |
481 |
497 |
482 iMeQuHeaderText = iResourceManager.ReadResourceLC( |
|
483 R_PHSRV_USSD_MESQUERY_MESSAGE); |
|
484 CleanupStack::Pop( iMeQuHeaderText ); |
|
485 |
|
486 _DDPRINT( 4, "PhSrv.ConstructL.iSatCanceled ", iSatCanceled ); |
498 _DDPRINT( 4, "PhSrv.ConstructL.iSatCanceled ", iSatCanceled ); |
487 _DDPRINT( 4, "PhSrv.ConstructL.iShowDone ", iShowDone ); |
499 _DDPRINT( 4, "PhSrv.ConstructL.iShowDone ", iShowDone ); |
488 iNotifyArray = new( ELeave ) CDesCArrayFlat( KPhrUssdNotifyArraySize ); |
500 iNotifyArray = new( ELeave ) CDesCArrayFlat( KPhrUssdNotifyArraySize ); |
489 _DPRINT( 4, "PhSrv.ConstructL.End" ); // debug print |
501 _DPRINT( 4, "PhSrv.ConstructL.End" ); |
490 } |
502 } |
491 |
503 |
492 |
504 |
493 // ----------------------------------------------------------------------------- |
505 // ----------------------------------------------------------------------------- |
494 // CPhSrvUssdManager::SendHandlerL |
506 // CPhSrvUssdManager::SendHandlerL |
499 // |
511 // |
500 CPhSrvUssdSendHandler& CPhSrvUssdManager::SendHandlerL() |
512 CPhSrvUssdSendHandler& CPhSrvUssdManager::SendHandlerL() |
501 { |
513 { |
502 // If SendHandler is not created, first check that MO Ussd |
514 // If SendHandler is not created, first check that MO Ussd |
503 // is supported by the TSY. |
515 // is supported by the TSY. |
504 _DPRINT( 4, "PhSrv.SendHandlerL.Start" ); // debug print |
516 _DPRINT( 4, "PhSrv.SendHandlerL.Start" ); |
505 if ( iUssdSendHandler == NULL ) |
517 if ( iUssdSendHandler == NULL ) |
506 { |
518 { |
507 _DPRINT( 4, "PhSrv.SendHandlerL.iUssdSendHandler.NULL" ); // debug print |
519 _DPRINT( 4, "PhSrv.SendHandlerL.iUssdSendHandler.NULL" ); |
508 RMobileUssdMessaging::TMobileUssdCapsV1 caps; |
520 RMobileUssdMessaging::TMobileUssdCapsV1 caps; |
509 RMobileUssdMessaging::TMobileUssdCapsV1Pckg pckgCaps( caps ); |
521 RMobileUssdMessaging::TMobileUssdCapsV1Pckg pckgCaps( caps ); |
510 User::LeaveIfError( iMobileUssdMessaging.GetCaps( pckgCaps ) ); |
522 User::LeaveIfError( iMobileUssdMessaging.GetCaps( pckgCaps ) ); |
511 _DPRINT( 4, "PhSrv.SendHandlerL.iMobileUssdMessaging.GetCaps" ); // debug print |
523 _DPRINT( 4, "PhSrv.SendHandlerL.iMobileUssdMessaging.GetCaps" ); |
512 |
524 |
513 if ( ( caps.iUssdTypes & RMobileUssdMessaging::KCapsMOUssd ) == 0 || |
525 if ( ( caps.iUssdTypes & RMobileUssdMessaging::KCapsMOUssd ) == 0 || |
514 ( caps.iUssdFormat & RMobileUssdMessaging::KCapsPackedString ) |
526 ( caps.iUssdFormat & RMobileUssdMessaging::KCapsPackedString ) |
515 == 0 ) |
527 == 0 ) |
516 { |
528 { |
517 _DPRINT( 4, "PhSrv.SendHandlerL.KErrNotSupported" ); // debug print |
529 _DPRINT( 4, "PhSrv.SendHandlerL.KErrNotSupported" ); |
518 User::Leave( KErrNotSupported ); |
530 User::Leave( KErrNotSupported ); |
519 } |
531 } |
520 |
532 |
521 iUssdSendHandler = |
533 iUssdSendHandler = |
522 new( ELeave ) CPhSrvUssdSendHandler( |
534 new( ELeave ) CPhSrvUssdSendHandler( |
523 *this, |
535 *this, |
524 iMobileUssdMessaging, |
536 iMobileUssdMessaging, |
525 *iPhoneInterface ); |
537 *iPhoneInterface ); |
526 } |
538 } |
527 _DPRINT( 4, "PhSrv.SendHandlerL.End" ); // debug print |
539 _DPRINT( 4, "PhSrv.SendHandlerL.End" ); |
528 return *iUssdSendHandler; |
540 return *iUssdSendHandler; |
529 } |
541 } |
530 |
542 |
531 |
543 |
532 // ----------------------------------------------------------------------------- |
544 // ----------------------------------------------------------------------------- |
539 void CPhSrvUssdManager::SendUssdL( |
551 void CPhSrvUssdManager::SendUssdL( |
540 const TDesC8& aMsgData, |
552 const TDesC8& aMsgData, |
541 RMobileUssdMessaging::TMobileUssdAttributesV1& aMsgAttribute, |
553 RMobileUssdMessaging::TMobileUssdAttributesV1& aMsgAttribute, |
542 MPhSrvUssdMessageSentObserver& aObserver ) |
554 MPhSrvUssdMessageSentObserver& aObserver ) |
543 { |
555 { |
544 _DPRINT( 4, "PhSrv.SendUssdL.Start ######" ); // debug print |
556 _DPRINT( 4, "PhSrv.SendUssdL.Start ######" ); |
545 _DPRINT_FLAGS(); |
557 _DPRINT_FLAGS(); |
546 |
558 |
547 if ( iObserver && iNetworkReleased ) |
559 if ( iObserver && iNetworkReleased ) |
548 { |
560 { |
549 // Network has been released but the previous send request is still alive. |
561 // Network has been released but the previous send request is still alive. |
550 // Cancel the pervious send operation, complete the old request with error |
562 // Cancel the pervious send operation, complete the old request with error |
551 // and clean up the pointer. |
563 // and clean up the pointer. |
552 _DPRINT( 4, "PhSrv.SendUssdL.Error.Complete.Existing" ); // debug print |
564 _DPRINT( 4, "PhSrv.SendUssdL.Error.Complete.Existing" ); |
553 if ( iUssdSendHandler ) |
565 if ( iUssdSendHandler ) |
554 { |
566 { |
555 iUssdSendHandler->Cancel(); |
567 iUssdSendHandler->Cancel(); |
556 } |
568 } |
557 iObserver->UssdMessageSentObserverHandleResult( KErrSessionClosed ); |
569 iObserver->UssdMessageSentObserverHandleResult( KErrSessionClosed ); |
558 iObserver = NULL; |
570 iObserver = NULL; |
559 } |
571 } |
560 |
572 |
561 if ( iObserver || iSendingAck ) |
573 if ( iObserver || iSendingAck ) |
562 { |
574 { |
563 _DPRINT( 4, "PhSrv.SendUssdL.KErrInUse" ); // debug print |
575 _DPRINT( 4, "PhSrv.SendUssdL.KErrInUse" ); |
564 // Other client is using the service. |
576 // Other client is using the service. |
565 User::Leave( KErrInUse ); |
577 User::Leave( KErrInUse ); |
566 } |
578 } |
567 |
579 |
568 // Check that message type is set |
580 // Check that message type is set |
569 if( ( aMsgAttribute.iFlags & RMobileUssdMessaging::KUssdMessageType ) |
581 if( ( aMsgAttribute.iFlags & RMobileUssdMessaging::KUssdMessageType ) |
570 == 0 ) |
582 == 0 ) |
571 _DPRINT( 4, "PhSrv.SendUssdL.KUssdMessageType.0" ); // debug print |
583 _DPRINT( 4, "PhSrv.SendUssdL.KUssdMessageType.0" ); |
572 { |
584 { |
573 // Mesasge type not set -> Set it. |
585 // Mesasge type not set -> Set it. |
574 aMsgAttribute.iFlags |= RMobileUssdMessaging::KUssdMessageType; |
586 aMsgAttribute.iFlags |= RMobileUssdMessaging::KUssdMessageType; |
575 if ( NetworkWaitingForAnAnswer() ) |
587 if ( NetworkWaitingForAnAnswer() ) |
576 { |
588 { |
586 } |
598 } |
587 |
599 |
588 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg attribs( aMsgAttribute ); |
600 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg attribs( aMsgAttribute ); |
589 iShowDone = ETrue; |
601 iShowDone = ETrue; |
590 _DPRINT( 4, "PhSrv.SendUssdL.iShowDone.ETrue" ); |
602 _DPRINT( 4, "PhSrv.SendUssdL.iShowDone.ETrue" ); |
591 _DPRINT( 4, "PhSrv.SendUssdL.Send" ); // debug print |
603 _DPRINT( 4, "PhSrv.SendUssdL.Send" ); |
592 SendHandlerL().SendUssdL( aMsgData , attribs ); |
604 SendHandlerL().SendUssdL( aMsgData , attribs ); |
593 iObserver = &aObserver; |
605 iObserver = &aObserver; |
594 // Not closing nor closed anymore |
606 // Not closing nor closed anymore |
595 iNetworkReleased = EFalse; |
607 iNetworkReleased = EFalse; |
596 iSendRelease = EFalse; |
608 iSendRelease = EFalse; |
847 { |
856 { |
848 // need to send an MO ack |
857 // need to send an MO ack |
849 iAcksToBeSent ++; |
858 iAcksToBeSent ++; |
850 } |
859 } |
851 |
860 |
|
861 if ( !iDeviceDialog ){ |
|
862 iDeviceDialog = CHbDeviceMessageBoxSymbian::NewL( |
|
863 CHbDeviceMessageBoxSymbian::EInformation ); |
|
864 iDeviceDialog->SetObserver( this ); |
|
865 iDeviceDialog->SetTimeout( KPhSrvUssdTimeout ); |
|
866 iDeviceDialog->SetDismissPolicy ( KPhSrvUssdPopupDismissPolicy ); |
|
867 |
|
868 // Show left key with empty string accoring to ui concept |
|
869 iDeviceDialog->SetButton( |
|
870 CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); |
|
871 // Show Exit Key always |
|
872 iDeviceDialog->SetButton( |
|
873 CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); |
|
874 iDeviceDialog->SetButtonTextL( |
|
875 CHbDeviceMessageBoxSymbian::ERejectButton, |
|
876 LoadDefaultString( KUssdExit ) ); |
|
877 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.Exit" ); |
|
878 } |
|
879 |
852 if ( iNotifyMessage || iMsgTypeReply ) |
880 if ( iNotifyMessage || iMsgTypeReply ) |
853 { |
881 { |
854 //This is for reply message in notifyarray |
882 //This is for reply message in notifyarray |
855 iNotifyMessage = ETrue; |
883 iNotifyMessage = ETrue; |
856 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
884 _DDPRINT( 4, "PhSrv.UssdHandleReceivedEventL.iNotifyMessage: ", iNotifyMessage ); |
857 |
885 |
858 //Notify added to array |
886 //Notify added to array |
859 iNotifyArray->AppendL( iReceivedMessage ); |
887 iNotifyArray->AppendL( iReceivedMessage ); |
860 |
888 |
861 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.AppendL" ); // debug print |
889 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.AppendL" ); |
862 UpdateNotifyMessage(); |
890 UpdateNotifyMessageL(); |
863 |
891 |
864 if ( !iSendRelease && NotifyCount() <= 1 ) |
892 if ( !iSendRelease && NotifyCount() <= 1 ) |
865 { |
893 { |
866 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.!SendRelease.Cancel" ); // debug print |
894 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.!SendRelease.Cancel" ); |
867 Cancel(); |
895 Cancel(); |
868 } |
896 } |
869 } |
897 } |
870 else |
898 else |
871 { |
899 { |
872 // New message deletes old message, i.e. Cancel existing query. |
900 // New message deletes old message, i.e. Cancel existing query. |
873 Cancel(); |
901 Cancel(); |
874 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NewAnswerable" ); // debug print |
902 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NewAnswerable" ); |
875 } |
903 } |
876 |
904 |
877 if ( !iGlobalMsgQuery ) |
905 // Remove Reply key |
878 { |
|
879 iGlobalMsgQuery = CAknGlobalMsgQuery::NewL(); |
|
880 } |
|
881 |
|
882 // Delay after message query so that application execution order will |
|
883 // be correct. |
|
884 iGlobalMsgQuery->SetExitDelay( KPhSrvUssdNoteExitPeriod ); |
|
885 |
|
886 TInt softkeys = R_AVKON_SOFTKEYS_USSD_ANSWER_EXIT__ANSWER; |
|
887 if( !( aMsgAttributes.iFlags & RMobileUssdMessaging::KUssdMessageType ) |
906 if( !( aMsgAttributes.iFlags & RMobileUssdMessaging::KUssdMessageType ) |
888 || aMsgAttributes.iType != RMobileUssdMessaging::EUssdMTRequest ) |
907 || aMsgAttributes.iType != RMobileUssdMessaging::EUssdMTRequest ) |
889 { |
908 { |
890 softkeys = R_AVKON_SOFTKEYS_EXIT; |
909 // Remove Answer key |
891 } |
910 iDeviceDialog->SetButton( |
892 |
911 CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); |
893 // Set timer that lauches Global MessageQuery after time interval. |
912 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.NoAnswer" ); |
894 iSoftkeys = softkeys; |
913 } |
895 |
914 // Show Reply key |
896 // debug print |
915 else |
|
916 { |
|
917 iDeviceDialog->SetButton( |
|
918 CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue ); |
|
919 iDeviceDialog->SetButtonTextL( |
|
920 CHbDeviceMessageBoxSymbian::EAcceptButton, |
|
921 LoadDefaultString( KUssdReply ) ); |
|
922 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.WithAnswer" ); |
|
923 } |
|
924 |
|
925 |
897 _DPRINT( 4, |
926 _DPRINT( 4, |
898 "PhSrv.UssdHandleReceivedEventL.String.Middle" ); |
927 "PhSrv.UssdHandleReceivedEventL.String.Middle" ); |
899 |
928 |
900 // Play the USSD tone if needed. Logically should be in RunL, but here |
929 // Play the USSD tone if needed. Logically should be in RunL, but here |
901 // to give better balancing with voice and visible message. |
930 // to give better balancing with voice and visible message. |
902 |
931 // <-- QT PHONE START--> |
|
932 /* |
|
933 if ( IsTelephonyFeatureSupported( KTelephonyLVFlagUssdTone ) ) |
|
934 { |
|
935 _DPRINT( 4, "PhSrv.UssdHandleReceivedEventL.PlayTone" ); |
|
936 PlayUssdTone(); |
|
937 } |
|
938 */ |
|
939 // <-- QT PHONE END--> |
903 // Launch the new message query |
940 // Launch the new message query |
904 if ( !IsActive() ) |
941 if ( !IsActive() ) |
905 { |
942 { |
906 iLaunchGMQ = ETrue; |
943 iLaunchGMQ = ETrue; |
907 iTimer.After( iStatus , KPhSrvUssdMessageQueryInterval ); |
944 iTimer.After( iStatus , KPhSrvUssdMessageQueryInterval ); |
1002 // |
1039 // |
1003 void CPhSrvUssdManager::ShowDoneNoteL() |
1040 void CPhSrvUssdManager::ShowDoneNoteL() |
1004 { |
1041 { |
1005 _DDPRINT( 4, "PhSrv.ShowDoneNoteL.iShowDone", iShowDone ); |
1042 _DDPRINT( 4, "PhSrv.ShowDoneNoteL.iShowDone", iShowDone ); |
1006 // Show global confirmation note "Done" |
1043 // Show global confirmation note "Done" |
1007 HBufC* noteText = iResourceManager.ReadResourceLC( R_PHSRV_TEXT_DONE ); |
1044 CHbDeviceMessageBoxSymbian::InformationL( |
1008 CAknGlobalNote* note = CAknGlobalNote::NewLC(); |
1045 LoadDefaultString( KUssdDone ) ); |
1009 note->ShowNoteL( EAknGlobalConfirmationNote, *noteText ); |
|
1010 CleanupStack::PopAndDestroy( note ); |
|
1011 CleanupStack::PopAndDestroy( noteText ); |
|
1012 iShowDone = EFalse; |
1046 iShowDone = EFalse; |
1013 } |
1047 } |
1014 |
1048 |
1015 // ----------------------------------------------------------------------------- |
1049 // ----------------------------------------------------------------------------- |
1016 // CPhSrvUssdManager::ShowErrorNoteL |
1050 // CPhSrvUssdManager::ShowErrorNoteL |
1240 _DPRINT( 4, "PhSrv.ReplyTimer.End" ); // debug print |
1276 _DPRINT( 4, "PhSrv.ReplyTimer.End" ); // debug print |
1241 } |
1277 } |
1242 |
1278 |
1243 |
1279 |
1244 // ----------------------------------------------------------------------------- |
1280 // ----------------------------------------------------------------------------- |
|
1281 // CPhSrvUssdManager::MessageBoxClosed |
|
1282 // ----------------------------------------------------------------------------- |
|
1283 // |
|
1284 void CPhSrvUssdManager::MessageBoxClosed( |
|
1285 const CHbDeviceMessageBoxSymbian* aMessageBox, |
|
1286 CHbDeviceMessageBoxSymbian::TButtonId aButton) |
|
1287 { |
|
1288 _DPRINT( 4, "PhSrv.MsgClose.Start" ); |
|
1289 // ussd device dialog observer callback function |
|
1290 TPtrC leftBtn = aMessageBox->ButtonText( |
|
1291 CHbDeviceMessageBoxSymbian::EAcceptButton ); |
|
1292 TPtrC rightBtn = aMessageBox->ButtonText( |
|
1293 CHbDeviceMessageBoxSymbian::ERejectButton ); |
|
1294 |
|
1295 TInt err = KErrNone; |
|
1296 // Click Yes on Confirmation note (Yes, No) |
|
1297 if ( !leftBtn.Compare( |
|
1298 LoadDefaultString( KUssdYes ) ) && |
|
1299 ( CHbDeviceMessageBoxSymbian::EAcceptButton == aButton ) ) |
|
1300 { |
|
1301 _DPRINT( 4, "PhSrv.MsgClose.SK.Yes" ); |
|
1302 iClearArray = EFalse; |
|
1303 iNotifyArray->Reset(); |
|
1304 TryCloseSession(); |
|
1305 } |
|
1306 // Click "No" on Confirmation note (Yes, No) |
|
1307 else if ( !rightBtn.Compare( |
|
1308 LoadDefaultString( KUssdNo ) ) && |
|
1309 ( CHbDeviceMessageBoxSymbian::ERejectButton == aButton ) ) |
|
1310 { |
|
1311 _DPRINT( 4, "PhSrv.MsgClose.SK.No" ); |
|
1312 iClearArray = EFalse; |
|
1313 iNotifyMessage = ETrue; // for removing the yes/no query |
|
1314 CheckArray(); |
|
1315 TryCloseSession(); |
|
1316 } |
|
1317 // Click "Next" on Notification note (Next, Exit) |
|
1318 else if ( !leftBtn.Compare( |
|
1319 LoadDefaultString( KUssdNext ) ) && |
|
1320 ( CHbDeviceMessageBoxSymbian::EAcceptButton == aButton ) ) |
|
1321 { |
|
1322 _DPRINT( 4, "PhSrv.MsgClose.SK.Next" ); |
|
1323 CheckArray(); |
|
1324 TryCloseSession(); |
|
1325 } |
|
1326 // Click "Exit" on Notification note (Next, Exit or only Exit) |
|
1327 else if ( !rightBtn.Compare( |
|
1328 LoadDefaultString( KUssdExit ) ) && |
|
1329 ( CHbDeviceMessageBoxSymbian::ERejectButton == aButton ) ) |
|
1330 { |
|
1331 TRAP( err, ClearArrayL() ); |
|
1332 _DDPRINT( 4, "PhSrv.MsgClose.SK.Clear.%d", err ); |
|
1333 TryCloseSession(); |
|
1334 _DPRINT( 4, "PhSrv.MsgClose.SK.Exit" ); |
|
1335 } |
|
1336 // Click "Reply" on Message note (Reply, Exit) |
|
1337 else if ( !leftBtn.Compare( |
|
1338 LoadDefaultString( KUssdReply ) ) && |
|
1339 ( CHbDeviceMessageBoxSymbian::EAcceptButton == aButton ) ) |
|
1340 { |
|
1341 // Answer |
|
1342 iStartEditor = ETrue; |
|
1343 iShowDone = EFalse; |
|
1344 // Start the USSD editor now. |
|
1345 TRAP( err, RequestStartEditingL() ); |
|
1346 _DDPRINT( 4, "PhSrv.MsgClose.RequestStartEditingL.%d", err ); |
|
1347 } |
|
1348 else |
|
1349 { |
|
1350 _DPRINT( 4, "PhSrv.MsgClose.SK.Default" ); |
|
1351 } |
|
1352 |
|
1353 _DPRINT( 4, "PhSrv.MsgClose.End" ); |
|
1354 } |
|
1355 |
|
1356 // ----------------------------------------------------------------------------- |
1245 // CPhSrvUssdManager::RunL |
1357 // CPhSrvUssdManager::RunL |
1246 // ----------------------------------------------------------------------------- |
1358 // ----------------------------------------------------------------------------- |
1247 // |
1359 // |
1248 void CPhSrvUssdManager::RunL() |
1360 void CPhSrvUssdManager::RunL() |
1249 { |
1361 { |
1250 _DPRINT( 4, "PhSrv.RunL.Start" ); // debug print |
1362 _DPRINT( 4, "PhSrv.RunL.Start" ); |
1251 |
1363 |
1252 ProcessMoAcksL(); |
1364 ProcessMoAcksL(); |
1253 |
1365 |
1254 if ( iLaunchGMQ ) |
1366 if ( iLaunchGMQ ) |
1255 { |
1367 { |
1259 _DPRINT( 4, "PhSrv.iLaunchGMQ.EFalse" ); |
1371 _DPRINT( 4, "PhSrv.iLaunchGMQ.EFalse" ); |
1260 } |
1372 } |
1261 else |
1373 else |
1262 { |
1374 { |
1263 iStartEditor = EFalse; |
1375 iStartEditor = EFalse; |
1264 |
1376 // update device dialog |
1265 TInt key = iStatus.Int(); |
|
1266 if ( key == EEikBidOk ) // OK key |
|
1267 { |
|
1268 if ( NetworkWaitingForAnAnswer() ) |
|
1269 { |
|
1270 key = EAknSoftkeyShow; |
|
1271 } |
|
1272 else |
|
1273 { |
|
1274 key = EAknSoftkeyExit; |
|
1275 } |
|
1276 } |
|
1277 |
|
1278 switch( key ) |
|
1279 { |
|
1280 case EAknSoftkeyShow: |
|
1281 { |
|
1282 // Answer |
|
1283 iStartEditor = ETrue; |
|
1284 iShowDone = EFalse; |
|
1285 // Start the USSD editor now. |
|
1286 _DPRINT( 4, "PhSrv.RunL.RequestStartEditingL" ); // debug print |
|
1287 RequestStartEditingL(); |
|
1288 break; |
|
1289 } |
|
1290 case EAknSoftkeyYes: |
|
1291 { |
|
1292 _DPRINT( 4, "PhSrv.RunL.SK.Yes" ); |
|
1293 iClearArray = EFalse; |
|
1294 iNotifyArray->Reset(); |
|
1295 TryCloseSession(); |
|
1296 break; |
|
1297 } |
|
1298 case EAknSoftkeyCancel: |
|
1299 _DPRINT( 4, "PhSrv.RunL.SK.Cancel" ); |
|
1300 if ( iHavePendingSatMessagePointer ) |
|
1301 { |
|
1302 iSatCanceled = ETrue; |
|
1303 CompleteSatL( &iReceivedMessage, KErrCancel ); |
|
1304 _DPRINT( 4, "PhSrv.RunL.CompleteSatL" ); |
|
1305 } |
|
1306 // fall through. |
|
1307 case EAknSoftkeyExit: |
|
1308 _DPRINT( 4, "PhSrv.RunL.SK.Exit" ); |
|
1309 ClearArrayL(); |
|
1310 TryCloseSession(); |
|
1311 break; |
|
1312 case EAknSoftkeyBack: |
|
1313 _DPRINT( 4, "PhSrv.RunL.SK.Back" ); |
|
1314 ClearArrayL(); |
|
1315 TryCloseSession(); |
|
1316 break; |
|
1317 case EAknSoftkeyNo: |
|
1318 _DPRINT( 4, "PhSrv.RunL.SK.No" ); |
|
1319 iClearArray = EFalse; |
|
1320 iNotifyMessage = ETrue; // for removing the yes/no query |
|
1321 // fall through. |
|
1322 case EAknSoftkeyNext: |
|
1323 _DPRINT( 4, "PhSrv.RunL.SK.Next" ); |
|
1324 CheckArray(); |
|
1325 TryCloseSession(); |
|
1326 break; |
|
1327 default: |
|
1328 _DPRINT( 4, "PhSrv.RunL.SK.Default" ); |
|
1329 break; |
|
1330 } |
|
1331 _DPRINT( 4, "PhSrv.RunL.End" ); // debug print |
1377 _DPRINT( 4, "PhSrv.RunL.End" ); // debug print |
1332 } |
1378 } |
1333 } |
1379 } |
1334 |
1380 |
1335 // ----------------------------------------------------------------------------- |
1381 // ----------------------------------------------------------------------------- |
1338 // |
1384 // |
1339 void CPhSrvUssdManager::LaunchGlobalMessageQueryL() |
1385 void CPhSrvUssdManager::LaunchGlobalMessageQueryL() |
1340 { |
1386 { |
1341 _DPRINT( 4, "PhSrv.LGMQ.start" ); |
1387 _DPRINT( 4, "PhSrv.LGMQ.start" ); |
1342 _DPRINT_FLAGS(); |
1388 _DPRINT_FLAGS(); |
|
1389 |
1343 if ( iNotifyMessage ) |
1390 if ( iNotifyMessage ) |
1344 { |
1391 { |
1345 _DDPRINT( 4, "PhSrv.LGMQ.NotifyMessage", iNotifyMessage ); |
1392 _DDPRINT( 4, "PhSrv.LGMQ.NotifyMessage", iNotifyMessage ); |
1346 iNotifyMessage = ETrue; |
1393 iNotifyMessage = ETrue; |
1347 TInt count = NotifyCount(); |
1394 TInt count = NotifyCount(); |
|
1395 //check softkey in avkon.rss |
1348 if ( count > 1 ) |
1396 if ( count > 1 ) |
1349 { |
1397 { |
1350 iSoftkeys = R_AVKON_SOFTKEYS_NEXT_EXIT__NEXT; |
1398 // Next, Exit |
|
1399 iDeviceDialog->SetButton( |
|
1400 CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue ); |
|
1401 iDeviceDialog->SetButtonTextL( |
|
1402 CHbDeviceMessageBoxSymbian::EAcceptButton, |
|
1403 LoadDefaultString( KUssdNext ) ); |
|
1404 iDeviceDialog->SetButton( |
|
1405 CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); |
|
1406 iDeviceDialog->SetButtonTextL( |
|
1407 CHbDeviceMessageBoxSymbian::ERejectButton, |
|
1408 LoadDefaultString( KUssdExit ) ); |
|
1409 _DPRINT( 4, "PhSrv.LGMQ.Next&Exit" ); |
1351 } |
1410 } |
1352 else |
1411 else |
1353 { |
1412 { |
1354 iSoftkeys = R_AVKON_SOFTKEYS_EXIT; |
1413 // Only Exit |
|
1414 iDeviceDialog->SetButton( |
|
1415 CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); |
|
1416 iDeviceDialog->SetButton( |
|
1417 CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); |
|
1418 iDeviceDialog->SetButtonTextL( |
|
1419 CHbDeviceMessageBoxSymbian::ERejectButton, |
|
1420 LoadDefaultString( KUssdExit ) ); |
|
1421 _DPRINT( 4, "PhSrv.LGMQ.onlyExit" ); |
1355 } |
1422 } |
1356 if ( iClearArray ) |
1423 if ( iClearArray ) |
1357 { |
1424 { |
1358 iSoftkeys = R_AVKON_SOFTKEYS_YES_NO; |
1425 // Yes, No |
|
1426 iDeviceDialog->SetButton( |
|
1427 CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue ); |
|
1428 iDeviceDialog->SetButtonTextL( |
|
1429 CHbDeviceMessageBoxSymbian::EAcceptButton, |
|
1430 LoadDefaultString( KUssdYes ) ); |
|
1431 iDeviceDialog->SetButton( |
|
1432 CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); |
|
1433 iDeviceDialog->SetButtonTextL( |
|
1434 CHbDeviceMessageBoxSymbian::ERejectButton, |
|
1435 LoadDefaultString( KUssdNo ) ); |
|
1436 _DPRINT( 4, "PhSrv.LGMQ.Yes&No" ); |
1359 } |
1437 } |
1360 iReceivedMessage.Zero(); |
1438 iReceivedMessage.Zero(); |
1361 iReceivedMessage = (*iNotifyArray)[0]; |
1439 iReceivedMessage = (*iNotifyArray)[0]; |
1362 } |
1440 } |
1363 TurnLightsOn(); //Ensure lights on |
1441 TurnLightsOn(); //Ensure lights on |
1364 |
1442 |
1365 _DPRINT( 4, "PhSrv.LGMQ.ShMsgQuery" ); // debug print |
1443 _DPRINT( 4, "PhSrv.LGMQ.ShMsgQuery" ); // debug print |
1366 // Launch Global MessageQuery as requested. |
1444 // Launch Global MessageQuery as requested. |
1367 iGlobalMsgQuery->ShowMsgQueryL(iStatus, iReceivedMessage, iSoftkeys, |
1445 // Dialog not support header text, this code is only |
1368 *iMeQuHeaderText, KNullDesC); |
1446 // for testing, not final solution. |
1369 _DPRINT( 4, "PhSrv.LGMQ.SetActive" ); |
1447 TInt receiveLength = iReceivedMessage.Length(); |
1370 SetActive(); |
1448 _DDPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.MsgLength", receiveLength ); |
|
1449 |
|
1450 TInt titleLength = LoadDefaultString( KUssdTitle ).Length(); |
|
1451 _DDPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.TilteLength", titleLength ); |
|
1452 |
|
1453 TInt length = receiveLength + titleLength; |
|
1454 _DDPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.TotalLength", length ); |
|
1455 |
|
1456 HBufC* titleAndText = HBufC::NewLC( length ); |
|
1457 titleAndText->Des().Append( LoadDefaultString( KUssdTitle ) ); |
|
1458 titleAndText->Des().Append( iReceivedMessage ); |
|
1459 iDeviceDialog->SetTextL( titleAndText->Des() ); |
|
1460 CleanupStack::Pop( titleAndText ); |
|
1461 |
|
1462 iDeviceDialog->Close(); |
|
1463 iDeviceDialog->ShowL(); |
1371 iShowDone = EFalse; |
1464 iShowDone = EFalse; |
|
1465 |
1372 // Do nothing else in RunL this time. |
1466 // Do nothing else in RunL this time. |
1373 _DPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.ret" ); // debug print |
1467 _DPRINT( 4, "PhSrv.LGMQ.ShMsgQuery.ret" ); // debug print |
1374 } |
1468 } |
1375 |
1469 |
1376 // ----------------------------------------------------------------------------- |
1470 // ----------------------------------------------------------------------------- |
1521 iNotifyArray->Reset(); |
1615 iNotifyArray->Reset(); |
1522 } |
1616 } |
1523 else |
1617 else |
1524 { |
1618 { |
1525 iReceivedMessage.Zero(); |
1619 iReceivedMessage.Zero(); |
1526 HBufC* unreadText = iResourceManager.ReadResourceLC( R_PHSRV_TEXT_UNREAD ); |
1620 iReceivedMessage.Append( |
1527 TPtr pMessage( unreadText->Des() ); |
1621 LoadDefaultString( KUssdConfirm ) ); |
1528 iReceivedMessage.Append( pMessage ); |
|
1529 iNotifyArray->InsertL( 0, iReceivedMessage ); |
1622 iNotifyArray->InsertL( 0, iReceivedMessage ); |
1530 CleanupStack::PopAndDestroy( unreadText ); |
|
1531 iLaunchGMQ = ETrue; |
1623 iLaunchGMQ = ETrue; |
1532 iNotifyMessage = ETrue; |
1624 iNotifyMessage = ETrue; |
1533 _DPRINT( 4, "PhSrv.ClearArrayL.iNotifyMessage.ETrue" ); |
1625 _DPRINT( 4, "PhSrv.ClearArrayL.iNotifyMessage.ETrue" ); |
1534 iClearArray = ETrue; |
1626 iClearArray = ETrue; |
1535 iTimer.After( iStatus , KPhSrvUssdMessageQueryInterval ); |
1627 iTimer.After( iStatus , KPhSrvUssdMessageQueryInterval ); |
1543 |
1635 |
1544 // ----------------------------------------------------------------------------- |
1636 // ----------------------------------------------------------------------------- |
1545 // CPhSrvUssdManager::NotifyCount() |
1637 // CPhSrvUssdManager::NotifyCount() |
1546 // ----------------------------------------------------------------------------- |
1638 // ----------------------------------------------------------------------------- |
1547 // |
1639 // |
1548 TInt CPhSrvUssdManager:: NotifyCount() |
1640 TInt CPhSrvUssdManager:: NotifyCount() |
1549 { |
1641 { |
1550 return iNotifyArray->Count(); |
1642 TInt count = iNotifyArray->Count(); |
1551 } |
1643 _DDPRINT( 4, "PhSrv.NotifyCount:", count ); // debug print |
1552 |
1644 return count; |
1553 // ----------------------------------------------------------------------------- |
1645 } |
1554 // CPhSrvUssdManager::UpdateNotifyMessage() |
1646 |
1555 // ----------------------------------------------------------------------------- |
1647 // ----------------------------------------------------------------------------- |
1556 // |
1648 // CPhSrvUssdManager::UpdateNotifyMessageL() |
1557 void CPhSrvUssdManager:: UpdateNotifyMessage() |
1649 // ----------------------------------------------------------------------------- |
1558 { |
1650 // |
1559 _DDPRINT( 4, "PhSrv.UpdateNotifyMessage.Start, clear: ", iClearArray ); // debug print |
1651 void CPhSrvUssdManager:: UpdateNotifyMessageL() |
|
1652 { |
|
1653 _DDPRINT( 4, "PhSrv.UpdateNotifyMessageL.Start, clear: ", iClearArray ); // debug print |
|
1654 |
|
1655 // Show left softkey - "Next" |
1560 if (NotifyCount() > 1 && !iClearArray ) |
1656 if (NotifyCount() > 1 && !iClearArray ) |
1561 { |
1657 { |
1562 _DPRINT( 4, "PhSrv.UpdateNotifyMessage" ); // debug print |
1658 _DPRINT( 4, "PhSrv.UpdateNotifyMessageL" ); // debug print |
1563 iGlobalMsgQuery->UpdateMsgQuery( R_AVKON_SOFTKEYS_NEXT_EXIT__NEXT ); |
1659 iDeviceDialog->SetButton( |
1564 } |
1660 CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue ); |
1565 _DPRINT( 4, "PhSrv.UpdateNotifyMessage.End" ); // debug print |
1661 iDeviceDialog->SetButtonTextL( |
|
1662 CHbDeviceMessageBoxSymbian::EAcceptButton, |
|
1663 LoadDefaultString( KUssdNext ) ); |
|
1664 } |
|
1665 // Remove left softkey |
|
1666 else |
|
1667 { |
|
1668 iDeviceDialog->SetButton( |
|
1669 CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); |
|
1670 } |
|
1671 iDeviceDialog->UpdateL(); |
|
1672 |
|
1673 _DPRINT( 4, "PhSrv.UpdateNotifyMessageL.End" ); // debug print |
1566 } |
1674 } |
1567 |
1675 |
1568 // ----------------------------------------------------------------------------- |
1676 // ----------------------------------------------------------------------------- |
1569 // CPhSrvUssdManager::DoCancel |
1677 // CPhSrvUssdManager::DoCancel |
1570 // ----------------------------------------------------------------------------- |
1678 // ----------------------------------------------------------------------------- |
1572 void CPhSrvUssdManager::DoCancel() |
1680 void CPhSrvUssdManager::DoCancel() |
1573 { |
1681 { |
1574 _DPRINT( 4, "PhSrv.DoCancel.Start" ); // debug print |
1682 _DPRINT( 4, "PhSrv.DoCancel.Start" ); // debug print |
1575 iTimer.Cancel(); |
1683 iTimer.Cancel(); |
1576 iLaunchGMQ = EFalse; |
1684 iLaunchGMQ = EFalse; |
1577 |
1685 if ( iDeviceDialog ) |
1578 if ( iGlobalMsgQuery ) |
|
1579 { |
1686 { |
1580 _DPRINT( 4, "PhSrv.DoCancel" ); // debug print |
1687 _DPRINT( 4, "PhSrv.DoCancel" ); // debug print |
1581 iGlobalMsgQuery->CancelMsgQuery(); |
1688 iDeviceDialog->Close(); |
|
1689 delete iDeviceDialog; |
|
1690 iDeviceDialog = NULL; |
1582 } |
1691 } |
1583 _DPRINT( 4, "PhSrv.DoCancel.End" ); // debug print |
1692 _DPRINT( 4, "PhSrv.DoCancel.End" ); // debug print |
1584 } |
1693 } |
1585 |
1694 |
1586 // ----------------------------------------------------------------------------- |
1695 // ----------------------------------------------------------------------------- |
1645 |
1754 |
1646 err = apaLsSession.StartApp( *apaCommandLine ); |
1755 err = apaLsSession.StartApp( *apaCommandLine ); |
1647 CleanupStack::PopAndDestroy( apaCommandLine ); |
1756 CleanupStack::PopAndDestroy( apaCommandLine ); |
1648 } |
1757 } |
1649 CleanupStack::PopAndDestroy(); // apaLsSession |
1758 CleanupStack::PopAndDestroy(); // apaLsSession |
|
1759 |
|
1760 // bring the ussd editor to foreground, only for testing |
|
1761 TApaTaskList tasklist( wsSession ); |
|
1762 TApaTask task = tasklist.FindApp( TUid::Uid( KPhSrvUssdAppUID ) ); |
|
1763 if ( task.Exists() ) |
|
1764 { |
|
1765 _DPRINT( 4, "PhSrv.UssdM.RequestStartEditingL.task.BringToForeground" ); |
|
1766 task.BringToForeground(); |
|
1767 } |
|
1768 // bring the ussd editor to foreground, only for testing |
1650 } |
1769 } |
1651 CleanupStack::PopAndDestroy(); // wsSession |
1770 CleanupStack::PopAndDestroy(); // wsSession |
1652 |
1771 |
1653 _DPRINT( 4, "PhSrv.UssdM.RequestStartEditingL.end" ); // debug print |
1772 _DPRINT( 4, "PhSrv.UssdM.RequestStartEditingL.end" ); // debug print |
1654 } |
1773 } |
1683 _DPRINT( 4, "PhSrv.UssdM.InfUssdAppTerminatingL.start" ); // debug print |
1802 _DPRINT( 4, "PhSrv.UssdM.InfUssdAppTerminatingL.start" ); // debug print |
1684 if ( iUssdReplyTimer ) |
1803 if ( iUssdReplyTimer ) |
1685 { |
1804 { |
1686 if ( iUssdReplyTimer->IsTimerActive() ) |
1805 if ( iUssdReplyTimer->IsTimerActive() ) |
1687 { |
1806 { |
1688 // debug print |
1807 |
1689 _DPRINT( 4, "PhSrv.UssdM.InfUssdAppTerminatingL.timer" ); |
1808 _DPRINT( 4, "PhSrv.UssdM.InfUssdAppTerminatingL.timer" ); |
1690 |
1809 |
1691 // Read the information what is the reason |
1810 // Read the information what is the reason |
1692 // for application termination. |
1811 // for application termination. |
1693 TPhCltUssdAppExitReason exitReason = EPhCltExitReasonUnknown; |
1812 TPhCltUssdAppExitReason exitReason = EPhCltExitReasonUnknown; |
1694 TPckg< TPhCltUssdAppExitReason > exitReasonPckg( exitReason ); |
1813 TPckg< TPhCltUssdAppExitReason > exitReasonPckg( exitReason ); |
1695 aMessage.ReadL( |
1814 aMessage.ReadL( |
1696 0, |
1815 0, |
1697 exitReasonPckg ); |
1816 exitReasonPckg ); |
1698 |
1817 |
1699 // debug print |
1818 |
1700 _DPRINT( 4, "PhSrv.UssdM.InfUssdAppTerminatingL.timer2" ); |
1819 _DPRINT( 4, "PhSrv.UssdM.InfUssdAppTerminatingL.timer2" ); |
1701 |
1820 |
1702 // If reason was the completion of send operation, the USSD |
1821 // If reason was the completion of send operation, the USSD |
1703 // session is not canceled, otherwise it is canceled. |
1822 // session is not canceled, otherwise it is canceled. |
1704 if ( exitReason != EPhCltSendCompleted ) |
1823 if ( exitReason != EPhCltSendCompleted ) |
1705 { |
1824 { |
1706 // debug print |
1825 |
1707 _DPRINT( 4, "PhSrv.UssdM.InfUssdAppTerminatingL.SendRelease" ); |
1826 _DPRINT( 4, "PhSrv.UssdM.InfUssdAppTerminatingL.SendRelease" ); |
1708 CloseSession(); |
1827 CloseSession(); |
1709 } |
1828 } |
1710 } |
1829 } |
1711 } |
1830 } |
1852 // |
1971 // |
1853 void CPhSrvUssdManager::CompleteSatL( |
1972 void CPhSrvUssdManager::CompleteSatL( |
1854 TDesC* aReceiveString, |
1973 TDesC* aReceiveString, |
1855 TInt aError ) |
1974 TInt aError ) |
1856 { |
1975 { |
1857 _DPRINT( 4, "PhSrv.CompleteSatL.Start" ); // debug print |
1976 _DPRINT( 4, "PhSrv.CompleteSatL.Start" ); |
1858 if ( aReceiveString ) |
1977 if ( aReceiveString ) |
1859 { |
1978 { |
1860 if ( aReceiveString->Length() ) |
1979 if ( aReceiveString->Length() ) |
1861 { |
1980 { |
1862 _DPRINT( 4, "PhSrv.CompleteSatL.recString.>0" ); // debug print |
1981 _DPRINT( 4, "PhSrv.CompleteSatL.recString.>0" ); // debug print |
1863 // copy the received string to client side. |
1982 // copy the received string to client side. |
1864 if ( iPendingSatMessagePointer.Int1() < aReceiveString->Length() ) |
1983 if ( iPendingSatMessagePointer.Int1() < aReceiveString->Length() ) |
1865 { |
1984 { |
1866 // debug print |
1985 |
1867 _DPRINT( 4, "PhSrv.CompleteSatL.recString.LengthError" ); |
1986 _DPRINT( 4, "PhSrv.CompleteSatL.recString.LengthError" ); |
1868 if ( !iPendingSatMessagePointer.IsNull() ) |
1987 if ( !iPendingSatMessagePointer.IsNull() ) |
1869 { |
1988 { |
1870 iPendingSatMessagePointer.Complete( KErrOverflow ); |
1989 iPendingSatMessagePointer.Complete( KErrOverflow ); |
1871 _DPRINT( 4, "PhSrv.CompleteSatLComplete.KErrOverFlow" ); |
1990 _DPRINT( 4, "PhSrv.CompleteSatLComplete.KErrOverFlow" ); |
1925 // |
2044 // |
1926 // ----------------------------------------------------------------------------- |
2045 // ----------------------------------------------------------------------------- |
1927 // |
2046 // |
1928 TInt CPhSrvUssdManager::PlayUssdTone() |
2047 TInt CPhSrvUssdManager::PlayUssdTone() |
1929 { |
2048 { |
1930 _DPRINT( 4, "PhSrv.UssdM.PlayTone.start" ); // debug print |
2049 _DPRINT( 4, "PhSrv.UssdM.PlayTone.start" ); |
1931 |
2050 |
1932 TInt err = KErrNone; |
2051 TInt err = KErrNone; |
1933 // <-- QT PHONE START--> |
2052 // <-- QT PHONE START--> |
1934 // RProperty::Define( KPSUidNcnList, KNcnPlayAlertTone, RProperty::EInt, ECapability_None , ECapabilityWriteDeviceData ); |
2053 // RProperty::Define( KPSUidNcnList, KNcnPlayAlertTone, RProperty::EInt, ECapability_None , ECapabilityWriteDeviceData ); |
1935 // RProperty::Set( KPSUidNcnList, KNcnPlayAlertTone, KPhSrvUssdTone ); |
2054 // RProperty::Set( KPSUidNcnList, KNcnPlayAlertTone, KPhSrvUssdTone ); |
1950 // |
2069 // |
1951 TInt CPhSrvUssdManager::GetTelephonyVariantData() |
2070 TInt CPhSrvUssdManager::GetTelephonyVariantData() |
1952 { |
2071 { |
1953 _DPRINT( 4, "PhSrv.UssdM.GetTelephonyVariantData.Start" ); |
2072 _DPRINT( 4, "PhSrv.UssdM.GetTelephonyVariantData.Start" ); |
1954 TInt err = KErrNone; |
2073 TInt err = KErrNone; |
|
2074 // <-- QT PHONE START--> |
|
2075 /* |
|
2076 // Variation data should be unchangable during run-time, |
|
2077 // therefore, if once succesfully read, later reads are |
|
2078 // not allowed. |
|
2079 if ( iVariantReadOnlyValues == KPhSrvDefaultValue ) |
|
2080 { |
|
2081 CRepository* cenRepSession = NULL; |
|
2082 TRAP ( err , |
|
2083 cenRepSession = CRepository::NewL( KCRUidTelVariation ) ); |
|
2084 if ( err == KErrNone ) |
|
2085 { |
|
2086 err = cenRepSession->Get( KTelVariationFlags, |
|
2087 iVariantReadOnlyValues ); |
|
2088 } |
|
2089 delete cenRepSession; |
|
2090 } |
|
2091 |
|
2092 _DDPRINT( 4, "PhSrv.UssdM.variant", iVariantReadOnlyValues ); // debug print |
|
2093 _DPRINT( 4, "PhSrv.UssdM.GetTelephonyVariantData.End" ); |
|
2094 */ |
|
2095 // <-- QT PHONE END--> |
1955 return err; |
2096 return err; |
1956 } |
2097 } |
1957 |
2098 |
1958 |
2099 |
1959 // ----------------------------------------------------------------------------- |
2100 // ----------------------------------------------------------------------------- |
1979 msgAttribs.iDcs = KPhSrvUssdDefaultDCS; |
2120 msgAttribs.iDcs = KPhSrvUssdDefaultDCS; |
1980 |
2121 |
1981 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg attribs = msgAttribs; |
2122 RMobileUssdMessaging::TMobileUssdAttributesV1Pckg attribs = msgAttribs; |
1982 SendHandlerL().SendUssdL( KNullDesC8() , attribs ); |
2123 SendHandlerL().SendUssdL( KNullDesC8() , attribs ); |
1983 |
2124 |
1984 _DPRINT( 4, "PhSrv.SendMoAckL.End" ); // debug print |
2125 _DPRINT( 4, "PhSrv.SendMoAckL.End" ); |
1985 } |
2126 } |
1986 |
2127 |
1987 // ----------------------------------------------------------------------------- |
2128 // ----------------------------------------------------------------------------- |
1988 // CPhSrvUssdManager::TurnLightsOn |
2129 // CPhSrvUssdManager::TurnLightsOn |
1989 // |
2130 // |
1990 // ----------------------------------------------------------------------------- |
2131 // ----------------------------------------------------------------------------- |
1991 // |
2132 // |
1992 void CPhSrvUssdManager::TurnLightsOn() |
2133 void CPhSrvUssdManager::TurnLightsOn() |
1993 { |
2134 { |
1994 _DPRINT( 4, "PhSrv.TurnLightsOn Start" ); // debug print |
2135 _DPRINT( 4, "PhSrv.TurnLightsOn.Start" ); |
1995 |
2136 |
1996 |
2137 |
1997 // Change the bit on and off. SysAp will detect that |
2138 // Change the bit on and off. SysAp will detect that |
1998 // the lights should be switched on for the specified time. |
2139 // the lights should be switched on for the specified time. |
1999 // |
2140 // |
2000 RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOn); |
2141 RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOn); |
2001 TInt err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOff); |
2142 TInt err = RProperty::Set(KPSUidCoreApplicationUIs, KLightsControl, ELightsOff); |
2002 |
2143 |
2003 if ( err != KErrNone ) |
2144 if ( err != KErrNone ) |
2004 { |
2145 { |
2005 _DDPRINT( 4,"PhSrv.TurnLightsOn.Error: ",err );// debug print |
2146 _DDPRINT( 4,"PhSrv.TurnLightsOn.Error: ",err );// debug print |
2006 } |
2147 } |
2007 |
2148 |
2008 _DPRINT( 4, "PhSrv.TurnLightsOn.End" ); // debug print |
2149 _DPRINT( 4, "PhSrv.TurnLightsOn.End" ); |
2009 } |
2150 } |
|
2151 |
|
2152 // ----------------------------------------------------------------------------- |
|
2153 // CPhSrvUssdManager::LoadDefaultString |
|
2154 // ----------------------------------------------------------------------------- |
|
2155 // |
|
2156 const TPtrC CPhSrvUssdManager::LoadDefaultString( const TDesC& aText ) |
|
2157 { |
|
2158 _DPRINT( 4, "PhSrv.LoadDefaultString.Start" ); |
|
2159 |
|
2160 if ( iTextBuffer ) |
|
2161 { |
|
2162 delete iTextBuffer; |
|
2163 iTextBuffer = NULL; |
|
2164 _DPRINT( 4, "PhSrv.LoadDefaultString.Clear" ); |
|
2165 } |
|
2166 TInt err = KErrNone; |
|
2167 TPtrC ptr( aText ); |
|
2168 if ( iTextResolver && ptr.Length() ) |
|
2169 { |
|
2170 TRAP( err, iTextBuffer = HbTextResolverSymbian::LoadL( ptr ) ); |
|
2171 _DDPRINT( 4, "PhSrv.LoadDefaultString.LoadL.%d", err ); |
|
2172 if ( iTextBuffer ) |
|
2173 { |
|
2174 ptr.Set( iTextBuffer->Des() ); |
|
2175 _DPRINT( 4, "PhSrv.LoadDefaultString.Set" ); |
|
2176 } |
|
2177 } |
|
2178 _DPRINT( 4, "PhSrv.LoadDefaultString.End" ); |
|
2179 return ptr; |
|
2180 } |
|
2181 |
2010 // End of File |
2182 // End of File |