Revision: 201017 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 11 May 2010 16:13:03 +0300
branchRCL_3
changeset 31 ba54057fe027
parent 25 91c2fb4b78df
child 33 367ca2321732
child 34 b68fcd923911
Revision: 201017 Kit: 201019
phoneapp/phoneuicontrol/bwins/phoneuicontrolu.def
phoneapp/phoneuicontrol/eabi/phoneuicontrolu.def
phoneapp/phoneuicontrol/group/phoneuicontrol.mmp
phoneapp/phoneuicontrol/inc/cphonekeyeventforwarder.h
phoneapp/phoneuicontrol/inc/cphonestate.h
phoneapp/phoneuicontrol/src/cphonecbamanager.cpp
phoneapp/phoneuicontrol/src/cphonekeyeventforwarder.cpp
phoneapp/phoneuicontrol/src/cphonesecuritymodeobserver.cpp
phoneapp/phoneuicontrol/src/cphonestate.cpp
phoneapp/phoneuicontrol/src/cphonestateincall.cpp
phoneapp/phoneuistates/bwins/phoneuistatesu.def
phoneapp/phoneuistates/src/cphoneemergency.cpp
phoneapp/phoneuistates/src/cphoneerrormessageshandler.cpp
phoneapp/phoneuiview/inc/cphoneincallindicator.h
phoneapp/phoneuiview/inc/cphonetoolbarcontroller.h
phoneapp/phoneuiview/inc/cphoneview.h
phoneapp/phoneuiview/inc/cphoneviewcontroller.h
phoneapp/phoneuiview/inc/mphoneviewcontrollerobserver.h
phoneapp/phoneuiview/src/cphonedialercontroller.cpp
phoneapp/phoneuiview/src/cphoneincallindicator.cpp
phoneapp/phoneuiview/src/cphonemenucontroller.cpp
phoneapp/phoneuiview/src/cphonetoolbarcontroller.cpp
phoneapp/phoneuiview/src/cphoneview.cpp
phoneapp/phoneuiview/src/cphoneviewcontroller.cpp
phoneapp/phoneuivoipextension/inc/cphonecustomizationvoip.h
phoneapp/phoneuivoipextension/src/cphonecustomizationvoip.cpp
phoneapp/phoneuivoipextension/src/cphonestatesinglevoip.cpp
phoneengine/PhoneCntFinder/ContactService/inc/CPhCntContactManager.h
phoneengine/PhoneCntFinder/ContactService/src/CPhCntContactManager.cpp
phoneengine/PhoneCntFinder/ContactService/src/cphcntstoreloaderimpl.cpp
phoneengine/loghandling/inc/cpelogevent.h
phoneengine/loghandling/src/cpelogevent.cpp
phoneuis/dialer/group/dialer.mmp
phoneuis/dialer/group/dialerstub.mmp
phoneuis/dialer/inc/cdialer.h
phoneuis/dialer/src/cdialer.cpp
phoneuis/dialer/src/cdialerkeypadcontainer.cpp
phoneuis/dialer/src/cdialerstub.cpp
--- a/phoneapp/phoneuicontrol/bwins/phoneuicontrolu.def	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuicontrol/bwins/phoneuicontrolu.def	Tue May 11 16:13:03 2010 +0300
@@ -236,4 +236,5 @@
 	??0CPhoneStateMachine@@IAE@PAVMPhoneViewCommandHandle@@@Z @ 235 NONAME ; CPhoneStateMachine::CPhoneStateMachine(class MPhoneViewCommandHandle *)
 	??1CPhoneStateStartup@@UAE@XZ @ 236 NONAME ; CPhoneStateStartup::~CPhoneStateStartup(void)
 	?HandleKeyMessageL@CPhoneState@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 237 NONAME ; void CPhoneState::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
+	?ForwardPEMessageToPhoneCustomizationL@CPhoneState@@IAEHHH@Z @ 238 NONAME ; int CPhoneState::ForwardPEMessageToPhoneCustomizationL(int, int)
 
--- a/phoneapp/phoneuicontrol/eabi/phoneuicontrolu.def	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuicontrol/eabi/phoneuicontrolu.def	Tue May 11 16:13:03 2010 +0300
@@ -468,4 +468,5 @@
 	_ZThn8_N20CPhoneStateCallSetupD0Ev @ 467 NONAME
 	_ZThn8_N20CPhoneStateCallSetupD1Ev @ 468 NONAME
 	_ZThn8_NK11CPhoneState17IsMenuBarVisibleLEv @ 469 NONAME
+	_ZN11CPhoneState37ForwardPEMessageToPhoneCustomizationLEii @ 470 NONAME
 
--- a/phoneapp/phoneuicontrol/group/phoneuicontrol.mmp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuicontrol/group/phoneuicontrol.mmp	Tue May 11 16:13:03 2010 +0300
@@ -80,6 +80,7 @@
 LIBRARY         connmon.lib // RConnectionMonitor
 LIBRARY         avkon.lib // AknTextUtils
 LIBRARY         ProfileEngine.lib
+LIBRARY         hal.lib
 
 // RemCon
 LIBRARY         remconcoreapi.lib
--- a/phoneapp/phoneuicontrol/inc/cphonekeyeventforwarder.h	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuicontrol/inc/cphonekeyeventforwarder.h	Tue May 11 16:13:03 2010 +0300
@@ -245,26 +245,32 @@
          */
         TInt iScanCode;
 
-        /*
+        /**
         * Has information of used qwerty keyboard.
         * Own.
         */
         CPhoneQwertyHandler* iQwertyHandler;
         
-        /*
+        /**
          * Time of the previous key press. Used for multitap behaviour.
          */
         TTime iPreviousKeyPressTime;
         
-        /*
+        /**
          * Keycode of the previous keypress. Used for multitap behaviour.
          */
         TInt iPreviousScanCode;
         
-        /*
+        /**
          * Points to next character in multitap character list.
          */
         TInt iMultitapIndex;
+        
+        /**
+         * True if there has been a key event but not a closing key up event.
+         * Needed to detect situations where key up event is handled before key event.
+         */
+        TBool iExpectKeyUpEvent;
     };
 
 #endif      // CPHONEKEYEVENTFORWARDER_H
--- a/phoneapp/phoneuicontrol/inc/cphonestate.h	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuicontrol/inc/cphonestate.h	Tue May 11 16:13:03 2010 +0300
@@ -725,6 +725,15 @@
         */
         IMPORT_C TInt CustomizedDialerCbaResourceIdL();
         
+        /**
+        * Forwards Phone Engine messages to Phone customization
+        * @param aMessage Message from Phone Engine
+        * @param aCallId Call id the message concerns
+        * @return ETrue if message was handled
+        */
+        IMPORT_C TBool ForwardPEMessageToPhoneCustomizationL(
+            const TInt aMessage,
+            TInt aCallId );
 
     protected: // NumberEntry functions.
 
--- a/phoneapp/phoneuicontrol/src/cphonecbamanager.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuicontrol/src/cphonecbamanager.cpp	Tue May 11 16:13:03 2010 +0300
@@ -296,10 +296,14 @@
 
     else
         {
-        if ( securityMode )
-        	{
-        	incomingCbaResourceId = EPhoneCallHandlingIncomingRejectCBA;
-        	}
+        if ( securityMode && callIsAlerting )
+            {
+            incomingCbaResourceId = GetIncomingCallSilenceCBA( softRejectActivated );
+            }
+        else if ( securityMode )
+            {
+            incomingCbaResourceId = EPhoneCallHandlingIncomingRejectCBA;
+            }
         else if ( callIsAlerting )
             {
             incomingCbaResourceId = GetIncomingCallSilenceCBA( softRejectActivated );
@@ -461,9 +465,9 @@
                              ResolveResourceID( EPhoneIncomingCallButtons ) );
 
     if ( iStateMachine.SecurityMode()->IsSecurityMode() )
-    	{
-    	ret = EPhoneCallHandlingIncomingRejectCBA;
-    	}
+        {
+        ret = EPhoneCallHandlingIncomingCBA;
+        }
     else if ( touchpaneButtonsParam.Integer() 
          == R_PHONEUI_INCOMING_CALL_SILENCE_BUTTONS )
         {
--- a/phoneapp/phoneuicontrol/src/cphonekeyeventforwarder.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuicontrol/src/cphonekeyeventforwarder.cpp	Tue May 11 16:13:03 2010 +0300
@@ -141,6 +141,9 @@
         "CPhoneKeyEventForwarder::OfferKeyEventL");
 
     TKeyResponse ret( EKeyWasNotConsumed );
+    
+    // After event key, expect to have key up event.
+    iExpectKeyUpEvent = ( aType == EEventKey );
 
     ret = OfferKeyEventBeforeControlStackL( aKeyEvent, aType );
 
@@ -150,8 +153,16 @@
         TKeyEvent keyEvent = aKeyEvent;
         keyEvent.iCode = iKeyPressedDown;
         
-        // Start and stop dtmf
-        iStateMachine->State()->HandleDtmfKeyToneL( keyEvent, aType );
+        // Do not handle dtmf tone if the type is EEventKey but we are not
+        // expecting key up event. This happens if the key up event has been
+        // handled by some CActiveSchedulerWait object somewhere in the execution 
+        // of function OfferKeyEventBeforeControlStackL.
+        if ( iExpectKeyUpEvent || aType != EEventKey )
+            {
+            // Start and stop dtmf
+            iStateMachine->State()->HandleDtmfKeyToneL( keyEvent, aType );
+            }
+        
         // Open number entry view if any allowed character key
         // is pressed on homescreen or in-call ui
         if ( aType != EEventKeyUp && IsKeyAllowed( keyEvent ) )
@@ -434,12 +445,27 @@
         {
         iLongPressKeyEventTimer->CancelTimer();
         }
+    
+    // Don't initiate long tap timer if all these are true 
+    // a) key event is not from virtual dialer
+    // b) device is in qwerty mode
+    // c) phone number editor is alpha mode, i.e. not in numeric mode
+    // This is to prevent phone app's long tap functionality with qwerty 
+    // long presses, and to have the normal editor long press behaviour 
+    // instead.
+    TBool preventLongTap = 
+            !IsKeySimulatedByTouchDialer( aKeyEvent ) && 
+            iQwertyHandler->IsQwertyInput() &&
+            iViewCommandHandle->HandleCommandL( EPhoneViewIsNumberEntryNumericMode ) != EPhoneViewResponseSuccess;
 
-    // Re-start the timer
-    iLongPressKeyEventTimer->After(
-        KPhoneLongPressKeyEventDuration,
-        TCallBack( DoHandleLongPressKeyEventCallbackL,
-        this ) );
+    if ( !preventLongTap ) 
+        {
+        // Start long press timer
+        iLongPressKeyEventTimer->After(
+            KPhoneLongPressKeyEventDuration,
+            TCallBack( DoHandleLongPressKeyEventCallbackL,
+            this ) );
+        }
 
     return ( EKeyWasNotConsumed );
     }
@@ -499,20 +525,6 @@
             }
         }
     
-    // Prevent repeats of DTMF keys anyway
-    if ( response == EKeyWasNotConsumed )
-        {
-        // Convert event.
-        keyEvent.iCode = iKeyPressedDown;
-        if ( aKeyEvent.iRepeats > 0 &&
-             aKeyEvent.iCode != EKeyF18 &&   // EKeyF18 is used for AknCCPU support
-             CPhoneKeys::IsDtmfTone( keyEvent, EEventKey ) )
-            {
-            // Do not repeat dtmf characters
-            response = EKeyWasConsumed;
-            }
-        }
-
     return response;
     }
 
@@ -657,6 +669,7 @@
             switch ( aKeyEvent.iScanCode )
                 {
                 case EStdKeyEnter:
+                case EStdKeyNkpEnter:
                     aCode = EKeyEnter;
                     break;
                 case EStdKeyYes:
--- a/phoneapp/phoneuicontrol/src/cphonesecuritymodeobserver.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuicontrol/src/cphonesecuritymodeobserver.cpp	Tue May 11 16:13:03 2010 +0300
@@ -205,7 +205,8 @@
 	iSimState( ESimSecurityStatusUninitialized ),
 	iEngineCurrentSimState( EPESimStatusUninitialized ),
 	iEnginePreviousSimState(EPESimStatusUninitialized ),
-	iDeviceLockState( EAutolockStatusUninitialized )
+	iDeviceLockState( EAutolockStatusUninitialized ),
+    iSecurityMode( ETrue )
 	{
 	
 	}
--- a/phoneapp/phoneuicontrol/src/cphonestate.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuicontrol/src/cphonestate.cpp	Tue May 11 16:13:03 2010 +0300
@@ -55,6 +55,7 @@
 #include <textresolver.h>
 #include <phoneappvoipcommands.hrh>
 #include <hwrmdomainpskeys.h>
+#include <hal.h>
 
 #include "phoneui.pan"
 #include "cphonestate.h"
@@ -257,12 +258,7 @@
 
         case MEngineMonitor::EPEMessageCallSecureStatusChanged:
             HandleCallSecureStatusChangeL( aCallId );
-
-            if ( iCustomization )
-                {
-                iCustomization->HandlePhoneEngineMessageL( aMessage,
-                    aCallId );
-                }
+            ForwardPEMessageToPhoneCustomizationL( aMessage, aCallId );
             break;
 
         case MEngineMonitor::EPEMessageActivateWarrantyMode:
@@ -380,11 +376,7 @@
 
             TBool handled( EFalse );
 
-            if ( iCustomization )
-                {
-                handled = iCustomization->HandlePhoneEngineMessageL(
-                                aMessage, aCallId );
-                }
+            handled = ForwardPEMessageToPhoneCustomizationL( aMessage, aCallId );
 
             if ( EFalse == handled )
                 {
@@ -843,28 +835,39 @@
 void CPhoneState::HandleChangedCallDurationL( TInt aCallId )
     {
      __LOGMETHODSTARTEND(EPhoneControl, "CPhoneState::HandleChangedCallDurationL() ");
-    // Get the call duration
-    TTime time( 0 );
-    TTimeIntervalSeconds timeInterval =
-        iStateMachine->PhoneEngineInfo()->CallDuration( aCallId );
-    time += timeInterval;
-
-    // Read format string from AVKON resource
-    TBuf<KPhoneMaxCharsInNote> timeDurationFormatString( KNullDesC );
-    LoadResource( timeDurationFormatString, EPhoneCallDurationFormatString );
-
-    // Format the time
-    TBuf<KPhoneMaxTimeDisplayTextLength> timeString( KNullDesC );
-    time.FormatL( timeString, timeDurationFormatString );
-
-    // Localize time format
-    AknTextUtils::LanguageSpecificNumberConversion( timeString );
-
-    // update the call header call duration
-    iViewCommandHandle->ExecuteCommandL(
-        EPhoneViewUpdateCallHeaderCallDuration,
-        aCallId,
-        timeString );
+    
+    TInt ret = KErrNone;
+    TInt isDisplayOn;
+    
+    ret = HAL::Get( HALData::EDisplayState, isDisplayOn );
+    
+    // Update only if the display is on or if HAL::Get returns an error, 
+    // in which case display value cannot be trusted.
+    if ( ret || isDisplayOn )
+        {
+        // Get the call duration
+        TTime time( 0 );
+        TTimeIntervalSeconds timeInterval =
+            iStateMachine->PhoneEngineInfo()->CallDuration( aCallId );
+        time += timeInterval;
+        
+        // Read format string from AVKON resource
+        TBuf<KPhoneMaxCharsInNote> timeDurationFormatString( KNullDesC );
+        LoadResource( timeDurationFormatString, EPhoneCallDurationFormatString );
+        
+        // Format the time
+        TBuf<KPhoneMaxTimeDisplayTextLength> timeString( KNullDesC );
+        time.FormatL( timeString, timeDurationFormatString );
+        
+        // Localize time format
+        AknTextUtils::LanguageSpecificNumberConversion( timeString );
+        
+        // update the call header call duration
+        iViewCommandHandle->ExecuteCommandL(
+            EPhoneViewUpdateCallHeaderCallDuration,
+            aCallId,
+            timeString );
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -4724,8 +4727,8 @@
         {
         TPhoneCmdParamInteger integerParam;
         integerParam.SetInteger( EPhoneInCallCmdActivateIhf );
-        TRAP_IGNORE( iViewCommandHandle->ExecuteCommandL(
-            EPhoneViewEnableToolbarButton, &integerParam ));
+        iViewCommandHandle->ExecuteCommand(
+            EPhoneViewEnableToolbarButton, &integerParam );
         }
     }
 
@@ -4778,5 +4781,25 @@
         }
     }
 
+// -----------------------------------------------------------
+// CPhoneState::ForwardPEMessageToPhoneCustomizationL
+// Forward Phone Engine messages to Phone customization
+// (other items were commented in a header).
+// -----------------------------------------------------------
+//
+EXPORT_C TBool CPhoneState::ForwardPEMessageToPhoneCustomizationL(
+    const TInt aMessage,
+    TInt aCallId )
+    {
+    __LOGMETHODSTARTEND( EPhoneControl, "CPhoneState::ForwardPEMessageToPhoneCustomizationL() " );
+    TBool handled = EFalse;
+    
+    if ( iCustomization )
+       {
+       handled = iCustomization->HandlePhoneEngineMessageL( aMessage, aCallId );
+       }
+    return handled;
+    }
+
 //  End of File
 
--- a/phoneapp/phoneuicontrol/src/cphonestateincall.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuicontrol/src/cphonestateincall.cpp	Tue May 11 16:13:03 2010 +0300
@@ -191,6 +191,8 @@
         {
         case MEngineMonitor::EPEMessageIdle:
             HandleIdleL( aCallId );
+            // Forward idle message to phone customization 
+            CPhoneState::ForwardPEMessageToPhoneCustomizationL( aMessage, aCallId );
             break;
 
         case MEngineMonitor::EPEMessageAudioMuteChanged:
--- a/phoneapp/phoneuistates/bwins/phoneuistatesu.def	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuistates/bwins/phoneuistatesu.def	Tue May 11 16:13:03 2010 +0300
@@ -1,6 +1,6 @@
 EXPORTS
-	?ConstructL@CPhoneTwoSingles@@MAEXXZ @ 1 NONAME ; void CPhoneTwoSingles::ConstructL(void)
-	?NewPhoneUIStateMachineFactoryL@@YAPAVCPhoneUIStateMachineFactoryBase@@XZ @ 2 NONAME ; class CPhoneUIStateMachineFactoryBase * NewPhoneUIStateMachineFactoryL(void)
+	?NewPhoneUIStateMachineFactoryL@@YAPAVCPhoneUIStateMachineFactoryBase@@XZ @ 1 NONAME ; class CPhoneUIStateMachineFactoryBase * NewPhoneUIStateMachineFactoryL(void)
+	?ConstructL@CPhoneTwoSingles@@MAEXXZ @ 2 NONAME ; void CPhoneTwoSingles::ConstructL(void)
 	?SendGlobalErrorNoteL@CPhoneErrorMessagesHandler@@IAEXH@Z @ 3 NONAME ; void CPhoneErrorMessagesHandler::SendGlobalErrorNoteL(int)
 	?HandleKeyMessageL@CPhoneAlerting@@MAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 4 NONAME ; void CPhoneAlerting::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
 	?HandleKeyMessageL@CPhoneTwoSingles@@UAEXW4TPhoneKeyEventMessages@MPhoneKeyEvents@@W4TKeyCode@@@Z @ 5 NONAME ; void CPhoneTwoSingles::HandleKeyMessageL(enum MPhoneKeyEvents::TPhoneKeyEventMessages, enum TKeyCode)
--- a/phoneapp/phoneuistates/src/cphoneemergency.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuistates/src/cphoneemergency.cpp	Tue May 11 16:13:03 2010 +0300
@@ -185,10 +185,7 @@
             break;
             
         case MEngineMonitor::EPEMessageColpNumberAvailable:
-            {
             //Don't show COLP note during emergency call.
-            return;                    
-            }
             break; 
 
         default:
@@ -240,6 +237,8 @@
                 // Continue displaying current app but set up the
                 // idle screen in the background
                 SetupIdleScreenInBackgroundL();
+                // Update toolbar
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateToolbar );
                 }
 
             else if ( iOnScreenDialer && IsNumberEntryContentStored() )
@@ -257,6 +256,8 @@
                 {
                 // Show the number entry if it exists
                 SetNumberEntryVisibilityL(ETrue);
+                // Update toolbar
+                iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateToolbar );
                 }
 
             else
@@ -380,6 +381,8 @@
 
         SetTouchPaneButtons( EPhoneEmergencyCallButtons );
 
+        SetToolbarDimming( ETrue );
+
         ShowNoteL( EPhoneEmergencyConnectWaitNote );
 
         UpdateSetupCbaL();
@@ -454,9 +457,6 @@
 
     EndUiUpdate();
 
-    //Make sure that toolbar is not shown
-    iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
-
     UpdateInCallCbaL();
     }
 
@@ -479,6 +479,7 @@
         &emergencyHeaderParam );
 
     EndUiUpdate();
+    SetToolbarDimming( ETrue );
     UpdateInCallCbaL();
     }
 
--- a/phoneapp/phoneuistates/src/cphoneerrormessageshandler.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuistates/src/cphoneerrormessageshandler.cpp	Tue May 11 16:13:03 2010 +0300
@@ -395,7 +395,7 @@
         case ECCPErrorNoAnswerForVideo:
             if( IsVideoCall( aErrorInfo.iCallId ) )
                 {
-                SendGlobalInfoNoteL( EPhoneNotePhoneOutOf3GCoverage );   
+                SendGlobalInfoNoteL( EPhoneNoteCallInfoCauseValue16 );   
                 }
             else
                 {
--- a/phoneapp/phoneuiview/inc/cphoneincallindicator.h	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuiview/inc/cphoneincallindicator.h	Tue May 11 16:13:03 2010 +0300
@@ -67,12 +67,6 @@
         * @param aCommandParam command parameter
         */
         void HandleCipheringChange( TPhoneCommandParam* aCommandParam );
-        
-        
-        /**
-        * return is emergency call active
-        */
-        TBool IsEmergencyCall();
 
     private:
 
--- a/phoneapp/phoneuiview/inc/cphonetoolbarcontroller.h	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuiview/inc/cphonetoolbarcontroller.h	Tue May 11 16:13:03 2010 +0300
@@ -180,6 +180,9 @@
     
     TBool iCallInProgress;
 
+    // Dim activate IHF button
+    TBool iDimActivateIhf;
+    
     };
 
 #endif // CPHONETOOLBARCONTROLLER_H
--- a/phoneapp/phoneuiview/inc/cphoneview.h	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuiview/inc/cphoneview.h	Tue May 11 16:13:03 2010 +0300
@@ -28,6 +28,7 @@
 class TPhoneCommandParam;
 class CEikButtonGroupContainer;
 class MPhoneViewObserver;
+class MPhoneViewControllerObserver;
 
 // CLASS DECLARATION
 
@@ -38,7 +39,7 @@
     {
     public:  // Constructors and destructor        
 
-        static CPhoneView* NewL( TRect aRect, CEikButtonGroupContainer& aCba );
+        static CPhoneView* NewL( TRect aRect, CEikButtonGroupContainer& aCba, MPhoneViewControllerObserver* aViewController );
 
         virtual ~CPhoneView();
 
@@ -208,7 +209,7 @@
 
     private:
 
-        CPhoneView( CEikButtonGroupContainer& aCba );
+        CPhoneView( CEikButtonGroupContainer& aCba, MPhoneViewControllerObserver* aViewController );
 
         void ConstructL( TRect aRect );
 
@@ -255,7 +256,9 @@
         
         MPhoneViewObserver* iObserver;
         
-        TBool iDialerActivation;
+        TBool iDialerActivation;       
+        
+        MPhoneViewControllerObserver* iViewControllerObserver;
         };
 
 #endif // __CPHONEVIEW_H
--- a/phoneapp/phoneuiview/inc/cphoneviewcontroller.h	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuiview/inc/cphoneviewcontroller.h	Tue May 11 16:13:03 2010 +0300
@@ -36,6 +36,8 @@
 #include "mnumberentry.h"
 #include "mphonesecuritymodechangeobserver.h"
 
+#include "mphoneviewcontrollerobserver.h"
+
 // FORWARD DECLARATIONS
 class CPhoneButtonsController;
 class CLogsClient;
@@ -79,6 +81,7 @@
 class MPhoneViewCustomization;
 class CPhoneEasyDialingController;
 class CPhoneDtmfDialerController;
+class CAknIncallBubble;
 
 class CPhoneViewController :
     public CBase,
@@ -86,7 +89,8 @@
     public MPhoneStatusPaneObserver,
     public MPhoneViewBlockingDialogObserver,
     public MNumberEntryObserver,
-	public MPhoneSecurityModeChangeObserver
+	public MPhoneSecurityModeChangeObserver,
+	public MPhoneViewControllerObserver
     {
     public:  // Constructors and destructor
 
@@ -259,6 +263,16 @@
 // From MPhoneSecurityModeChangeObserver
 
 		IMPORT_C void HandleSecurityModeChanged( TBool aIsEnabled );
+		
+		/**
+        * Sets incall small bubble´s visibility in special cases.
+        */ 
+		void AllowInCallBubbleInSpecialCases();
+		
+		/**
+        * Sets value for incall bubble visibility.
+        */ 
+		void SetIncallBubbleVisibility( TBool aIncallBubbleVisible );
 
     private:     // New functions
 
@@ -796,6 +810,8 @@
         // Boolean flag. ETrue if the application needs to return
         // to the foreground after call ended
         TBool iNeedToReturnToForegroundAppAfterCall;
+        
+        CAknIncallBubble* iIncallBubble;
     };
 
 #endif // CPHONEVIEWCONTROLLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneapp/phoneuiview/inc/mphoneviewcontrollerobserver.h	Tue May 11 16:13:03 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2005 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  View command handle
+*
+*/
+
+#ifndef MPHONEVIEWCONTROLLEROBSERVER_H_
+#define MPHONEVIEWCONTROLLEROBSERVER_H_
+
+// INCLUDES
+
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  MPhoneViewControllerObserver class
+*
+*  @lib phoneuiview.lib
+*/
+class MPhoneViewControllerObserver
+    {
+    public:
+    /**
+    * Sets incall small bubble´s visibility in special cases.
+    */
+    virtual void AllowInCallBubbleInSpecialCases() = 0;
+	 
+    /**
+    * Sets Incall bubble´s visibility.
+    */   
+    virtual void SetIncallBubbleVisibility( TBool aIncallBubbleVisible ) = 0;
+    };
+
+#endif /* MPHONEVIEWCONTROLLEROBSERVER_H_ */
--- a/phoneapp/phoneuiview/src/cphonedialercontroller.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuiview/src/cphonedialercontroller.cpp	Tue May 11 16:13:03 2010 +0300
@@ -149,7 +149,8 @@
                                         CPhoneBubbleWrapper* aBubbleWrapper,
                                         CCoeEnv& aCoeEnv ):
     iCoeEnv( aCoeEnv ),
-    iBubbleWrapper( aBubbleWrapper )
+    iBubbleWrapper( aBubbleWrapper ),
+    iRestrictedDialer( ETrue )
     {
     }
 
--- a/phoneapp/phoneuiview/src/cphoneincallindicator.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuiview/src/cphoneincallindicator.cpp	Tue May 11 16:13:03 2010 +0300
@@ -307,14 +307,5 @@
     return KErrNone;
     }
 
-// ---------------------------------------------------------
-// CPhoneIncallIndicator::IsEmergencyCall
-// ---------------------------------------------------------
-//
-TBool CPhoneIncallIndicator::IsEmergencyCall()
-    {
-    return iEmergency;
-    }
-
 //  End of File  
 
--- a/phoneapp/phoneuiview/src/cphonemenucontroller.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuiview/src/cphonemenucontroller.cpp	Tue May 11 16:13:03 2010 +0300
@@ -56,6 +56,7 @@
 CPhoneMenuController::CPhoneMenuController( CEikonEnv& aEikEnv ): 
     iMenuResourceId( 0 ),
     iOkMenuResourceId( 0 ),
+    iSecurityMode( ETrue ),
     iEikEnv( aEikEnv )
     {
     }
@@ -227,6 +228,13 @@
         {
         switch( menuItemArray[ i ] )
             {
+            case EPhoneDialerCallSettings:
+                if ( iSecurityMode )
+                    {
+                    menuPane->DeleteMenuItem( menuItemArray[ i ] );
+                    }
+                break;
+
             case EPhoneInCallCmdAnswer:
                 if ( iConferenceAndWaitingVideoFlag )
                     {
@@ -470,8 +478,8 @@
 
             case EPhoneDialerCallHandling:
                 {
-                // no active call
-                if ( onScreenDialer && !iCallInProgress )
+                // no active call or security mode
+                if ( ( onScreenDialer && !iCallInProgress ) || iSecurityMode )
                     {
                     menuPane->DeleteMenuItem( menuItemArray[i] );                    
                     }                
--- a/phoneapp/phoneuiview/src/cphonetoolbarcontroller.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuiview/src/cphonetoolbarcontroller.cpp	Tue May 11 16:13:03 2010 +0300
@@ -131,7 +131,6 @@
             CleanupStack::Pop( button );
             CleanupStack::PopAndDestroy( tooltipText );
             }
-        TRAP_IGNORE(iToolbar->DisableToolbarL( ETrue ));
         }
     }
     
@@ -395,7 +394,17 @@
         iWiredAccFlag = accFlag->Boolean();        
         if ( iCallInProgress ) 
             {
-            SetToolbarButtonDimmed( EPhoneInCallCmdActivateIhf, iWiredAccFlag );
+            if ( iWiredAccFlag )
+                {
+                // Dim toolbar button 
+                iToolbar->SetItemDimmed( EPhoneInCallCmdActivateIhf, ETrue, ETrue );
+                }
+            else if ( !iDimActivateIhf )
+                {
+                // Don't undim ActivateIhf button, if it was intended to be dimmed all the time
+                iToolbar->SetItemDimmed( EPhoneInCallCmdActivateIhf, EFalse, ETrue );
+                }
+            
             UpdateToolbar(); 
             }
         }
@@ -452,6 +461,7 @@
         {
         iToolbar->SetItemDimmed( EPhoneInCallCmdActivateIhf, aDimmed, ETrue );
         }
+    iDimActivateIhf = aDimmed;
     }
 
 // ---------------------------------------------------------
@@ -462,8 +472,28 @@
     {
  // __LOGMETHODSTARTEND( EPhoneUIView, "CPhoneToolbarController::SetToolbarButtonDimmed()" );
 
-    // Dim toolbar button 
-    iToolbar->SetItemDimmed( aCommandId, aDimmed, ETrue );
+    if ( aCommandId == EPhoneInCallCmdActivateIhf ) 
+        {
+        if ( aDimmed )
+            {
+            // Dim toolbar button 
+            iToolbar->SetItemDimmed( aCommandId, aDimmed, ETrue );
+            }
+        else
+            {
+            // Don't undim IHF if wired acc is connected. 
+            if ( !iWiredAccFlag )
+                {
+                iToolbar->SetItemDimmed( aCommandId, aDimmed, ETrue );
+                }
+            }
+        iDimActivateIhf = aDimmed;
+        }
+    else
+        {
+        // Dim/undim toolbar button 
+        iToolbar->SetItemDimmed( aCommandId, aDimmed, ETrue );
+        }
     }
 
 // END
--- a/phoneapp/phoneuiview/src/cphoneview.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuiview/src/cphoneview.cpp	Tue May 11 16:13:03 2010 +0300
@@ -38,7 +38,8 @@
 #include "cphonestatuspane.h"
 #include "tphonecmdparambitmap.h"
 #include "phonelogger.h"
-#include "mphoneviewobserver.h" 
+#include "mphoneviewobserver.h"
+#include "mphoneviewcontrollerobserver.h"
 
 #include <AknUtils.h> // needed for AKN_LAF_COLOR in 3.0 environment
 
@@ -65,8 +66,10 @@
 // might leave.
 // -----------------------------------------------------------------------------
 //
-CPhoneView::CPhoneView( CEikButtonGroupContainer& aCba ) :
-    iCba ( aCba )
+CPhoneView::CPhoneView( CEikButtonGroupContainer& aCba, MPhoneViewControllerObserver* aViewController ) :
+    iSecurityMode( ETrue ),
+    iCba ( aCba ),
+    iViewControllerObserver ( aViewController )
     {
     }
 
@@ -97,9 +100,9 @@
 // Two-phased constructor.
 // -----------------------------------------------------------------------------
 //
-CPhoneView* CPhoneView::NewL( TRect aRect, CEikButtonGroupContainer& aCba )
+CPhoneView* CPhoneView::NewL( TRect aRect, CEikButtonGroupContainer& aCba, MPhoneViewControllerObserver* aViewController )
     {
-    CPhoneView* self = new ( ELeave ) CPhoneView( aCba );
+    CPhoneView* self = new ( ELeave ) CPhoneView( aCba, aViewController );
     
     CleanupStack::PushL( self );
     self->ConstructL( aRect );
@@ -138,6 +141,9 @@
     const TDesC8& /*aCustomMessage*/ )
     {
     __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::ViewActivatedL()");
+
+    iViewControllerObserver->AllowInCallBubbleInSpecialCases();
+    
     switch ( aCustomMessageId.iUid )
         {
         case KTouchDiallerViewCommand:
@@ -186,7 +192,7 @@
     {
     __LOGMETHODSTARTEND(EPhoneUIView, "CPhoneView::ViewDeactivated()");
     SetActivatePreviousApp( EFalse );
-  
+    iViewControllerObserver->SetIncallBubbleVisibility( EFalse );
     DrawDeferred();
     }
 
--- a/phoneapp/phoneuiview/src/cphoneviewcontroller.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuiview/src/cphoneviewcontroller.cpp	Tue May 11 16:13:03 2010 +0300
@@ -135,6 +135,7 @@
 
 #include <dialingextensioninterface.h>
 #include <easydialingcommands.hrh>
+#include <AknIncallBubbleNotify.h>
 
 // Kastor effect IDs, aknskincontent/101f84b9.sel
 // These effects cannot be used for internal transitions (Call UI<->Dialer)
@@ -151,7 +152,6 @@
 //
 CPhoneViewController::CPhoneViewController() :
     iEikEnv( *CEikonEnv::Static() ),
-    iNeedToReturnToForegroundAppAfterCall( EFalse ),
     iHelpCommand( KINCAL_HLP_CALL_HANDLING ),
     iBlockingDialogIsDisplayed( EFalse ),
     iIdleUid( KErrNotFound ),
@@ -159,7 +159,9 @@
     iEffectOngoing( EFalse ),
     iSendBack( ETrue ),
     iDialerActive( EFalse ),
-    iPriotityChanged( EFalse )
+    iPriotityChanged( EFalse ),
+    iSecurityMode( ETrue ),
+    iNeedToReturnToForegroundAppAfterCall( EFalse )
     {
     }
 
@@ -180,7 +182,7 @@
     iAppui = (CAknAppUi*)iEikEnv.EikAppUi();
     iCba = iEikEnv.AppUiFactory()->Cba();
 
-	iPhoneView = CPhoneView::NewL( aRect, *iCba );
+	iPhoneView = CPhoneView::NewL( aRect, *iCba, this );
 
     iBubbleWrapper = CPhoneBubbleWrapper::NewL( iPhoneView, aRect  );
 
@@ -257,6 +259,8 @@
     // if you are using sgc-client's session to capserver,
     //you are not allowed to close the session.
     iAknUiServerClient = CAknSgcClient::AknSrv();
+    
+    iIncallBubble = CAknIncallBubble::NewL();
     }
 
 // -----------------------------------------------------------------------------
@@ -329,7 +333,8 @@
 //    delete iStatusPane; <-- CCoeStatic are destroyed outside application
 
     iApaLsSession.Close();
-
+    
+    delete iIncallBubble;
     }
 
 // ---------------------------------------------------------
@@ -3626,7 +3631,7 @@
         // need to do PushDefault for navipane and SwitchLayoutL for
         // statuspane.
         if ( currentLayout != R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ||
-             currentLayout != R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL )
+             currentLayout != R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT )
             {
             SwapEmptyIndicatorPaneInSecureStateL( ETrue );
 
@@ -3641,7 +3646,7 @@
             else
                 {
                 iStatusPane->StatusPane().SwitchLayoutL
-                ( R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL );
+                        ( R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT );
                 }
             }
         }
@@ -3651,7 +3656,7 @@
         // layout is something else there is no need to do Pop and
         // SwitchLayoutL for statuspane.
         if ( currentLayout == R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT ||
-             currentLayout == R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL )
+             currentLayout == R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT )
             {
             SwapEmptyIndicatorPaneInSecureStateL( EFalse );
             
@@ -3663,7 +3668,7 @@
             else
                 {
                 iStatusPane->StatusPane().SwitchLayoutL
-                        ( R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE );
+                        ( R_AVKON_WIDESCREEN_PANE_LAYOUT_USUAL_FLAT );
                 }
             }
         }
@@ -3775,6 +3780,8 @@
     __PHONELOG1( EBasic, EPhoneUIView,
         "CPhoneViewController::SetControltoDialerL iDialerActive (%d)", iDialerActive );
 
+    SetIncallBubbleVisibility( ETrue );
+
     if ( !iDialerActive )
         {
         iDialerActive = ETrue;
@@ -3820,11 +3827,8 @@
     __PHONELOG1( EBasic, EPhoneUIView,
         "CPhoneViewController::SetControltoCallHandlingL iDialerActive (%d)", iDialerActive );
 
-    // Do not show toolbar if emergency call is active
-    if ( !iIncallIndicator->IsEmergencyCall() )
-        {
-        iToolbarController->ShowToolbar();
-        }
+    SetIncallBubbleVisibility( EFalse );
+    iToolbarController->ShowToolbar();
     if ( iDialerActive )
         {
         iDialerActive = EFalse;
@@ -4084,4 +4088,36 @@
     return iNeedToReturnToForegroundAppAfterCall;
     }
 
+// ---------------------------------------------------------------------------
+// CPhoneViewController::AllowInCallBubbleInSpecialCases
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::AllowInCallBubbleInSpecialCases()
+{
+    // this method can be used for special cases like dialer
+ 
+    if( iDialerActive )
+    {
+        SetIncallBubbleVisibility( ETrue );
+    }
+    else
+    {
+        SetIncallBubbleVisibility( EFalse );
+    }
+ 
+}
+                    
+// ---------------------------------------------------------------------------
+// CPhoneViewController::SetIncallBubbleVisibility
+// ---------------------------------------------------------------------------
+//
+void CPhoneViewController::SetIncallBubbleVisibility( TBool aVisible )
+    {
+    __PHONELOG1( EBasic, EPhoneUIView,
+        "CPhoneViewController::SetIncallBubbleVisibility(%d)",
+        aVisible );
+
+        TRAP_IGNORE( iIncallBubble->SetIncallBubbleAllowedInUsualL( aVisible ) ); 
+    }
+
 // End of File
--- a/phoneapp/phoneuivoipextension/inc/cphonecustomizationvoip.h	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuivoipextension/inc/cphonecustomizationvoip.h	Tue May 11 16:13:03 2010 +0300
@@ -370,6 +370,25 @@
         * @return  Phone number
         */
         HBufC* PhoneNumberFromEntryLC() const;
+		
+		/**
+         * Enables or disables key lock.
+         * @param aEnabled ETrue if keylock is enabled,
+         * EFalse if disabled.
+         */
+        void SetKeyLockEnabledL( TBool aEnabled );
+
+		/**
+		* Keylock was on before and needs to be restored.
+		* @param aRestore ETrue if keylock needs to be restored.
+		*/
+	    void SetNeedToRestoreKeyLock( TBool aRestore );
+		
+		/* Check if keylock was on before and needs to be restored.
+		 * @return ETrue if keylock needs to be restored.
+		 */
+	    TBool NeedToRestoreKeyLock() const;
+	    
         
     private: // Data
 		        
@@ -418,6 +437,12 @@
          * Call forward handler.
          */
         CPhoneCallForwardQueryHandler* iCallForwardHandler;
+        
+        /**
+         * Boolean flag. ETrue if keylock was on before and
+         * needs to be restored.
+         */
+        TBool iNeedToRestoreKeyLock;
 		
     };
 
--- a/phoneapp/phoneuivoipextension/src/cphonecustomizationvoip.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuivoipextension/src/cphonecustomizationvoip.cpp	Tue May 11 16:13:03 2010 +0300
@@ -60,6 +60,7 @@
 #include "cphonevcchandler.h"
 #include "cphonecallforwardqueryhandler.h"
 #include "cphonekeys.h"
+#include "phoneui.hrh"
 
 // CONSTANTS
 const TInt KMaxLengthForSIPURIFirstLine = 15;
@@ -385,13 +386,19 @@
             handled = ETrue;
             }
             break;
+        case EPhoneCmdUnattendedTransferCallBackCancel:
+            if ( NeedToRestoreKeyLock() )
+                 {
+                 SetKeyLockEnabledL( ETrue );
+                 SetNeedToRestoreKeyLock( EFalse );
+                 }
+            // intended fall-through
         case EPhoneInCallCmdUnattendedTransfer:
         case EPhoneCmdTransferDialerOk:
         case EPhoneCmdTransferDialerExit:
         case EPhoneCmdTransferDialerSearch:
         case EPhoneCmdTransferDialerContactFetch:
         case EPhoneCmdUnattendedTransferCallBackOk:
-        case EPhoneCmdUnattendedTransferCallBackCancel:
             // intended fall-through
             iTransferCmdHandler->HandleCommandL( aCommand );
             handled = ETrue;
@@ -429,6 +436,15 @@
             handled = ETrue;
             break;
             
+       case EPhoneCmdRejectUnattendedTransfer:
+            if ( NeedToRestoreKeyLock() )
+                {
+                SetKeyLockEnabledL( ETrue );
+                SetNeedToRestoreKeyLock( EFalse );
+                } 
+            handled = ETrue;
+            break;
+			
         default:
             {
             RArray<CTelMenuExtension::TCallInfo> array;
@@ -598,8 +614,11 @@
         case MEngineMonitor::EPEMessageTransferring:
             {
             iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveGlobalNote );
-            CPhoneState* phoneState = 
-                static_cast< CPhoneState* >( iStateMachine.State() );    
+            break;
+            }
+        case MEngineMonitor::EPEMessageTransferDone:
+            {
+            iViewCommandHandle.ExecuteCommandL( EPhoneViewRemoveGlobalNote );
             SendGlobalInfoNoteL( EPhoneInCallTransferred );
             break; 
             }
@@ -610,9 +629,28 @@
             }
         case MEngineMonitor::EPEMessageTransferCallBackRequest:
             {
+            if ( iStateMachine.State()->IsKeyLockOn()  )
+                {
+                SetNeedToRestoreKeyLock( ETrue );
+                SetKeyLockEnabledL( EFalse );      
+                }
             iTransferCmdHandler->LaunchCallBackQueryL();
             break;
             }
+		case MEngineMonitor::EPEMessageIdle:
+            {
+            TPhoneCmdParamInteger activeCallCount;
+            iViewCommandHandle.ExecuteCommandL(
+                    EPhoneViewGetCountOfActiveCalls, &activeCallCount );
+            
+            if ( ENoActiveCalls == activeCallCount.Integer() 
+                 && NeedToRestoreKeyLock() )
+                {
+                SetKeyLockEnabledL( ETrue );
+                SetNeedToRestoreKeyLock( EFalse );
+                }
+			break;
+			}
         default:
             handled = EFalse;
             break;
@@ -1530,4 +1568,50 @@
     return phoneNumber;
     }
 
+// ---------------------------------------------------------------------------
+// CPhoneCustomizationVoip::SetKeyLockEnabledL
+// ---------------------------------------------------------------------------
+//
+void CPhoneCustomizationVoip::SetKeyLockEnabledL( TBool aEnabled )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+        "CPhoneCustomizationVoip::CPhoneCustomizationVoip::SetKeyLockEnabledL" );
+    if ( aEnabled )
+        {
+        iViewCommandHandle.ExecuteCommandL(
+                                  EPhoneViewEnableKeyLock );
+        }
+    else
+        {
+        iViewCommandHandle.ExecuteCommandL(
+                              EPhoneViewDisableKeyLockWithoutNote );
+        }           
+    }
+
+// ---------------------------------------------------------------------------
+// CPhoneCustomizationVoip::SetNeedToRestoreKeyLock
+// ---------------------------------------------------------------------------
+//
+void CPhoneCustomizationVoip::SetNeedToRestoreKeyLock( TBool aRestore )
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+          "CPhoneCustomizationVoip::CPhoneCustomizationVoip::SetNeedToRestoreKeyLock" );
+    __PHONELOG1( EBasic, PhoneUIVoIPExtension, 
+               "CPhoneCustomizationVoip::AwrNeedToRestoreKeyLock:%d", aRestore );
+    iNeedToRestoreKeyLock = aRestore;
+    }
+
+// -----------------------------------------------------------
+// CPhoneCustomizationVoip::NeedToRestoreKeyLock
+// -----------------------------------------------------------
+//
+TBool CPhoneCustomizationVoip::NeedToRestoreKeyLock() const
+    {
+    __LOGMETHODSTARTEND( PhoneUIVoIPExtension, 
+          "CPhoneCustomizationVoip::CPhoneCustomizationVoip::NeedToRestoreKeyLock" );
+    __PHONELOG1( EBasic, PhoneUIVoIPExtension, 
+            "CPhoneCustomizationVoip::NeedToRestoreKeyLock:%d", iNeedToRestoreKeyLock );
+    return iNeedToRestoreKeyLock;
+    }
+
 // End of File
--- a/phoneapp/phoneuivoipextension/src/cphonestatesinglevoip.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneapp/phoneuivoipextension/src/cphonestatesinglevoip.cpp	Tue May 11 16:13:03 2010 +0300
@@ -114,7 +114,9 @@
         {
         case MEngineMonitor::EPEMessageUnattendedTransferRequest:
             LaunchUnattendedTransferAcceptanceQueryL();
-            break;
+            // Forward message to phone customization 
+			CPhoneState::ForwardPEMessageToPhoneCustomizationL( aMessage, aCallId );
+			break;
         default:
             CPhoneSingleCall::HandlePhoneEngineMessageL( 
                 aMessage, aCallId );
--- a/phoneengine/PhoneCntFinder/ContactService/inc/CPhCntContactManager.h	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneengine/PhoneCntFinder/ContactService/inc/CPhCntContactManager.h	Tue May 11 16:13:03 2010 +0300
@@ -357,6 +357,12 @@
       * Not own.
       */
      MPhCntStoreLoaderObserver* iStoreLoaderObserver;
+     
+     /**
+     * Stored contact store for callback usage.
+     */
+     MVPbkContactStore* iContactStore;
+     
     };
 
 #endif // CPHCNTCONTACTMANAGER_H
\ No newline at end of file
--- a/phoneengine/PhoneCntFinder/ContactService/src/CPhCntContactManager.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneengine/PhoneCntFinder/ContactService/src/CPhCntContactManager.cpp	Tue May 11 16:13:03 2010 +0300
@@ -74,6 +74,7 @@
         {
         TRAP_IGNORE( iContactManager->ContactStoresL().CloseAll( *this ) );
         }
+    delete iContactStore;
     delete iContactManager;
     delete iContactStoreUris;
     }
@@ -360,6 +361,12 @@
 //
 void CPhCntContactManager::OpenComplete()
     {
+    if ( iStoreLoaderObserver )
+        {      
+        iStoreLoaderObserver->ContactStoreLoadingCompleted(
+           iContactStore, KErrNone );
+        iStoreLoaderObserver = NULL;
+        }
     }
 
 // ---------------------------------------------------------------------------
@@ -370,17 +377,16 @@
 void CPhCntContactManager::StoreReady(
     MVPbkContactStore& aContactStore )
     {
+    
     TVPbkContactStoreUriPtr uri = aContactStore.StoreProperties().Uri();
 
-    if ( iStoreLoaderObserver
-            && !iContactStoreUris->ContactStores().IsIncluded( uri ) )
+    if ( !iContactStoreUris->ContactStores().IsIncluded( uri ) )
         {
         TRAP_IGNORE( iContactStoreUris->AddContactStoreL( uri ) );
-
-        iStoreLoaderObserver->ContactStoreLoadingCompleted(
-            &aContactStore, KErrNone );
-        iStoreLoaderObserver = NULL;
         }
+    
+    iContactStore = &aContactStore;
+     
     iContactStoreUris->StoreReady( uri );
     }
 
--- a/phoneengine/PhoneCntFinder/ContactService/src/cphcntstoreloaderimpl.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntstoreloaderimpl.cpp	Tue May 11 16:13:03 2010 +0300
@@ -15,12 +15,17 @@
 *
 */
 
-
+#include <MVPbkContactLink.h>
 #include <CVPbkContactLinkArray.h>
+#include <MVPbkContactStoreList.h>
+#include <CVPbkContactStoreUriArray.h>
 #include <TVPbkContactStoreUriPtr.h>
-#include <MVPbkContactStoreList.h>
+#include <MVPbkContactStore.h>
+#include <MVPbkContactStoreProperties.h>
+#include <talogger.h>
 #include "cphcntstoreloaderimpl.h"
 #include "MPhCntContactManager.h"
+#include "cphcntcontactstoreuris.h"
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -176,13 +181,32 @@
 //
 TBool CPhCntStoreLoaderImpl::IsContactStoreLoadedL( 
         const TDesC8& aContactLink ) const
-    {
-    CVPbkContactLinkArray* linkArray = CVPbkContactLinkArray::NewLC( 
-        aContactLink, iContactManager.ContactStoresL() );
+    {    
+    TBool storeLoaded = EFalse;
+    CPhCntContactStoreUris& storeUris = iContactManager.ContactStoreUrisL();
+    CVPbkContactStoreUriArray* uriArray = storeUris.ActiveContactStoresL(); 
+    CleanupStack::PushL( uriArray );
     
-    TBool storeLoaded( linkArray->Count() != 0 );
-    CleanupStack::PopAndDestroy( linkArray );
-    
+    if ( uriArray->Count() > 0 ) 
+        {  
+        MVPbkContactLink* link = iContactManager.ConvertDescriptorToLinkL( aContactLink );
+        if( link )
+            {
+            for ( int i=0; i<uriArray->Count();i++ )
+                {           
+                if ((*uriArray)[i].Compare( 
+                    link->ContactStore().StoreProperties().Uri(), 
+                    TVPbkContactStoreUriPtr::EContactStoreUriAllComponents ) 
+                        == KErrNone )
+                    {
+                    storeLoaded = ETrue;
+                    break;
+                    }
+                }
+            delete link;
+            }
+    }
+    CleanupStack::PopAndDestroy( uriArray );
     return storeLoaded;
     }
 
--- a/phoneengine/loghandling/inc/cpelogevent.h	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneengine/loghandling/inc/cpelogevent.h	Tue May 11 16:13:03 2010 +0300
@@ -236,14 +236,7 @@
          * @param    aLogInfo      Log info containing remote contact.
          */
         void SetRemoteContact( CLogEvent& aEvent, const CPELogInfo& aLogInfo );
-        
-        /**
-         * Removes from event data the given tag and data attached to it.
-         * @since    S60 v5.1
-         * @param    aTag          Tag to be removed
-         */
-        void RemoveTagFromDataFieldL( const TDesC8& aTag );
-        
+              
     private:    // Data
         // Owner of the object.
         CPELogHandling& iOwner;
--- a/phoneengine/loghandling/src/cpelogevent.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneengine/loghandling/src/cpelogevent.cpp	Tue May 11 16:13:03 2010 +0300
@@ -658,7 +658,12 @@
     {
     if ( KNullDesC() != aLogInfo.Name() )
         {
-        aEvent.SetRemoteParty( aLogInfo.Name() );
+        // This if clause fixes ou1cimx1#320365 Wrong address shown in received log entry
+        if ( aLogInfo.EventType() != CPELogInfo::EPEVoIPEvent ||
+             KNullDesC() == aEvent.RemoteParty() )
+            {
+            aEvent.SetRemoteParty( aLogInfo.Name() );
+            }
         }
     }
 
@@ -670,22 +675,18 @@
 void CPELogEvent::SetRemoteContact( CLogEvent& aEvent, 
         const CPELogInfo& aLogInfo )
     {
-    if ( KNullDesC() != aLogInfo.PhoneNumber() )
+    if ( KNullDesC() != aLogInfo.PhoneNumber() )      
         {
-        aEvent.SetNumber( aLogInfo.PhoneNumber() );
-       
-        if ( CPELogInfo::EPEVoIPEvent == aLogInfo.EventType() )
+        if ( aLogInfo.EventType() != CPELogInfo::EPEVoIPEvent ||
+             ( KNullDesC() == aEvent.Number() &&
+               KErrNotFound == iEvent->Data().Find( KLogsDataFldTag_URL ) ) )
             {
-            TRAPD( error, RemoveTagFromDataFieldL( KLogsDataFldTag_URL ) );
-            if( error )
-                {
-                TEFLOGSTRING2( KTAERROR, 
-                    "LOG CPELogEvent::SetRemoteContact()>RemoveTagFromDataFieldL(), error=%d", error )
-                }
+            aEvent.SetNumber( aLogInfo.PhoneNumber() );
             }
         }
     
-    if ( KNullDesC() != aLogInfo.VoipAddress() )
+    else if ( KNullDesC() != aLogInfo.VoipAddress() &&
+              KNullDesC() == aEvent.Number())
         {
         TRAPD( error, SetDataFieldL( KLogsDataFldTag_URL, aLogInfo.VoipAddress() ) );
         if ( error )
@@ -693,38 +694,6 @@
             TEFLOGSTRING2( KTAERROR, 
                 "LOG CPELogEvent::SetRemoteContact()>SetDataFieldL(), error=%d", error )
             }
-        aEvent.SetNumber( KNullDesC() );
-        }
-    }
-
-// -----------------------------------------------------------------------------
-// CPELogEvent::RemoveTagFromDataFieldL
-// -----------------------------------------------------------------------------
-//
-void CPELogEvent::RemoveTagFromDataFieldL( const TDesC8& aTag )
-    {
-    __ASSERT_ALWAYS( aTag.Length() != 0 ,
-        User::Leave( KErrArgument ) );
-
-    TInt index = iEvent->Data().Find( aTag );
-    if ( KErrNotFound != index  )
-        {
-        HBufC8* eventData = iEvent->Data().AllocLC();
-        TPtrC8 urlData = eventData->Mid( index );
-        TInt otherTag = urlData.Find( KLogsDataFldNameDelimiter );
-       
-        const TInt dlLen = KLogsDataFldNameDelimiter().Length();
-        if ( KErrNotFound == otherTag )
-            {
-            eventData->Des().Delete( index - dlLen, urlData.Length() + dlLen );
-            }
-        else
-            {
-            eventData->Des().Delete( index - dlLen, otherTag );
-            }
-        iEvent->SetDataL( *eventData );
-
-        CleanupStack::PopAndDestroy( eventData );
         }
     }
 
--- a/phoneuis/dialer/group/dialer.mmp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneuis/dialer/group/dialer.mmp	Tue May 11 16:13:03 2010 +0300
@@ -74,6 +74,8 @@
 LIBRARY centralrepository.lib
 LIBRARY cenrepnotifhandler.lib 
 LIBRARY serviceprovidersettings.lib
+LIBRARY featmgr.lib
+LIBRARY peninputclient.lib
 
 // Keypad resources. Header is generated only for the
 // default variant, all the variants use the same header.
--- a/phoneuis/dialer/group/dialerstub.mmp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneuis/dialer/group/dialerstub.mmp	Tue May 11 16:13:03 2010 +0300
@@ -60,6 +60,7 @@
 LIBRARY euser.lib eikcore.lib estor.lib etext.lib 
 LIBRARY cone.lib ws32.lib bmpanim.lib 
 LIBRARY eikcoctl.lib fbscli.lib bafl.lib 
+LIBRARY peninputclient.lib
 
 LIBRARY commonengine.lib
 
--- a/phoneuis/dialer/inc/cdialer.h	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneuis/dialer/inc/cdialer.h	Tue May 11 16:13:03 2010 +0300
@@ -24,6 +24,8 @@
 #include <coecntrl.h>
 #include <coemain.h>
 
+#include <peninputsrveventhandler.h>
+#include <peninputclient.h>
 #include "mnumberentry.h"
 #include "mphoneqwertymodeobserver.h"
 
@@ -123,7 +125,8 @@
 	public CCoeControl, 
 	public MNumberEntry, 
 	public MCoeControlObserver,
-	public MPhoneQwertyModeObserver
+	public MPhoneQwertyModeObserver,
+    public MPenUiActivationHandler
     {
     public:  // Constructors and destructor
 
@@ -413,6 +416,18 @@
          */
         void LayoutNumberEntry( const TRect& aParent, TInt aVariety );
         
+    public:
+
+        /**
+         * @see MPenUiActivationHandler
+         */
+        void OnPeninputUiDeactivated();
+
+        /**
+         * @see MPenUiActivationHandler
+         */        
+        void OnPeninputUiActivated();
+        
     private:    // Data
           
         // Keypad container  - owned
@@ -459,7 +474,12 @@
          * Is qwerty mode on.
          */
         TBool iQwertyMode;
-        
+
+        /**
+         * Server wich sends events via callback when the virtual keyboard is opened/closed.
+         */		
+        RPeninputServer iPeninputServer;
+
         /**
          * Current type of the editor field. The field is numeric unless
          * the device is in QWERTY mode and there is some consumer (like VoIP, EasyDialing)
--- a/phoneuis/dialer/src/cdialer.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneuis/dialer/src/cdialer.cpp	Tue May 11 16:13:03 2010 +0300
@@ -35,6 +35,7 @@
 #include <dialingextensioninterface.h>
 #include <easydialingcommands.hrh>
 #include <dialer.rsg>
+#include <featmgr.h>
 
 #include "cdialer.h"
 #include "dialercommon.h"
@@ -81,6 +82,10 @@
 EXPORT_C CDialer::~CDialer()
     {
     DIALER_PRINT("CDialer::~CDialer<"); 
+    #ifdef RD_SCALABLE_UI_V2
+    iPeninputServer.RemovePenUiActivationHandler( this );
+    iPeninputServer.Close();
+    #endif
     AknsUtils::DeregisterControlPosition( this );
 
     delete iKeypadArea;
@@ -134,6 +139,13 @@
     SetComponentsToInheritVisibility( EFalse );
 
     ActivateL();
+    #ifdef RD_SCALABLE_UI_V2
+    if ( AknLayoutUtils::PenEnabled() )
+        {
+        User::LeaveIfError( iPeninputServer.Connect() );
+        iPeninputServer.AddPenUiActivationHandler( this, EPluginInputModeAll ); 
+        }
+    #endif
     DIALER_PRINT("CDialer::ConstructL>");
     }
 
@@ -825,24 +837,28 @@
 void CDialer::LoadEasyDialingPlugin()
     {
     DIALER_PRINT( "CDialer::LoadEasyDialingPlugin" )
-    TRAPD( error, 
+            
+    if ( FeatureManager::FeatureSupported( KFeatureIdProductIncludesHomeScreenEasyDialing ) )
         {
-        iEasyDialer = CDialingExtensionInterface::NewL();
-        iEasyDialer->InitializeL( *this );
-        
-        iDialingExtensionObserver = CDialingExtensionObserver::NewL( iEasyDialer, iNumberEntry, this );
-        iEasyDialer->AddObserverL( iDialingExtensionObserver );
-        } );
-
-    if ( error )
-        {
-        DIALER_PRINT( "CDialer::LoadEasyDialingPlugin, load failed" )
-                
-        delete iEasyDialer;
-        iEasyDialer = NULL;
-        
-        delete iDialingExtensionObserver;
-        iDialingExtensionObserver = NULL;
+        TRAPD( error, 
+            {
+            iEasyDialer = CDialingExtensionInterface::NewL();
+            iEasyDialer->InitializeL( *this );
+            
+            iDialingExtensionObserver = CDialingExtensionObserver::NewL( iEasyDialer, iNumberEntry, this );
+            iEasyDialer->AddObserverL( iDialingExtensionObserver );
+            } );
+    
+        if ( error )
+            {
+            DIALER_PRINT( "CDialer::LoadEasyDialingPlugin, load failed" )
+                    
+            delete iEasyDialer;
+            iEasyDialer = NULL;
+            
+            delete iDialingExtensionObserver;
+            iDialingExtensionObserver = NULL;
+            }
         }
     }
 
@@ -890,4 +906,26 @@
     iNumberEntry->SetRect( neRect );
     }
 
+// ---------------------------------------------------------------------------
+// CDialer::OnPeninputUiDeactivated
+//
+// Gets called when the virtual keyboard editor is closed.
+// ---------------------------------------------------------------------------
+//
+void CDialer::OnPeninputUiDeactivated()
+    {
+    DIALER_PRINT( "CDialer::OnPeninputUiDeactivated" )
+    FocusChanged( EDrawNow );
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::OnPeninputUiActivated
+//
+// Gets called when the virtual keyboard editor is opened.
+// ---------------------------------------------------------------------------
+//
+void CDialer::OnPeninputUiActivated()
+    {
+    DIALER_PRINT( "CDialer::OnPeninputUiActivated" )
+    }
 // End of File
--- a/phoneuis/dialer/src/cdialerkeypadcontainer.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneuis/dialer/src/cdialerkeypadcontainer.cpp	Tue May 11 16:13:03 2010 +0300
@@ -295,9 +295,10 @@
             // Calculate corresponding index in iButtons array
             TInt idx = col + row * colCount;
             
-            // Set mode and variety so that correct button internal layout will be used
+            // Set mode and variety so that correct button internal layout will be used.
+            // Always use ED mode, so that text labels are visible even when ED is off.
             iButtons[idx]->SetVariety( iVariety );
-            iButtons[idx]->SetOperationMode( iOperatingMode );
+            iButtons[idx]->SetOperationMode( EModeEasyDialing );
             
             // Layout button
             TRect buttonRect = firstButtonRect;
--- a/phoneuis/dialer/src/cdialerstub.cpp	Tue Apr 27 16:37:10 2010 +0300
+++ b/phoneuis/dialer/src/cdialerstub.cpp	Tue May 11 16:13:03 2010 +0300
@@ -463,4 +463,25 @@
     // Empty
     }
 
+// ---------------------------------------------------------------------------
+// CDialer::OnPeninputUiDeactivated
+//
+// Gets called when the virtual keyboard editor is closed.
+// ---------------------------------------------------------------------------
+//
+void CDialer::OnPeninputUiDeactivated()
+    {
+    // Empty
+    }
+
+// ---------------------------------------------------------------------------
+// CDialer::OnPeninputUiActivated
+//
+// Gets called when the virtual keyboard editor is opened.
+// ---------------------------------------------------------------------------
+//	
+void CDialer::OnPeninputUiActivated()
+    {
+    // Empty
+    }
 // End of File