phoneapp/phoneuicontrol/src/cphonestateincoming.cpp
branchRCL_3
changeset 61 41a7f70b3818
parent 58 40a3f856b14d
child 62 5266b1f337bd
--- a/phoneapp/phoneuicontrol/src/cphonestateincoming.cpp	Thu Aug 19 09:54:27 2010 +0300
+++ b/phoneapp/phoneuicontrol/src/cphonestateincoming.cpp	Tue Aug 31 15:14:29 2010 +0300
@@ -24,7 +24,6 @@
 #include <StringLoader.h>
 #include <dundomainpskeys.h>
 #include <telephonyvariant.hrh>
-#include <ScreensaverInternalPSKeys.h>
 #include <mpeengineinfo.h>
 #include <MediatorDomainUIDs.h>
 #include <videotelcontrolmediatorapi.h>
@@ -54,7 +53,7 @@
 #include "cphonemediatorsender.h"
 #include "cphonereleasecommand.h"
 #include "mphonecustomization.h"
-#include "mphonesecuritymodeobserver.h"
+#include "mphonestorage.h"
 
 // ================= MEMBER FUNCTIONS =======================
 
@@ -154,7 +153,6 @@
         "CPhoneStateIncoming::HandleNumberEntryClearedL ()" );
     // Set incoming call CBA when number entry is cleared
     iCbaManager->UpdateIncomingCbaL( iRingingCallId );
-    UpdateSilenceButtonDimming();
     }
 
 // -----------------------------------------------------------
@@ -220,14 +218,16 @@
                 // Answer the call if long press of selection key
                 AnswerCallL();
                 }
-            else if ( CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported(
-                        KTelephonyLVFlagCoverHideSendEndKey ))
+            break;
+
+        case EKeyDeviceF:
                 {
-                // Open number entry OK menubar
-                OpenMenuBarL();
+                __PHONELOG( EBasic, EPhoneUIStates,
+                    "CPhoneConferenceAndSingleAndWaiting::HandleKeyMessageL-deviceF" );
+                HandleHoldSwitchL();
                 }
             break;
-
+            
         default:
             break;
         }
@@ -248,7 +248,7 @@
             MPEPhoneModel::EPEMessagePhoneNumberEdited );
     
     if ( phoneNumber->Des().Length() < KPhoneValidPhoneNumberLength 
-    		&& iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() ) 
+            && iStateMachine->PhoneEngineInfo()->PhoneNumberIsServiceCode() ) 
         {
         // Send a manual control sequence by providing number
         // information with dial command
@@ -361,6 +361,7 @@
     {
     __LOGMETHODSTARTEND(EPhoneControl,
         "CPhoneStateIncoming::HandleConnectedL ()" );
+
     // Re-enable global notes
     TPhoneCmdParamBoolean globalNotifierParam;
     globalNotifierParam.SetBoolean( EFalse );
@@ -370,13 +371,38 @@
         &globalNotifierParam );
     // Stop tone playing, if necessary
     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
+    
+    if( IsVideoCall( aCallId ) && !IsAutoLockOn() )
+        {
+        // For keeping video call on top
+        TPhoneCmdParamBoolean booleanParam;
+        booleanParam.SetBoolean( EFalse );
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewSetNeedToSendToBackgroundStatus, &booleanParam );
+        }
+
+    if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
+         && iStateMachine->PhoneStorage()->IsScreenLocked() )
+        {
+        EnableCallUIL();
+        }
+    
+    // Reset blocked keys list
+    iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+
     BeginUiUpdateLC();
+    
     // Update single call
     UpdateSingleActiveCallL( aCallId );
+
     SetTouchPaneButtons( EPhoneIncallButtons );
-    SetToolbarDimming( EFalse );
+    SetBackButtonActive(ETrue);
+            
     EndUiUpdate();
+
+    // Go to single state
     iCbaManager->UpdateCbaL( EPhoneCallHandlingInCallCBA );
+
     iStateMachine->ChangeState( EPhoneStateSingle );
     }
 
@@ -388,30 +414,10 @@
     {
     __LOGMETHODSTARTEND(EPhoneControl,
         "CPhoneStateIncoming::HandleAudioPlayStoppedL ()" );
-    // Update the CBA
-    
     // Set the ringtone silenced status
     iCbaManager->SetRingtoneSilencedStatus( ETrue );
     TInt resourceId = EPhoneCallHandlingIncomingRejectCBA;
-    // Get the soft reject flag status
-    TPhoneCmdParamBoolean softRejectParam;
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSoftRejectFlag,
-        &softRejectParam );
-
-    if ( IsNumberEntryVisibleL() && !iOnScreenDialer )
-        {
-        resourceId = EPhoneNumberAcqCBA;
-        }
-    else if ( iStateMachine->SecurityMode()->IsSecurityMode() )
-    	{
-		// Use 'answer & reject' softkeys if security mode is enabled.
-    	resourceId = EPhoneCallHandlingIncomingRejectCBA;
-    	}
-    else if ( softRejectParam.Boolean() )
-        {
-        resourceId = EPhoneCallHandlingIncomingSoftRejectCBA;
-        }
-	iCbaManager->SetCbaL( resourceId );
+    iCbaManager->SetCbaL( resourceId );
     }
 
 // -----------------------------------------------------------
@@ -422,10 +428,21 @@
     {
     __LOGMETHODSTARTEND(EPhoneControl,
         "CPhoneStateIncoming::HandleIdleL ()" );
-    BeginTransEffectLC( ENumberEntryClose );
     BeginUiUpdateLC();
+
+    // Enable call UI
+    if( FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke ) 
+        && iStateMachine->PhoneStorage()->IsScreenLocked() )
+        {
+        EnableCallUIL();
+        }
+
+    // Reset blocked keys list
+    iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+    
+    // Remove call
     iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveCallHeader, aCallId );
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarClose );
+    // Stop tone playing, if necessary
     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
     
     TPhoneCmdParamBoolean globalNotifierParam;
@@ -437,11 +454,12 @@
     
      if ( IsNumberEntryUsedL() )
         {
-        if ( NeedToReturnToForegroundAppL() )
+        if ( NeedToSendToBackgroundL() )
             {
             // Return phone to the background if send to background is needed.
             iViewCommandHandle->ExecuteCommandL( EPhoneViewSendToBackground );
-            iViewCommandHandle->ExecuteCommandL( EPhoneViewSetControlAndVisibility );
+
+            // Set Number Entry CBA
             iCbaManager->SetCbaL( EPhoneNumberAcqCBA );
             }
         else
@@ -450,8 +468,7 @@
             SetNumberEntryVisibilityL(ETrue);
             }
         }
-    else if ( NeedToReturnToForegroundAppL() ||
-        SoftRejectMessageEditorIsDisplayedL() )
+    else if ( NeedToSendToBackgroundL() )
         {
         // Continue displaying current app but set up the
         // idle screen in the background
@@ -459,12 +476,15 @@
         }
     else
         {
+        // Display idle screen
         DisplayIdleScreenL();
         }
  
     DeleteTouchPaneButtons();
+    SetBackButtonActive(ETrue);
+    
     EndUiUpdate();
-    EndTransEffect();
+    // Go to idle state   
     iCbaManager->UpdateCbaL( EPhoneEmptyCBA );
     iStateMachine->ChangeState( EPhoneStateIdle );
     }
@@ -485,8 +505,6 @@
             // Stop tone playing, if necessary.
             // And stop vibrating, if it is active.
             iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
-            // Open the menu bar
-            OpenMenuBarL();
             break;
 
         case EPhoneCallComingCmdAnswer:
@@ -509,8 +527,6 @@
         case EPhoneCallComingCmdSilent:
             // Silence the ringer. And stop vibrating, if it is active.
             iViewCommandHandle->ExecuteCommandL( EPhoneViewMuteRingTone );
-            // Dim silence button
-            SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent );
             HandleAudioPlayStoppedL();
             iStateMachine->SendPhoneEngineMessage(
                 MPEPhoneModel::EPEMessageStopTonePlay );
@@ -518,29 +534,13 @@
 
         case EPhoneCallComingCmdSoftReject:
             // Open Soft reject message editor
-            OpenSoftRejectMessageEditorL();
+            OpenSoftRejectMessageL();
             break;
 
         case EPhoneNumberAcqCmdSendCommand:
             HandleSendL();
             break;
 
-        case EPhoneInCallCmdHelp:
-            {
-            TPtrC contextName;
-            if( IsVideoCall( iRingingCallId ) )
-                {
-                contextName.Set( KINCAL_HLP_VIDEOCALL() );
-                }
-            else
-                {
-                contextName.Set( KINCAL_HLP_CALL_HANDLING() );
-                }
-            iViewCommandHandle->ExecuteCommandL(
-                EPhoneViewLaunchHelpApplication, 0, contextName );
-            }
-            break;
-
         default:
             commandStatus = CPhoneState::HandleCommandL( aCommand );
             break;
@@ -594,15 +594,14 @@
     if( IsVideoCall( iRingingCallId ) )
         {
         // Video call can be released only after we get response to VT Shutdown Command
-        CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( 
-                KMediatorVideoTelephonyDomain,
-                         KCatPhoneToVideotelCommands, 
-                         EVtCmdReleaseDataport,
-               TVersion( KPhoneToVideotelCmdVersionMajor,
-                         KPhoneToVideotelCmdVersionMinor, 
-                         KPhoneToVideotelCmdVersionBuild ),
-               KNullDesC8,
-               CPhoneReleaseCommand::NewL( *iStateMachine ) );
+        CPhoneMediatorFactory::Instance()->Sender()->IssueCommand( KMediatorVideoTelephonyDomain,
+                                                                             KCatPhoneToVideotelCommands, 
+                                                                             EVtCmdReleaseDataport,
+                                                                   TVersion( KPhoneToVideotelCmdVersionMajor,
+                                                                             KPhoneToVideotelCmdVersionMinor, 
+                                                                             KPhoneToVideotelCmdVersionBuild ),
+                                                                   KNullDesC8,
+                                                                   CPhoneReleaseCommand::NewL( *iStateMachine ) );
         }
     else
         {
@@ -618,18 +617,10 @@
 // CPhoneStateIncoming::OpenSoftRejectMessageEditorL
 // -----------------------------------------------------------
 //
-void CPhoneStateIncoming::OpenSoftRejectMessageEditorL()
+void CPhoneStateIncoming::OpenSoftRejectMessageL()
     {
     __LOGMETHODSTARTEND(EPhoneControl,
         "CPhoneStateIncoming::OpenSoftRejectMessageEditorL ()" );
-    // Clear the soft reject flag
-    TPhoneCmdParamBoolean softRejectParam;
-    softRejectParam.SetBoolean( EFalse );
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewSetSoftRejectFlag,
-        &softRejectParam );
-
-    // Dim silence button
-    SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent );
     
     // Silence the vibrating
     iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
@@ -663,76 +654,6 @@
         EPhoneViewOpenSoftRejectEditor, &sfiDataParam );
     }
 
-// -----------------------------------------------------------
-// CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL
-// -----------------------------------------------------------
-//
-TBool CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL() const
-    {
-    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL () ");
-    // Get the foreground application window group id
-    TPhoneCmdParamInteger foregroundAppParam;
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetForegroundApplication,
-        &foregroundAppParam );
-
-    // Get the soft reject message editor window group id
-    TPhoneCmdParamInteger softRejectMessageEditorWgId;
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewGetSoftRejectWindowGroupId,
-        &softRejectMessageEditorWgId );
-
-    __PHONELOG1(
-        EBasic,
-        EPhoneControl,
-        "CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL() SoftRejectGroupId %d",
-        softRejectMessageEditorWgId.Integer() );
-    __PHONELOG1(
-        EBasic,
-        EPhoneControl,
-        "CPhoneStateIncoming::SoftRejectMessageEditorIsDisplayedL() ForegroundAppGroupId %d",
-        foregroundAppParam.Integer() );
-    // Return ETrue if soft reject message editor is displayed
-    return softRejectMessageEditorWgId.Integer() == foregroundAppParam.Integer();
-    }
-
-// -----------------------------------------------------------
-// CPhoneStateIncoming::OpenMenuBarL
-// -----------------------------------------------------------
-//
-void CPhoneStateIncoming::OpenMenuBarL()
-    {
-    __LOGMETHODSTARTEND(EPhoneControl,
-        "CPhoneStateIncoming::OpenMenuBarL ()" );
-    TInt resourceId;
-
-    // Determine the correct menu bar to display
-    if ( CPhoneState::IsNumberEntryVisibleL() )
-        {
-        resourceId = GetNumberEntryVisibleMenuBar();
-        }
-    else
-        {
-        resourceId = GetNumberEntryNotVisibleMenuBar();
-        }
-
-    // Silence the ringer. And stop vibrating, if it is active.
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewStopRingTone );
-    iStateMachine->SendPhoneEngineMessage(
-        MPEPhoneModel::EPEMessageStopTonePlay );
-
-    //Set correct cba
-    HandleAudioPlayStoppedL();
-    
-    // Dim button
-    SetTouchPaneButtonDisabled( EPhoneCallComingCmdSilent );
-
-    // Open the menu bar
-    TPhoneCmdParamInteger integerParam;
-    integerParam.SetInteger(
-        CPhoneMainResourceResolver::Instance()->
-        ResolveResourceID( resourceId ) );
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuBarOpen,
-        &integerParam );
-    }
 
 // -----------------------------------------------------------
 // CPhoneStateIncoming::GetNumberEntryVisibleMenuBar
@@ -767,39 +688,6 @@
     }
 
 // -----------------------------------------------------------
-// CPhoneStateIncoming::DynInitMenuPaneL
-// -----------------------------------------------------------
-//
-EXPORT_C void CPhoneStateIncoming::DynInitMenuPaneL(
-    TInt aResourceId,
-    CEikMenuPane* aMenuPane )
-    {
-    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIncoming::DynInitMenuPaneL() ");
-    __ASSERT_DEBUG( aMenuPane && aResourceId,
-        Panic( EPhoneCtrlParameterNotInitialized ) );
-
-    // Save the number of digits in the number entry before processing
-    // the menu pane
-    if ( IsNumberEntryUsedL() )
-        {
-        TPhoneCmdParamBoolean serviceCodeParam;
-        serviceCodeParam.SetBoolean( ETrue );
-        iViewCommandHandle->ExecuteCommandL( EPhoneViewSetServiceCodeFlag,
-            &serviceCodeParam );
-        }
-
-    if ( iCustomization )
-        {
-        iCustomization->CustomizeMenuPaneL(aResourceId, aMenuPane);
-        }
-    // Process the menu pane
-    TPhoneCmdParamDynMenu dynMenuPane;
-    dynMenuPane.SetResourceId( aResourceId );
-    dynMenuPane.SetDynMenu( aMenuPane );
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewMenuPane, &dynMenuPane );
-    }
-
-// -----------------------------------------------------------
 // CPhoneStateIncoming::ShowDisconnectingL
 // -----------------------------------------------------------
 //
@@ -820,4 +708,33 @@
         &callHeaderParam );
     }
 
+// ---------------------------------------------------------
+// CPhoneStateIncoming::HandleKeyLockEnabledL
+// ---------------------------------------------------------
+//
+EXPORT_C void CPhoneStateIncoming::HandleKeyLockEnabled( TBool aKeylockEnabled )
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneStateIncoming::HandleKeyLockEnabledL( ) ");
+    if( !FeatureManager::FeatureSupported( KFeatureIdFfTouchUnlockStroke )
+        && CPhoneCenRepProxy::Instance()->
+            IsTelephonyFeatureSupported( KTelephonyLVFlagDisableCallControlHardKeysWhileLocked ) )
+        {
+        if( aKeylockEnabled )
+            {
+            // Keylock enabled
+            if( iStateMachine->PhoneStorage()->IsBlockedKeysListEmpty() )
+                {
+                // Disable HW Keys if needed
+                DisableHWKeysL();
+                }
+            }
+        else
+            {
+            // Keylock disabled
+            // Reset blocked keys list
+            iStateMachine->PhoneStorage()->ResetBlockedKeysList();
+            }
+        }
+    }
+
 // End of File