Revision: 201021 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 10:18:03 +0300
branchRCL_3
changeset 25 6bf66e3b8f31
parent 22 71268bfa7aea
child 30 13725ba12484
Revision: 201021 Kit: 2010123
engines/vmbxengine/src/vmnumber.cpp
phonesrv_plat/call_remote_party_information_api/call_remote_party_information_api.metaxml
phonesrv_plat/default_emergency_numbers_api/default_emergency_numbers_api.metaxml
phonesrv_plat/voice_mailbox_number_api/inc/vmnumber.h
--- a/engines/vmbxengine/src/vmnumber.cpp	Tue May 25 13:18:28 2010 +0300
+++ b/engines/vmbxengine/src/vmnumber.cpp	Wed Jun 09 10:18:03 2010 +0300
@@ -181,7 +181,7 @@
                                 iVmSpsHandler( NULL ),
                                 iVmBsHandler( NULL ),
                                 iFeatMgrInitialized( EFalse ),
-                                iSimCardFound( EFalse )
+                                iSimCardFound( EFalse )              
     {
     VMBLOGSTRING( "VMBX: RVmbxNumber::RVmbxNumber =>" );
 
@@ -425,10 +425,13 @@
                 {
                 // try open vmbx-phonebook next
                 iPhoneBookType = EVMBXPhoneBook;
+                iMbdnPhonebookOk = EFalse;
+                VMBLOGSTRING( "no mbdn file is found, use vmbx phonebook" );
                 }
             else
                 {
                 iPhoneBookType = EMBDNPhoneBook;
+                iMbdnPhonebookOk = ETrue;
                 // if mbdn file can be found, set the entry index to EAlsLine1
                 iPhoneVoicemailInfo.iVoice = EAlsLine1;
 
@@ -467,6 +470,9 @@
 
         if ( EAlsLine2 == alsline || EVMBXPhoneBook == iPhoneBookType )
             {
+            // the mbdn number is not used when line2 is active
+            // the number is only got from vmbx-phonebook
+            iMbdnPhonebookOk = EFalse;
             // try to open vmbx-type phonebook
             result = iPhoneBook.Open( iPhone, KETelIccVoiceMailBox );
             VMBLOGSTRING2( "Vmbx phonebook opening result = %I ", result );
@@ -475,8 +481,10 @@
                 // check that this phonebook supports reading
                 result = PhoneBookInfo();
                 VMBLOGSTRING( "VmbxPhoneBook opened" );
-                }
+                }            	
             }
+        VMBLOGSTRING3( "VMBX: RVmbxNumber::Open: \
+        iMbdnPhonebookOk: %I, iNoNumberFound: %I", iMbdnPhonebookOk, iNoNumberFound );
         // reopen mbdn-phonebook when vmbx-phonebook has no number
         if ( iMbdnPhonebookOk && iNoNumberFound )
            {
@@ -500,7 +508,6 @@
                }
            }
 
-
         // set readonly state if aquired
         if ( IsReadOnlySIM() )
             {
@@ -1685,6 +1692,8 @@
     // in order to always allow saving.
     TInt lineNumber( aEntry );
     TInt error( KErrNone );
+    VMBLOGSTRING2( "VMBX: RVmbxNumber::SaveVmbxNumberToPhone \
+    the number is from phone or SIM aNumber = %S", &aNumber );
 
     if ( aEntry == EAlsActiveLineEntry )
         {
@@ -2375,8 +2384,14 @@
         iAlphaStringFromSIM = NULL;
         }
     iAlphaStringFound = EFalse;
-
-    if ( iPhoneBookType == EMBDNPhoneBook )
+    
+    TInt lineNumber( EAlsLine1 );
+    if ( KErrNone != GetAlsLine( lineNumber ) )
+    	{
+        lineNumber = EAlsLine1;
+    	}
+
+    if ( ( iPhoneBookType == EMBDNPhoneBook ) && ( EAlsLine1 == lineNumber ) )
         {
         VMBLOGSTRING( "start MBDN PhoneBook read" );
         VMBLOGSTRING2( "VMBX: RVmbxNumber::PhonebookReadL: \
@@ -2606,8 +2621,14 @@
 TInt RVmbxNumber::PhonebookDelete( TVmbxEntry& aEntry )
     {
     VMBLOGSTRING( "VMBX: RVmbxNumber::PhonebookDelete: =>" );
+    TInt lineNumber( EAlsLine1 );
+    if ( KErrNone != GetAlsLine( lineNumber ) )
+        {
+        lineNumber = EAlsLine1;
+        }
+    
     TRequestStatus status( KErrNone );
-    if ( iPhoneBookType == EMBDNPhoneBook )
+    if ( ( iPhoneBookType == EMBDNPhoneBook ) && ( EAlsLine1 == lineNumber ) )
         {
         TInt index = iPhoneVoicemailInfo.iVoice;
         iPhoneBook.Delete( status, index );
@@ -4240,7 +4261,7 @@
 
 // -----------------------------------------------------------------------------
 // RVmbxNumber::ClearVMBXNumberFromPhone
-// Fetches VMBX number from backup store
+// Clear VMBX number is from SIM from the phone memory
 // -----------------------------------------------------------------------------
 //
 TInt RVmbxNumber::ClearVMBXNumberFromPhone( TInt aLineNumber )
@@ -4393,6 +4414,8 @@
     {
     TInt error( KErrNone );
     TBuf< KVmbxMaxNumberLength > line2number;
+    
+    TInt inactiveLineNumber( EAlsLine2 );
 
     VMBLOGSTRING( "VMBX: RVmbxNumber::HandleNumberStores: =>" );
 
@@ -4423,8 +4446,18 @@
         if ( !UserEditNumber( aLineNumber ) && 
                 !IsPhoneMemForcedEdit( aLineNumber ) )
             {
-            ClearVMBXNumberFromPhone( EAlsLine1 );
-            ClearVMBXNumberFromPhone( EAlsLine2 );
+            ClearVMBXNumberFromPhone( aLineNumber );
+            // if the number was not edited in inactive line,
+            // and do clearing opreration. 
+            // The old stored number from SIM is erased.
+            // otherwise, the edited number was 
+            // defined as the inactive line number.
+            // the number should be kept
+            if ( !IsInactiveLineEdited( inactiveLineNumber ) )
+            	{
+                ClearVMBXNumberFromPhone( inactiveLineNumber );
+            	}
+            
             VMBLOGSTRING( "[VMBX]: RVmbxNumber::HandleNumberStores: Clear old VMBX number" );
             }
         }
@@ -4434,8 +4467,11 @@
         if ( !UserEditNumber( aLineNumber ) 
                 && !IsPhoneMemForcedEdit( aLineNumber ) )
             {
-            ClearVMBXNumberFromPhone( EAlsLine1 );
-            ClearVMBXNumberFromPhone( EAlsLine2 );
+            ClearVMBXNumberFromPhone( aLineNumber );
+            if ( !IsInactiveLineEdited( inactiveLineNumber ) )
+                {
+                ClearVMBXNumberFromPhone( inactiveLineNumber );
+                }
             VMBLOGSTRING( "VMBX: RVmbxNumber::HandleNumberStores: Clear old VMBX number" );
             }
         }
@@ -4605,4 +4641,48 @@
     return result;
     }
 
+// -----------------------------------------------------------------------------
+// RVmbxNumber::IsInactiveLineEdited
+// Check whether the number had been edited in inactive line
+// -----------------------------------------------------------------------------
+//
+TBool RVmbxNumber::IsInactiveLineEdited( TInt& aInactiveLineNumber )
+	{
+	VMBLOGSTRING( "VMBX: RVmbxNumber::IsInactiveLineEdited: =>" );
+	TBool result( EFalse );
+	
+	TInt activeLineNumber( EAlsLine1 );
+	TInt inactiveLineNumber( aInactiveLineNumber );
+	
+	// get the current ALS line
+	if ( KErrNone != GetAlsLine( activeLineNumber ) )
+	    {
+	    activeLineNumber = EAlsLine1;  
+	    }
+	else
+		{
+	    // get the inactive line
+	    if ( EAlsLine1 == activeLineNumber )
+	    	{
+	        inactiveLineNumber = EAlsLine2;
+	    	}
+	    else
+	    	{
+	        inactiveLineNumber = EAlsLine1;
+	    	}
+	    // check whether the number had been edited in inactive line before
+	    if ( UserEditNumber( inactiveLineNumber ) 
+	    		|| IsPhoneMemForcedEdit( inactiveLineNumber ) )
+	    	{
+	        result = ETrue;
+	    	}
+		}
+	// get the inactive line number, make it be the output argument
+	aInactiveLineNumber = inactiveLineNumber;
+	
+	VMBLOGSTRING2( "VMBX: RVmbxNumber::IsInactiveLineEdited: result = %d",
+	result );
+	return result;
+	}
+
 //  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesrv_plat/call_remote_party_information_api/call_remote_party_information_api.metaxml	Wed Jun 09 10:18:03 2010 +0300
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="b7a47dc0a3590edb71ae7d1ab16022a3" dataversion="2.0">
+  <name>call_remote_party_information_api</name>
+  <description>This API provides remote party information of ongoing calls.</description>
+  <type>c++</type>
+  <collection>telutils</collection>
+  <libs>
+    <lib name="telephonyservice.lib"/>
+  </libs>
+  <release category="platform" sinceversion="5.2"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/phonesrv_plat/default_emergency_numbers_api/default_emergency_numbers_api.metaxml	Wed Jun 09 10:18:03 2010 +0300
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="1415c3e1b254038cedfe73cdad7ebc93" dataversion="2.0">
+  <name>default_emergency_numbers_api</name>
+  <description>Central Repository keys for default emergency numbers.</description>
+  <type>c++</type>
+  <collection>phoneclientserver</collection>
+  <libs/>
+  <release category="platform" sinceversion="5.0"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/phonesrv_plat/voice_mailbox_number_api/inc/vmnumber.h	Tue May 25 13:18:28 2010 +0300
+++ b/phonesrv_plat/voice_mailbox_number_api/inc/vmnumber.h	Wed Jun 09 10:18:03 2010 +0300
@@ -1203,6 +1203,14 @@
          * @return ETrue if the note should be shown
          */
         TBool IsNoNumberNoteAllowed();
+        
+        /**
+         * Check whether the number had been edited in inactive line 
+         * @since S60 v5.2
+         * @param aInactiveLineNumber the inactive line number
+         * @return ETrue if the number had been edited in inactive line
+         */
+        TBool IsInactiveLineEdited( TInt& aInactiveLineNumber );
 
     private:  // data