phoneapp/phoneuistates/src/cphonegeneralgsmmessageshandler.cpp
branchRCL_3
changeset 25 5266b1f337bd
parent 24 41a7f70b3818
--- a/phoneapp/phoneuistates/src/cphonegeneralgsmmessageshandler.cpp	Tue Aug 31 15:14:29 2010 +0300
+++ b/phoneapp/phoneuistates/src/cphonegeneralgsmmessageshandler.cpp	Wed Sep 01 12:30:10 2010 +0100
@@ -100,7 +100,7 @@
     switch ( aMessage )
         {
         case MEngineMonitor::EPEMessageCallBarred:
-            SendGlobalInfoNoteL( EPhoneActiveBarrings, ETrue );
+            SendGlobalInfoNoteL( EPhoneActiveBarrings );
             break;
         
         case MEngineMonitor::EPEMessageIncCallIsForw:
@@ -108,19 +108,29 @@
             break;
             
         case MEngineMonitor::EPEMessageIncCallForwToC:
-            SendGlobalInfoNoteL( EPhoneMtCallDiverting, ETrue );
+            SendGlobalInfoNoteL( EPhoneMtCallDiverting );
             break;
             
         case MEngineMonitor::EPEMessageOutCallForwToC:
-            SendGlobalInfoNoteL( EPhoneDiverting, ETrue );
+            SendGlobalInfoNoteL( EPhoneDiverting );
             break;
 
+        case MEngineMonitor::EPEMessageShowVersion:
+            HandleShowVersionL();
+            break;
+            
         case MEngineMonitor::EPEMessageIssuedSSRequest:
             {
             __PHONELOG(
                 EBasic, 
                 EPhoneUIStates,
                 "CPhoneGeneralGsmMessagesHandler::EPEMessageIssuedSSRequest" );
+
+            TPhoneCmdParamBoolean booleanParam;
+            booleanParam.SetBoolean( EFalse );
+            iViewCommandHandle.ExecuteCommandL( 
+                EPhoneViewSetBlockingDialogStatus, 
+                &booleanParam );
             break;
             }
             
@@ -155,26 +165,47 @@
                 EPhoneViewSetGlobalNotifiersDisabled,
                 &globalNotifierParam );
             
+            TPhoneCmdParamBoolean booleanParam;
+            booleanParam.SetBoolean( ETrue );
+            iViewCommandHandle.ExecuteCommandL( 
+                EPhoneViewSetBlockingDialogStatus, 
+                &booleanParam );
+            
             // Get active call count
             TPhoneCmdParamInteger activeCallCount;
             iViewCommandHandle.ExecuteCommandL(
                 EPhoneViewGetCountOfActiveCalls, &activeCallCount );
             
+            if( !activeCallCount.Integer() )
+                {
+                __PHONELOG(
+                    EBasic, 
+                    EPhoneUIStates,
+                    "CPhoneGeneralGsmMessagesHandler::EPEMessageIssuingSSRequest no active call" );
+                // Ensure that the dialer is activated to display local notes and dialogs properly.
+                TPhoneCmdParamAppInfo param;
+                param.SetAppUid( KUidPhoneApplication );
+                param.SetViewUid( KUidViewId );
+                param.SetCustomMessageId( TUid::Uid( KTouchDiallerViewCommand ) );
+                iViewCommandHandle.ExecuteCommandL( 
+                    EPhoneViewActivateAppViewWithCustomMessage, 
+                    &param );
+                }
             // Remove phoneumber query
             iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveQuery );
             break;
             }
 
         case MEngineMonitor::EPEMessageTempClirActivationUnsuccessful:
-            SendGlobalErrorNoteL( EPhoneSSNotifCLIRSupprReject, ETrue );
+            SendGlobalErrorNoteL( EPhoneSSNotifCLIRSupprReject );
             break;
             
         case MEngineMonitor::EPEMessageForwardUnconditionalModeActive:
-            SendGlobalInfoNoteL( EPhoneAllIncomingCallsDiverted, ETrue );
+            SendGlobalInfoNoteL( EPhoneAllIncomingCallsDiverted );
             break;
             
         case MEngineMonitor::EPEMessageForwardConditionallyModeActive:
-            SendGlobalInfoNoteL( EPhoneActiveDiverts, ETrue );
+            SendGlobalInfoNoteL( EPhoneActiveDiverts );
             break;
 
         default:
@@ -186,8 +217,7 @@
 // CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL
 // ---------------------------------------------------------
 //
-void CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL( 
-        TInt aResourceId, TBool aNotificationDialog )
+void CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL( TInt aResourceId )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneGeneralGsmMessagesHandler::SendGlobalInfoNoteL()" );
@@ -202,14 +232,12 @@
             &globalNotifierParam );
             
         TPhoneCmdParamGlobalNote globalNoteParam;
-        PhoneNotificationType type = aNotificationDialog ? 
-                EPhoneNotificationDialog : EPhoneMessageBoxInformation;
-        globalNoteParam.SetType( type );
       
+        globalNoteParam.SetType( EAknGlobalInformationNote );
         globalNoteParam.SetTextResourceId( 
             CPhoneMainResourceResolver::Instance()->
             ResolveResourceID( aResourceId ) );
-        globalNoteParam.SetNotificationDialog( aNotificationDialog );
+        globalNoteParam.SetTone( EAvkonSIDInformationTone );
 
         iViewCommandHandle.ExecuteCommandL( 
             EPhoneViewShowGlobalNote, &globalNoteParam );    
@@ -224,17 +252,83 @@
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneGeneralGsmMessagesHandler::HandleIncomingCallForwardedL()" );
+    }
+
+// -----------------------------------------------------------
+// CPhoneGeneralGsmMessagesHandler::HandleShowVersionL
+// -----------------------------------------------------------
+//
+void CPhoneGeneralGsmMessagesHandler::HandleShowVersionL()
+    {
+    __LOGMETHODSTARTEND( EPhoneUIStates, 
+        "CPhoneGeneralGsmMessagesHandler::HandleShowVersionL()" );
+    if ( FeatureManager::FeatureSupported( KFeatureIdOnScreenDialer )  )  
+        {
+        iViewCommandHandle.ExecuteCommandL( EPhoneViewClearNumberEntryContent );       
+        }
+    else
+        {
+        // Remove number entry from screen
+        iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveNumberEntry );        
+        } 
+
+
+#ifdef __SYNCML_DM
+    // Launch DM UI 
+    RWsSession sess = CCoeEnv::Static()->WsSession();
+    RApaLsSession apaLsSession;        
+  
+    TApaTaskList appList( sess );
+    TApaTask bring = appList.FindApp( KDeviceManagerUid );
+
+    if ( bring.Exists() )
+        {
+        bring.BringToForeground();
+        }
+    else
+        {
+        if( !apaLsSession.Handle() )
+            {
+            User::LeaveIfError(apaLsSession.Connect());
+            }
+        CleanupClosePushL( apaLsSession );
+        TThreadId thread;
+        User::LeaveIfError( apaLsSession.StartDocument(KNullDesC, KDeviceManagerUid, thread) );
+        CleanupStack::PopAndDestroy( &apaLsSession );  
+        }
+
+    // Stop dtmf tone. Long key press case key up event go to 
+    // device manager application.
+    iStateMachine.SendPhoneEngineMessage(
+        MPEPhoneModel::EPEMessageEndDTMF );
     
-    iActiveState.SetDivertIndication( ETrue );
+#else    
+    // Fetch version number
+    TPEPhoneIdentityParameters phoneIdentityParameters = iStateMachine.
+        PhoneEngineInfo()->PhoneIdentityParameters();
+
+    // Add it to the resource string
+    HBufC* buf = HBufC::NewLC( KSysUtilVersionTextLength );
+    buf->Des().Format( phoneIdentityParameters.iRevision );
+        
+    TPhoneCmdParamNote noteParam;
+    noteParam.SetType( EPhoneNoteCustom );
+    noteParam.SetResourceId( CPhoneMainResourceResolver::Instance()->
+        ResolveResourceID( EPhoneInformationWaitNote ) );
+    noteParam.SetText( *buf );
     
+    // Display note
+    iViewCommandHandle.ExecuteCommandL( EPhoneViewShowNote, &noteParam );
+    
+    CleanupStack::PopAndDestroy( buf );
+#endif
     }
 
 // ---------------------------------------------------------
 //  CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL
 // ---------------------------------------------------------
 //
-void CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL( 
-        TInt aResourceId, TBool aNotificationDialog )
+void CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL( TInt aResourceId )
     {
     __LOGMETHODSTARTEND( EPhoneUIStates, 
         "CPhoneGeneralGsmMessagesHandler::SendGlobalErrorNoteL()" );
@@ -250,14 +344,12 @@
             &globalNotifierParam );
             
         TPhoneCmdParamGlobalNote globalNoteParam;
-        PhoneNotificationType type = aNotificationDialog ? 
-                EPhoneNotificationDialog : EPhoneMessageBoxInformation;
-        globalNoteParam.SetType( type );
+        globalNoteParam.SetType( EAknGlobalErrorNote );
         globalNoteParam.SetTextResourceId( 
             CPhoneMainResourceResolver::Instance()->
             ResolveResourceID( aResourceId ) );
-        globalNoteParam.SetNotificationDialog( aNotificationDialog );
-        
+        globalNoteParam.SetTone( CAknNoteDialog::EErrorTone );
+
         iViewCommandHandle.ExecuteCommandL( 
             EPhoneViewShowGlobalNote, &globalNoteParam );
         }