phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdImp.cpp
branchRCL_3
changeset 19 7d48bed6ce0c
parent 3 a4a774cb6ea7
child 20 987c9837762f
--- a/phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdImp.cpp	Thu Aug 19 10:28:14 2010 +0300
+++ b/phoneclientserver/phoneclient/Src/UssdWrapper/CPhCltUssdImp.cpp	Tue Aug 31 15:45:17 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -18,29 +18,26 @@
 
 
 // INCLUDE FILES
-#include "CPhCltUssdImp.h"
-#include "CPhCltUssdRequestHandler.h"
-#include "PhCltClientServer.h"
-#include <PhCltTypes.h>
+#include "cphcltussdimp.h" 
+#include "cphcltussdrequesthandler.h" 
+#include "phcltclientserver.h" 
+#include <phclttypes.h> 
 
 #include <etelmm.h>
 #include <f32file.h>
 #include <charconv.h>
 #include <gsmuelem.h>
-//
-#include <coemain.h>
-#include <avkon.hrh>
-#include <avkon.rsg> 
-
-#include <PhoneClient.rsg>
+#include <coemain.h>  
+//#include <phoneclient.rsg> 
 #include <exterror.h>
 
 #include <gsmerror.h>
 #include <etelsat.h>
 
-#include "MPhCltUssdNoteControllerCallBack.h"
-#include "CPhCltUssdNoteController.h"
-
+#include "mphcltussdnotecontrollercallback.h" 
+#include "cphcltussdnotecontroller.h" 
+#include "cphcltussdcommonconstant.h"
+#include "tflogger.h"
 // CONSTANTS
 
 const TUint8 KPhCltUssdDcsDefaultAlphabet = 0x0f; // 00001111
@@ -333,10 +330,12 @@
 //
 CPhCltUssdImp* CPhCltUssdImp::NewL( TBool aShowNotes )
     {
+    TFLOGSTRING("CPhCltUssdImp: NewL call")
     CPhCltUssdImp* self = new( ELeave ) CPhCltUssdImp;
     CleanupStack::PushL( self );
     self->ConstructL( aShowNotes );
     CleanupStack::Pop(); // self
+    TFLOGSTRING("CPhCltUssdImp: NewL exit")
     return self;
     }
 
@@ -348,14 +347,14 @@
 //
 void CPhCltUssdImp::ConstructL( TBool aShowNotes )
     {
+    TFLOGSTRING("CPhCltUssdImp: ConstructL call")
     // The note controller is needed only if the notes are shown.
     iNoteController = NULL;
     
     if ( aShowNotes )
         {
         iNoteController = CPhCltUssdNoteController::NewL( 
-            *this, 
-            CActive::EPriorityStandard );
+            *this );
         }
 
     iDCS = KPhCltUssdDcsDefaultAlphabet;
@@ -365,6 +364,7 @@
     iRequestHandler = CPhCltUssdRequestHandler::NewL( 
         *this, 
         CActive::EPriorityStandard );
+    TFLOGSTRING("CPhCltUssdImp: ConstructL exit")
     }
 
 
@@ -376,6 +376,7 @@
 //
 CPhCltUssdImp::CPhCltUssdImp()
     {
+    TFLOGSTRING("CPhCltUssdImp: CPhCltUssdImp call_exit")
     } 
 
 
@@ -386,6 +387,7 @@
 //
 CPhCltUssdImp::~CPhCltUssdImp()
     {
+    TFLOGSTRING("CPhCltUssdImp: ~CPhCltUssdImp call") 
     if ( iWait )
         {
         if ( iWait->IsStarted() )
@@ -400,7 +402,8 @@
     iRequestHandler = NULL;
     
     delete iNoteController;
-    iNoteController = NULL;      
+    iNoteController = NULL;
+    TFLOGSTRING("CPhCltUssdImp: ~CPhCltUssdImp exit") 
     }
 
 
@@ -413,8 +416,9 @@
 //
 void CPhCltUssdImp::HandleSendEventL( const TInt aError )
     {
-    *iSendError = Min( aError , KErrNone );
-
+    iSendError = Min( aError , KErrNone );
+    TFLOGSTRING2("CPhCltUssdImp: HandleSendEventL\
+            aError = %d call", aError)
     // iNoteController is allocated only if notes are shown.
     if ( iNoteController )
         {
@@ -428,12 +432,12 @@
                 {
                 // All Ok.
                 case KErrNone:
-                    iNoteController->ShowGlobalConfirmationNoteL( R_TEXT_DONE );
+                    iNoteController->ShowGlobalInformationNoteL( EPhCltUssdDone );
                     break;
 
                 // Operation cancelled.
                 case KErrCancel:
-                    iNoteController->ShowGlobalInformationNoteL( R_TEXT_UNCONFIRMED );
+                    iNoteController->ShowGlobalInformationNoteL( EPhCltUssdUnconfirme );
                     break;
 
                 // Ongoing Ussd session or the string is barred due SS request
@@ -441,17 +445,17 @@
                 case KErrInUse:
                 case KErrAccessDenied:
                 case KErrGsmSSCallBarred:
-                    iNoteController->ShowGlobalInformationNoteL( R_TEXT_NOT_ALLOWED );
+                    iNoteController->ShowGlobalInformationNoteL( EPhCltUssdNotallowed );
                     break;
 
                 // No network coverage.
                 case KErrGsmSMSNoNetworkService:
-                    iNoteController->ShowGlobalInformationNoteL( R_TEXT_NO_SERVICE );
+                    iNoteController->ShowGlobalInformationNoteL(EPhCltUssdNoservice );
                     break;
 
                 // Offline mode.
                 case KErrGsmOfflineOpNotAllowed:
-                    iNoteController->ShowGlobalInformationNoteL( R_TEXT_OFFLINE );
+                    iNoteController->ShowGlobalInformationNoteL( EPhCltUssdOffline );
                     break;
                     
                 case KErrSatControl:
@@ -459,7 +463,7 @@
 
                 // Unknown error.
                 default:
-                    iNoteController->ShowGlobalInformationNoteL( R_TEXT_NOT_DONE );
+                    iNoteController->ShowGlobalInformationNoteL( EPhCltUssdNotDone );
                     break;
                 }
             }
@@ -470,6 +474,7 @@
         {
         iWait->AsyncStop();
         }
+    TFLOGSTRING("CPhCltUssdImp: HandleSendEventL exit")
     }
 
 
@@ -531,10 +536,11 @@
     const TDesC8& aMsgData, 
     const TUint8 iSendDcs )
     {
+    TFLOGSTRING("CPhCltUssdImp: SendUssd call")
     __ASSERT_ALWAYS( aMsgData.Length() <= KPhCltUssdMax7BitCharacterOctets,
         User::Invariant() );
 
-	RMobileUssdMessaging::TMobileUssdAttributesV1 attribute;
+    RMobileUssdMessaging::TMobileUssdAttributesV1 attribute;
 
     attribute.iFlags = 
         RMobileUssdMessaging::KUssdDataFormat + 
@@ -549,13 +555,13 @@
         }
         
     if ( iSendDcs == KPhCltUssdDcsNotSet  ) // 0x00
-		{
-		attribute.iDcs = KPhCltUssdDcsDefaultAlphabet;
- 		}
- 	else
- 		{
- 		attribute.iDcs = iSendDcs;
- 		} 
+        {
+        attribute.iDcs = KPhCltUssdDcsDefaultAlphabet;
+        }
+    else
+        {
+        attribute.iDcs = iSendDcs;
+        } 
     
     RMobileUssdMessaging::TMobileUssdAttributesV1Pckg 
         attributePckg( attribute );
@@ -566,30 +572,23 @@
         return KErrInUse;
         }
 
-    TInt error = KErrNone;
-    iSendError = &error;
-  
-  	iRequestHandler->SendUssd( aMsgData , attributePckg );
+    iSendError = KErrNone;
+    TFLOGSTRING("CPhCltUssdImp: SendUssd iRequestHandler")
+    iRequestHandler->SendUssd( aMsgData , attributePckg );
     // iNoteController is allocated only if notes are shown.
+    TFLOGSTRING("CPhCltUssdImp: SendUssd ShowGlobalWaitNoteL")
     if ( iNoteController )
         {
-        TRAP_IGNORE( iNoteController->ShowGlobalWaitNoteL( 
-        	R_TEXT_SENDING, 
-            R_AVKON_SOFTKEYS_QUIT ) );
+        TRAP_IGNORE( iNoteController->ShowGlobalWaitNoteL(); 
+                    );
         }
+    TFLOGSTRING("CPhCltUssdImp: SendUssd iWait") 
 
     // Set this active object to wait the completion of the send request.
     iWait->Start();
-    
-    // Need to check iWait handle here because the destructor may be called
-    // while pending for completion of the send request.
-    // coverity[check_after_deref]
-    if( iWait )
-        {
-        iSendError = NULL;
-        }
-    
-    return error;
+
+    TFLOGSTRING("CPhCltUssdImp: SendUssd exit") 
+    return iSendError;
     }
 
 
@@ -601,7 +600,9 @@
 //
 void CPhCltUssdImp::SendUssdCancel()
     {
+    TFLOGSTRING("CPhCltUssdImp: SendUssdCancel call")
     iRequestHandler->SendUssdCancel();
+    TFLOGSTRING("CPhCltUssdImp: SendUssdCancel exit")
     }
 
 
@@ -624,7 +625,10 @@
 //
 TInt CPhCltUssdImp::AppStarting()
     {
-    return iRequestHandler->UssdClient().AppStarting();
+    TFLOGSTRING("CPhCltUssdImp: AppStarting call")
+    TInt res = iRequestHandler->UssdClient().AppStarting();
+    TFLOGSTRING2("CPhCltUssdImp: AppStarting exit res = %d",res)
+    return res;
     }
     
 // -----------------------------------------------------------------------------
@@ -636,7 +640,10 @@
 TInt CPhCltUssdImp::AppTerminating( 
       TPhCltUssdAppExitReason aExitReason )
     {
-    return iRequestHandler->UssdClient().AppTerminating( aExitReason );
+    TFLOGSTRING("CPhCltUssdImp: AppTerminating call")
+    TInt res = iRequestHandler->UssdClient().AppTerminating( aExitReason );
+    TFLOGSTRING2("CPhCltUssdImp: AppTerminating exit res = %d",res)
+    return res;
     }
     
 // -----------------------------------------------------------------------------
@@ -647,7 +654,10 @@
 //    
 TBool CPhCltUssdImp::AppToForeground()
     {
-    return iRequestHandler->UssdClient().AppToForeground();
+    TFLOGSTRING("CPhCltUssdImp: AppToForeground call")
+    TBool res =  iRequestHandler->UssdClient().AppToForeground();
+    TFLOGSTRING2("CPhCltUssdImp: AppToForeground exit res = %d",res)
+    return res;
     }
     
 // -----------------------------------------------------------------------------
@@ -658,7 +668,10 @@
 //    
 TInt CPhCltUssdImp::AppToBackground()
     {
-    return iRequestHandler->UssdClient().AppToBackground();
+    TFLOGSTRING("CPhCltUssdImp: AppToBackground call")
+    TInt res = iRequestHandler->UssdClient().AppToBackground();
+    TFLOGSTRING2("CPhCltUssdImp: AppToBackground exit res = %d",res)
+    return res;
     }
 
 // -----------------------------------------------------------------------------
@@ -672,7 +685,9 @@
             TDes& aReceiveMessage, 
             TPckg< TUint >& aShowNotesAndDcs )
     {
+    TFLOGSTRING("CPhCltUssdImp: StartSAT call")
     iRequestHandler->UssdClient().StartSAT( aStatus, aReceiveMessage, aShowNotesAndDcs );
+    TFLOGSTRING("CPhCltUssdImp: StartSAT exit")
     }
  
 // -----------------------------------------------------------------------------
@@ -683,24 +698,22 @@
 //   
  void CPhCltUssdImp::StopSAT()
     {
+    TFLOGSTRING("CPhCltUssdImp: StopSAT call")
     iRequestHandler->UssdClient().StopSAT();
+    TFLOGSTRING("CPhCltUssdImp: StopSAT exit")
     }
 
 
 // -----------------------------------------------------------------------------
-// CPhCltUssdImp::GlobalNoteDismissedL
+// CPhCltUssdImp::GlobalWaitNoteHidden
 //
-// Dialog is cancelled by the right softkey.
+// Dialog is hidden by the cancel key.
 // -----------------------------------------------------------------------------
 //
-void CPhCltUssdImp::GlobalWaitNoteDismissedL( TInt aButtonId )
+void CPhCltUssdImp::GlobalWaitNoteHidden()
     {
-    if ( aButtonId == EAknSoftkeyClose || 
-         aButtonId == EAknSoftkeyCancel ||
-         aButtonId == EAknSoftkeyQuit )
-        {   
-        SendUssdCancel();
-        }
+    TFLOGSTRING("CPhCltUssdImp: GlobalWaitNoteHidden call")
+    TFLOGSTRING("CPhCltUssdImp: GlobalWaitNoteHidden exit")
     }
 
 
@@ -712,8 +725,8 @@
 //
 void CPhCltUssdImp::EncodeL( const TDesC& aSrc, TDes8& aDes )
     {
-    //
-     aDes.Zero();
+    TFLOGSTRING("CPhCltUssdImp: EncodeL call")
+    aDes.Zero();
     TSmsDataCodingScheme::TSmsAlphabet alphabet = 
         TSmsDataCodingScheme::ESmsAlphabet7Bit; // default
         
@@ -816,6 +829,7 @@
         }
     
     CleanupStack::PopAndDestroy(3); // fs, packer, charConv
+    TFLOGSTRING("CPhCltUssdImp: EncodeL exit")
     }
 
 // -----------------------------------------------------------------------------