Merge PDK_3.0.f
authorSimon Howkins <simonh@symbian.org>
Fri, 29 Jan 2010 17:12:32 +0000
changeset 3 74c6260f9112
parent 2 aa12ff35878a (current diff)
parent 1 838b0a10d15b (diff)
child 7 801fe8ecf072
Merge
--- a/phoneapp/phoneui/srcdata/phoneui.rss	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneui/srcdata/phoneui.rss	Fri Jan 29 17:12:32 2010 +0000
@@ -3916,6 +3916,28 @@
         };
     }
 
+RESOURCE CBA r_phoneui_callhandling_callsetup_dtmfdialer_endoutgoing_cba
+    {
+    buttons =
+        {
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdDtmfManualQuery;
+            txt = qtn_incal_softk_dialer;
+            },
+        CBA_BUTTON
+            {
+            id = EPhoneInCallCmdEndThisOutgoingCall;
+            txt = text_softkey_drop;
+            },
+        CBA_BUTTON
+            {
+            id = EAknSoftkeyEmpty;
+            txt = "";
+            }
+        };
+    }
+
 RESOURCE CBA r_phoneui_callhandling_callsetup_toihf_endoutgoing_cba
     {
     buttons =
@@ -5584,20 +5606,20 @@
     }
 // ---------------------------------------------------------
 //
-//    r_phone_emergency_network_connect_wait_note_empty_dialer
+//    r_phone_emergency_network_connect_wait_note_dialer
 //
 //    It defines wait note showing when attempting an
 //    emergency call with onscreen dialer.
 //
 // ---------------------------------------------------------
 //
-RESOURCE DIALOG r_phone_emergency_network_connect_wait_note_empty_dialer
+RESOURCE DIALOG r_phone_emergency_network_connect_wait_note_dialer
     {
     flags = EEikDialogFlagNoDrag |
             EEikDialogFlagNoTitleBar |
             EEikDialogFlagCbaButtons;
 
-    buttons = r_phoneui_callhandling_callsetup_empty_dtmfdialer_cba;
+    buttons = r_phoneui_callhandling_callsetup_dtmfdialer_endoutgoing_cba;
     items =
         {
         DLG_LINE
--- a/phoneapp/phoneuicontrol/src/cphonecbamanager.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuicontrol/src/cphonecbamanager.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -173,8 +173,9 @@
             }
         }
 
-    // Check is Audio muted
-    else if ( iStateMachine.PhoneEngineInfo()->AudioMute() )
+    // Check if Audio is muted
+    else if ( iStateMachine.PhoneEngineInfo()->AudioMute() &&
+        !FeatureManager::FeatureSupported( KFeatureIdTouchCallHandling ))
         {
         resourceId = EPhoneCallHandlingInCallUnmuteCBA;
         }
--- a/phoneapp/phoneuistates/inc/cphoneemergency.h	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuistates/inc/cphoneemergency.h	Fri Jan 29 17:12:32 2010 +0000
@@ -188,6 +188,11 @@
 		* EFalse otherwise.
 		*/
     	TBool TouchCallHandlingSupported () const;
+    	
+       /**
+       * Update status of startup if startup finish during emergency call
+       */
+       void HandlePhoneStartupL();
          
     private:
         /**
--- a/phoneapp/phoneuistates/src/cphonealerting.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuistates/src/cphonealerting.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -177,17 +177,22 @@
     switch ( aMessage )
         {
         case MEngineMonitor::EPEMessageConnected:
+            {
             HandleConnectedL( aCallId );
+            }
             break;
         
         case MEngineMonitor::EPEMessageDisconnecting:
+            {
             HandleDisconnectingL( aCallId );
+            }
             break;
         
         case MEngineMonitor::EPEMessageRemoteTerminated:
+            {
             iViewCommandHandle->ExecuteCommandL( 
-                EPhoneViewHideNaviPaneAudioVolume );
-            CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+                EPhoneViewHideNaviPaneAudioVolume );            
+            }
             break;
         
         case MEngineMonitor::EPEMessageIncoming:
@@ -221,6 +226,12 @@
                 }
             }
             break;
+        case MEngineMonitor::EPEMessageColpNumberAvailable:
+            {
+            HandleColpNoteL( aCallId );
+            return;
+            }
+            break;            
         
         default:
             break;
@@ -257,8 +268,6 @@
 
     EndUiUpdate();
     
-    HandleColpNoteL( aCallId );
-    
     // Go to single state
     UpdateCbaL( EPhoneCallHandlingInCallCBA );    
     iStateMachine->ChangeState( EPhoneStateSingle );
--- a/phoneapp/phoneuistates/src/cphoneconferenceandcallsetup.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuistates/src/cphoneconferenceandcallsetup.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -107,25 +107,41 @@
     switch ( aMessage )
         {
         case MEngineMonitor::EPEMessageConnecting:
+            {
             iAlerting = ETrue;
             HandleConnectingL( aCallId );
+            }
             break;
             
         case MEngineMonitor::EPEMessageConnected:
+            {
             HandleConnectedL( aCallId );
+            }
             break;
             
         case MEngineMonitor::EPEMessageIdle:
+            {
             HandleIdleL( aCallId );
+            }
             break;
             
         case MEngineMonitor::EPEMessageConferenceIdle:
+            {
             HandleConferenceIdleL();
+            }
             break;
             
+        case MEngineMonitor::EPEMessageColpNumberAvailable:
+            {
+            HandleColpNoteL( aCallId );            
+            }
+            break;         
+            
         default:
+            {
             CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
                 aCallId );
+            }
             break;
         }
     }
@@ -311,8 +327,7 @@
     SetTouchPaneButtons( EPhoneConferenceAndSingleButtons );
     SetTouchPaneButtonDisabled( EPhoneInCallCmdPrivate );
     EndUiUpdate(); 
-
-    HandleColpNoteL( aCallId );
+    
     UpdateCbaL ( EPhoneCallHandlingNewCallSwapCBA );
    
     iStateMachine->ChangeState( EPhoneStateConferenceAndSingle );                     
--- a/phoneapp/phoneuistates/src/cphoneconferenceandwaitingandcallsetup.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuistates/src/cphoneconferenceandwaitingandcallsetup.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -112,25 +112,41 @@
     switch ( aMessage )
         {
         case MEngineMonitor::EPEMessageConnecting:
+            {
             iAlerting = ETrue;
             HandleConnectingL( aCallId );
+            }
             break;
             
         case MEngineMonitor::EPEMessageConnected:
+            {
             HandleConnectedL( aCallId );
+            }
             break;
         
         case MEngineMonitor::EPEMessageConferenceIdle:
+            {
             HandleConferenceIdleL();
+            }
             break;
 
         case MEngineMonitor::EPEMessageIdle:
+            {
             HandleIdleL( aCallId );
+            }
             break;
+            
+        case MEngineMonitor::EPEMessageColpNumberAvailable:
+            {
+            HandleColpNoteL( aCallId );            
+            }
+            break;         
 
         default:
+            {
             CPhoneConference::HandlePhoneEngineMessageL( aMessage, 
                 aCallId );
+            }
             break;
         }
     }
@@ -321,8 +337,6 @@
         {
         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
         }
-        
-    HandleColpNoteL( aCallId );
     
     SetTouchPaneButtons( EPhoneWaitingCallButtons );    
     SetTouchPaneButtonDisabled( EPhoneCallComingCmdAnswer );
--- a/phoneapp/phoneuistates/src/cphoneemergency.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuistates/src/cphoneemergency.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -177,6 +177,7 @@
 
                 if ( !isProgressNoteVisible.Boolean() )
                     {
+                    ShowNoteL( EPhoneEmergencyConnectWaitNote );
                     UpdateSetupCbaL();
                     }
                  }
@@ -231,9 +232,6 @@
                 // Continue displaying current app but set up the
                 // idle screen in the background
                 SetupIdleScreenInBackgroundL();
-
-                // Update toolbar
-                iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateToolbar );
                 }
 
             else if ( iOnScreenDialer && IsNumberEntryContentStored() )
@@ -251,8 +249,6 @@
                 {
                 // Show the number entry if it exists
                 SetNumberEntryVisibilityL(ETrue);
-                // Update toolbar
-                iViewCommandHandle->ExecuteCommandL( EPhoneViewUpdateToolbar );
                 }
 
             else
@@ -380,8 +376,6 @@
 
         SetTouchPaneButtons( EPhoneEmergencyCallButtons );
 
-        SetToolbarDimming( ETrue );
-
         ShowNoteL( EPhoneEmergencyConnectWaitNote );
 
         UpdateSetupCbaL();
@@ -462,7 +456,8 @@
 
     EndUiUpdate();
 
-    SetToolbarButtonLoudspeakerEnabled();
+    //Make sure that toolbar is not shown
+    iViewCommandHandle->ExecuteCommandL( EPhoneViewHideToolbar );
 
     UpdateInCallCbaL();
     }
@@ -486,7 +481,6 @@
         &emergencyHeaderParam );
 
     EndUiUpdate();
-    SetToolbarDimming( ETrue );
     UpdateInCallCbaL();
     }
 
@@ -685,6 +679,7 @@
 
                  if ( !isProgressNoteVisible.Boolean() )
                      {
+                     ShowNoteL( EPhoneEmergencyConnectWaitNote );
                      UpdateSetupCbaL();
                      }
                  }
@@ -883,7 +878,8 @@
     const TPEAudioOutput audioOutput =
         iStateMachine->PhoneEngineInfo()->AudioOutput();
 
-    if ( iCallSetup && audioOutput != EPENotActive)
+    if ( !( TouchCallHandlingSupported() ) 
+    		&& iCallSetup && audioOutput != EPENotActive )
         {
         if ( audioOutput == EPELoudspeaker )
             {
@@ -986,7 +982,7 @@
 // --------------------------------------------------------------
 //
 TBool CPhoneEmergency::UseHandsetEmergencyCBA( const TPEAudioOutput& aAudioOutput ) const
-{
+    {
 	if ( !( TouchCallHandlingSupported() ) 
 		&& ( ( aAudioOutput == EPELoudspeaker ) || ( aAudioOutput == EPEBTAudioAccessory ) ) )
 		{
@@ -996,6 +992,16 @@
 		{
 		return EFalse;
 		}
-}
+    }
+
+// --------------------------------------------------------------
+// CPhoneEmergency::HandlePhoneStartupL
+// --------------------------------------------------------------
+//
+void CPhoneEmergency::HandlePhoneStartupL()
+    {
+    __LOGMETHODSTARTEND(EPhoneControl, "CPhoneEmergency::HandlePhoneStartupL( ) ");
+    iStartupInterrupted = EFalse;
+    }
 
 // End of File
--- a/phoneapp/phoneuistates/src/cphonegsmincall.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuistates/src/cphonegsmincall.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -218,26 +218,23 @@
 // CPhoneGsmInCall::HandleColpNoteL
 // -----------------------------------------------------------
 //
-void CPhoneGsmInCall::HandleColpNoteL( 
-    TInt aCallId )
+void CPhoneGsmInCall::HandleColpNoteL( TInt aCallId )
     {
     __LOGMETHODSTARTEND(EPhoneControl, "CPhoneGsmInCall::HandleColpNoteL() ");
 
     MPEEngineInfo* EngineInfo = CPhoneState::iStateMachine->PhoneEngineInfo();
-
-    if ( EngineInfo->RemoteColpNumber( aCallId ).Length() )
-        {
-        TPhoneCmdParamGlobalNote globalNoteParam;
-	    globalNoteParam.SetText(  EngineInfo->RemoteColpNumber( aCallId ) ); 
-	    globalNoteParam.SetType( EAknGlobalInformationNote );
-	    globalNoteParam.SetTextResourceId( 
-	        CPhoneMainResourceResolver::Instance()->
+    
+    TPhoneCmdParamGlobalNote globalNoteParam;
+    globalNoteParam.SetText(  EngineInfo->RemoteColpNumber( aCallId ) ); 
+    globalNoteParam.SetType( EAknGlobalInformationNote );
+    globalNoteParam.SetTextResourceId( 
+            CPhoneMainResourceResolver::Instance()->
 	        ResolveResourceID( EPhoneColpConnected ) );
-	    globalNoteParam.SetTone( EAvkonSIDInformationTone );
+    globalNoteParam.SetTone( EAvkonSIDInformationTone );
 	        
-	    iViewCommandHandle->ExecuteCommandL( 
-	            EPhoneViewShowGlobalNote, &globalNoteParam );
-        }
+    iViewCommandHandle->ExecuteCommandL( 
+            EPhoneViewShowGlobalNote, &globalNoteParam );
+    
     }
 
 // -----------------------------------------------------------
--- a/phoneapp/phoneuistates/src/cphonesingleandalerting.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuistates/src/cphonesingleandalerting.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -102,15 +102,26 @@
     switch ( aMessage )
         {
         case MEngineMonitor::EPEMessageConnected:
+            {
             HandleConnectedL( aCallId );
             break;
+            }
+        case MEngineMonitor::EPEMessageIdle:
+            {
+            HandleIdleL( aCallId );
+            }
+            break;
             
-        case MEngineMonitor::EPEMessageIdle:
-            HandleIdleL( aCallId );
-            break;
+        case MEngineMonitor::EPEMessageColpNumberAvailable:
+            {
+            HandleColpNoteL( aCallId );            
+            }
+            break;         
             
         default:
+            {
             CPhoneAlerting::HandlePhoneEngineMessageL( aMessage, aCallId );
+            }
             break;
         }
     }
@@ -231,9 +242,7 @@
         TPhoneCmdParamBoolean holdFlag;
         holdFlag.SetBoolean( EFalse );
         iViewCommandHandle->ExecuteCommandL( EPhoneViewSetHoldFlag, &holdFlag );
-        }
-        
-    CPhoneGsmInCall::HandleColpNoteL( aCallId );
+        }    
     }
 // -----------------------------------------------------------
 // CPhoneSingleAndAlerting::HandleIdleL
--- a/phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuistates/src/cphonesingleandcallsetupandwaiting.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -197,24 +197,40 @@
     switch ( aMessage )
         {
         case MEngineMonitor::EPEMessageConnecting:
+            {
             iAlerting = ETrue;
             HandleConnectingL( aCallId );
+            }
             break;
         
         case MEngineMonitor::EPEMessageConnected:
+            {
             HandleConnectedL( aCallId );
+            }
             break;
         
         case MEngineMonitor::EPEMessageIdle:
+            {
             HandleIdleL( aCallId );
+            }
             break;
                     
         case MEngineMonitor::EPEMessageRemoteBusy:
+            {
             // If call setup failed then stop capturing keys.
             // Flow through to default branch.
-            CaptureKeysDuringCallNotificationL( EFalse );     
+            CaptureKeysDuringCallNotificationL( EFalse );
+            }
+            
+        case MEngineMonitor::EPEMessageColpNumberAvailable:
+            {
+            HandleColpNoteL( aCallId );            
+            }
+            break;   
         default:
+            {
             CPhoneGsmInCall::HandlePhoneEngineMessageL( aMessage, aCallId );
+            }
             break;
         }
     }
@@ -449,8 +465,6 @@
         iViewCommandHandle->ExecuteCommandL( EPhoneViewRemoveNumberEntry );
         }
     
-    HandleColpNoteL( aCallId );
-
     if ( aCallId != iWaitingCallId )
         {
         // Alerting call is connected
--- a/phoneapp/phoneuiutils/src/cphoneresourceresolverbase.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuiutils/src/cphoneresourceresolverbase.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -948,7 +948,7 @@
         case EPhoneEmergencyConnectWaitNote:
             if ( iVariationFlags & EOnscreenDialer )
                 {
-                retVal = R_PHONE_EMERGENCY_NETWORK_CONNECT_WAIT_NOTE_EMPTY_DIALER;
+                retVal = R_PHONE_EMERGENCY_NETWORK_CONNECT_WAIT_NOTE_DIALER;
                 }
             else
                 {
--- a/phoneapp/phoneuiview/inc/cphoneincallindicator.h	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuiview/inc/cphoneincallindicator.h	Fri Jan 29 17:12:32 2010 +0000
@@ -67,6 +67,12 @@
         * @param aCommandParam command parameter
         */
         void HandleCipheringChange( TPhoneCommandParam* aCommandParam );
+        
+        
+        /**
+        * return is emergency call active
+        */
+        TBool IsEmergencyCall();
 
     private:
 
--- a/phoneapp/phoneuiview/src/cphoneincallindicator.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuiview/src/cphoneincallindicator.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -307,5 +307,14 @@
     return KErrNone;
     }
 
+// ---------------------------------------------------------
+// CPhoneIncallIndicator::IsEmergencyCall
+// ---------------------------------------------------------
+//
+TBool CPhoneIncallIndicator::IsEmergencyCall()
+    {
+    return iEmergency;
+    }
+
 //  End of File  
 
--- a/phoneapp/phoneuiview/src/cphonetoolbarcontroller.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuiview/src/cphonetoolbarcontroller.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -130,6 +130,7 @@
             CleanupStack::Pop( button );
             CleanupStack::PopAndDestroy( tooltipText );
             }
+        TRAP_IGNORE(iToolbar->DisableToolbarL( ETrue ));
         }
     }
     
--- a/phoneapp/phoneuiview/src/cphoneviewcontroller.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneapp/phoneuiview/src/cphoneviewcontroller.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -3784,7 +3784,10 @@
 		iAppui->AddToStackL( iPhoneView );
 		iAppui->RemoveFromStack( iDialerView );
 		}
-	if ( !iPhoneView->IsSecurityMode() )
+    
+    // If securitymode or emergency call not show toolbar
+	if ( !iPhoneView->IsSecurityMode() && 
+	     !iIncallIndicator->IsEmergencyCall() )
 		{
     	iToolbarController->ShowToolbar();
 		}
--- a/phoneengine/PhoneCntFinder/ContactService/src/cphcntasynctosync.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneengine/PhoneCntFinder/ContactService/src/cphcntasynctosync.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -54,8 +54,13 @@
 TInt CPhCntAsyncToSync::MakeAsyncRequest()
     {
     iResponseReceived = EFalse;
-    TRAPD( err, DoMakeAsyncRequestL() );
-    if( !err )
+	// Return KErrInUse, if iWait is active.
+	TInt err( IsActive() ? KErrInUse : KErrNone );
+	if ( !err )
+		{
+		TRAP( err, DoMakeAsyncRequestL() );
+    	}
+	if( !err )
         {
         // Check that response is not already received, we cannot 
         // start the scheduler if response is received, otherwise
--- a/phoneengine/callhandling/group/callhandling.mmp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneengine/callhandling/group/callhandling.mmp	Fri Jan 29 17:12:32 2010 +0000
@@ -40,6 +40,7 @@
 SOURCE      cpesystemcallstate.cpp
 SOURCE      cpevideocallhandling.cpp
 SOURCE      cpecceobserver.cpp
+SOURCE      tpematcher.cpp
 
 USERINCLUDE     ../inc
 
@@ -57,6 +58,7 @@
 LIBRARY featmgr.lib // Feature manager. 
 LIBRARY flogger.lib
 LIBRARY phonesettings.lib
+LIBRARY centralrepository.lib   // CenRep.
 
 LANG            SC
 START WINS
--- a/phoneengine/callhandling/inc/cpecallhandling.h	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneengine/callhandling/inc/cpecallhandling.h	Fri Jan 29 17:12:32 2010 +0000
@@ -54,6 +54,7 @@
 class CCCECallParameters;
 class CPECCEObserver;
 class CPESystemCallState;
+class CRepository;
 
 // CLASS DECLARATION
 
@@ -648,6 +649,14 @@
          * @param aCall reference to call object
          */
         void SetCallOrigin( const TInt aCallId, const MCCECall& aCall ) const;
+        
+        /**
+         * Set COLP number to datastore if remote party number is 
+         * different from dialled number.
+         * @param aCallid.
+         * @param aCall reference to call object
+         */
+        void SetColpNumber( TInt aCallId, const MCCECall& aCall ) const;
 
     protected:
         // Phone model instance which owns this object.
@@ -689,6 +698,8 @@
         CPECCEObserver* iCCEObserver;
         // System Call State
         CPESystemCallState* iSystemCallState;
+        
+        CRepository* iRepository;
     };
 
 #endif    // CPECALLHANDLING_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/inc/tpematcher.h	Fri Jan 29 17:12:32 2010 +0000
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 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"
+* 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:  This file contains the header file of the class TPEMatcher. 
+*
+*/
+
+#ifndef TPEMATCHER_H_
+#define TPEMATCHER_H_
+
+#include <e32def.h>
+#include <e32cmn.h>
+
+class TPEMatcher 
+    {
+public:
+	
+	 /**
+    * C++ default constructor.
+    */
+    TPEMatcher();
+    
+   /**
+	  * Destructor.
+    */
+    ~TPEMatcher();
+    
+    /**
+     * Finds if the two numbers match. Numbers are matched from
+     * right to left. If either or both of the numbers passed as a parameter
+     * are shorter than aCount the shortes number count is used in
+     * matching.     
+     * 
+     * @since S60 v5.2
+     * @param aNumber1 phone number.
+     * @param aNumber2 phone number.
+     * @param aCount Digit count used to match numbers.
+     * @return Found match. 
+     */
+    TBool numbersMatch( const TDesC& aNumber1, const TDesC& aNumber2, TInt aCount );
+    
+    };
+
+
+#endif /* TPEMATCHER_H_ */
--- a/phoneengine/callhandling/src/cpecallhandling.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneengine/callhandling/src/cpecallhandling.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -29,6 +29,7 @@
 #include    "mpecallhandling.h"
 #include    "cpecceobserver.h"
 #include    "cpesystemcallstate.h"
+#include    "tpematcher.h"
 
 #include    <gsmerror.h>
 #include    <mpedatastore.h>
@@ -39,6 +40,8 @@
 #include    <mccecall.h>
 #include    <PsetSAObserver.h>
 #include    <cccecallparameters.h>
+#include    <centralrepository.h>
+#include    <telconfigcrkeys.h>
 
 // EXTERNAL DATA STRUCTURES
 // None
@@ -47,7 +50,7 @@
 // None
 
 // CONSTANTS
-// None
+const TInt KPEMatchDefault = 7;
 
 // MACROS
 // None
@@ -92,6 +95,7 @@
     {  
     TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::~CPECallHandling() start");
     
+    delete iRepository;
     delete iSystemCallState;
     delete iDtmfHandling;
     
@@ -164,6 +168,8 @@
     
     iSystemCallState = CPESystemCallState::NewL( *iCallArrayOwner, *iModel.DataStore() );
     
+    iRepository = CRepository::NewL( KCRUidTelConfiguration );
+    
     TEFLOGSTRING( KTAOBJECT, "CALL CPECallHandling::BaseConstructL() complete");
     }
 
@@ -442,7 +448,8 @@
             
             if( connectedCall )
                 {
-                CCPCall::TCallType callType = connectedCall->Call().Parameters().CallType();
+                MCCECall& call = connectedCall->Call();
+                CCPCall::TCallType callType = call.Parameters().CallType();
                 
                 if ( callType == CCPCall::ECallTypePS ) 
                     {
@@ -458,14 +465,20 @@
                         "CALL CPECallHandling::SendMessage -> EPEMessageRemotePartyInfoChanged->update call type to CS");
                     iCallOpenParams->SetCallType( CCPCall::ECallTypeCSVoice );
                     iModel.DataStore()->SetServiceIdCommand( 1 );
-                    iModel.DataStore()->SetCallType( EPECallTypeCSVoice, aCallId );    
+                    iModel.DataStore()->SetCallType( EPECallTypeCSVoice, aCallId );  
+                    SetColpNumber( aCallId, call );
                     }
+                
+                iModel.DataStore()->SetRemotePartyName( call.RemotePartyName(), aCallId );                
+                iModel.DataStore()->SetRemotePhoneNumber( call.RemoteParty(), aCallId );
+                iModel.DataStore()->SetCallIndex(call.CallIndex(), aCallId );
                 }
+            break;
             }
-       // Flow throught
-            
+                   
         case MEngineMonitor::EPEMessageIncoming:
             {
+            TEFLOGSTRING( KTAMESINT, "CALL CPECallHandling::SendMessage -> EPEMessageIncoming");
             CPESingleCall* callData = iCallArrayOwner->GetCallObject( aCallId );
             if( callData )
                 {
@@ -2419,5 +2432,40 @@
         }                
     }
 
+// -----------------------------------------------------------------------------
+// CPECallHandling::SetColpNumber
+// -----------------------------------------------------------------------------
+//
+void CPECallHandling::SetColpNumber( TInt aCallId, const MCCECall& aCall ) const
+    {
+    TEFLOGSTRING( KTAINT, "CALL CPECallHandling::SetColpNumber" );
+    
+    TInt errorCode( KErrNone );
+    TInt value( KPEMatchDefault );
+    TPEMatcher matcher;    
+    
+    const TPEPhoneNumber& origRemoteNumber = iModel.DataStore()->RemotePhoneNumber( aCallId );    
+    const TPEPhoneNumber& remoteNumber = aCall.RemoteParty();
+    
+    errorCode = iRepository->Get( KTelMatchDigits, value );
+
+    if ( !errorCode == KErrNone )
+        {
+        TEFLOGSTRING( KTAOBJECT, "Reading KTelMatchDigits failed, use default value for matching");
+        }    
+    
+    //check if remote number is different from dialled number
+    if ( !matcher.numbersMatch( origRemoteNumber, remoteNumber, value ) )
+        {
+        //set COLP number        
+        iModel.DataStore()->SetRemoteColpNumber( remoteNumber, aCallId );
+        
+        TEFLOGSTRING3( KTAMESINT, 
+                "CPECallHandling::SetColpNumber, colp number: '%S', call id: %d", 
+                &remoteNumber, aCallId );
+        }        
+    }
+        
+
 
 //  End of File 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phoneengine/callhandling/src/tpematcher.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 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""
+* 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: 
+*
+*/
+
+#include "tpematcher.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TPEMatcher::TPEMatcher()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//    
+TPEMatcher::~TPEMatcher()
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+// Finds if the two numbers match.
+// ---------------------------------------------------------------------------
+//
+TBool TPEMatcher::numbersMatch( const TDesC& aNumber1, const TDesC& aNumber2, TInt aCount )
+    {
+    TBool returnVal( EFalse );    
+    TInt matchDigits(aCount); 
+    
+    matchDigits = Min( matchDigits, aNumber1.Length() );
+    matchDigits = Min( matchDigits, aNumber2.Length() );
+    
+    TPtrC16 number1Ptr = aNumber1.Right(matchDigits);
+    TPtrC16 number2Ptr = aNumber2.Right(matchDigits);
+    
+    if ( number1Ptr.Match( number2Ptr ) != KErrNotFound )
+        {
+        returnVal = ETrue;
+        }
+    
+    return returnVal;
+    }
--- a/phoneengine/engineinfo/inc/cpeengineinfoimpl.h	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneengine/engineinfo/inc/cpeengineinfoimpl.h	Fri Jan 29 17:12:32 2010 +0000
@@ -1258,7 +1258,7 @@
         * @param aCallId, is the call identification number.
         */
         void SetRemoteColpNumber(
-            TPEPhoneNumber& aColpNumber, 
+            const TPEPhoneNumber& aColpNumber, 
             const TInt aCallId );
 
         /**
--- a/phoneengine/engineinfo/inc/mpedatastore.h	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneengine/engineinfo/inc/mpedatastore.h	Fri Jan 29 17:12:32 2010 +0000
@@ -735,7 +735,7 @@
          * @param aCallId, is the call identification number.
          */
          virtual void SetRemoteColpNumber(
-             TPEPhoneNumber& aColpNumber, 
+             const TPEPhoneNumber& aColpNumber, 
              const TInt aCallId ) = 0;
 
          /**
--- a/phoneengine/engineinfo/src/cpeengineinfoimpl.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneengine/engineinfo/src/cpeengineinfoimpl.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -2546,7 +2546,7 @@
 // -----------------------------------------------------------------------------
 //
 void CPEEngineInfoImpl::SetRemoteColpNumber(
-    TPEPhoneNumber& aColpNumber, 
+    const TPEPhoneNumber& aColpNumber, 
     const TInt aCallId )
     {
     return ( *iRemoteInfo )[ aCallId ]->SetColpNumber( aColpNumber );
Binary file phoneengine/phonemodel/conf/s60telephony.confml has changed
--- a/phoneengine/phonemodel/inc/cpemessagehandler.h	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneengine/phonemodel/inc/cpemessagehandler.h	Fri Jan 29 17:12:32 2010 +0000
@@ -504,10 +504,11 @@
         TInt HandleServiceEnabled();
         
         /**
-         * Handles remote party information changed         
+         * Handles remote party information changed   
+         * @param aCallId is the identification number of the call.               
          * @since Series60_5.2         
          */
-        void HandleRemotePartyInfoChanged( );
+        void HandleRemotePartyInfoChanged( const TInt aCallId );
 
         /**
         * Handles swap message from the phone application 
--- a/phoneengine/phonemodel/inc/pevirtualengine.h	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneengine/phonemodel/inc/pevirtualengine.h	Fri Jan 29 17:12:32 2010 +0000
@@ -419,7 +419,8 @@
 
         EPEMessageRemoteForwarding,
         EPEMessageMovedPermanently,        
-        EPEMessageMultipleChoices,        
+        EPEMessageMultipleChoices,     
+        EPEMessageColpNumberAvailable,
 
         // Contact messages                   3000 - 3999
         EPEMessageThumbnailLoadingCompleted  = 3000,
--- a/phoneengine/phonemodel/src/cpemessagehandler.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneengine/phonemodel/src/cpemessagehandler.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -1515,16 +1515,7 @@
             RemovePreAndPostFix( number );
   
             iDataStore.SetRemotePhoneNumber( number, aCallId );
-            }
-        
-        // The Colp number is stored to remoteparty in connected state.
-        TPEPhoneNumber colpNumber = iCallInfo->iRemoteParty.iRemoteNumber.iTelNumber;
-        RemovePreAndPostFix( colpNumber );
-        iDataStore.SetRemoteColpNumber( colpNumber, aCallId ); 
-        TEFLOGSTRING3( 
-            KTAMESINT, 
-            "PE CPEMessageHandler::SetPhoneNumberForCallLogging, colp number: '%S', call id: %d", 
-            &colpNumber, aCallId );
+            }            
         }
     else if ( iDataStore.CallDirection( aCallId ) == RMobileCall::EMobileTerminated )
         {
@@ -1750,9 +1741,6 @@
     // logging works OK (see CPEMessageHandler::SetPhoneNumberForCallLogging).  
     iDataStore.SetPhoneNumber( KNullDesC() );
     
-    // COLP number is updated in connected state 
-    UpdateRemotePartyInfo();
-   
     return ECCPErrorNone;
     }
 
@@ -2902,9 +2890,14 @@
 // CPEMessageHandler::HandleRemotePartyInfoChanged
 // -----------------------------------------------------------------------------
 //
-void CPEMessageHandler::HandleRemotePartyInfoChanged()
-    {
-    UpdateRemotePartyInfo();      
+void CPEMessageHandler::HandleRemotePartyInfoChanged( const TInt aCallId )
+    {        
+    UpdateRemotePartyInfo(); 
+    
+    if ( iDataStore.RemoteColpNumber( aCallId ).Length() )
+        {
+        iModel.SendMessage( MEngineMonitor::EPEMessageColpNumberAvailable );
+        }
     }
 
 
--- a/phoneengine/phonemodel/src/cpephonemodel.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneengine/phonemodel/src/cpephonemodel.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -1199,7 +1199,7 @@
             break;
             
         case MEngineMonitor::EPEMessageRemotePartyInfoChanged:
-            iMessageHandler->HandleRemotePartyInfoChanged( );
+            iMessageHandler->HandleRemotePartyInfoChanged( aCallId );
             break;    
 
         default:
--- a/phonesettings/pslncallimageplugin/src/PslnCallImagePlugin.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phonesettings/pslncallimageplugin/src/PslnCallImagePlugin.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -336,13 +336,10 @@
     	{
     	TInt active = static_cast<CPslnCallImagePluginContainer*>
                     (iContainer)->CurrentSelectionIndexL();
-        // Set menu item as Apply, if:
-        // a) 'None' is selected
-        // b) highlight is on inactive selection
-    	if ( active != iContainer->iListBox->CurrentItemIndex() && 
-    	    ( active == EPlsnCallImageNone || 
-    	      active ==  EPlsnCallImageThemeImage ) )
-        	{
+        // Set menu item is used when inactive item is focused and it 
+		// activates the focused item.
+    	if ( active != iContainer->iListBox->CurrentItemIndex() )
+    		{
         	aMenuPane->SetItemDimmed( EPslnCmdAppActivate, EFalse );
         	aMenuPane->SetItemDimmed( EPslnCmdAppDownload, ETrue );
         	}
--- a/phoneuis/BubbleManager/Src/BMBubbleOutlookBottomCnap.cpp	Mon Jan 25 15:04:17 2010 +0000
+++ b/phoneuis/BubbleManager/Src/BMBubbleOutlookBottomCnap.cpp	Fri Jan 29 17:12:32 2010 +0000
@@ -357,7 +357,7 @@
             BubbleUtils::LayoutLabel( 
                 iTimerCost, 
                 rect, 
-                BubbleLayout2::popup_call2_audio_first_call_state_text(20) );
+                BubbleLayout2::popup_call2_audio_first_call_state_text(19) );
                 
             // Build call object bubble
             iBubble->SetRect( bubbleRect.Rect() );