New release based on our 2010wk04 release
authormikaruus <mika.a.ruuskanen@nokia.com>
Fri, 22 Jan 2010 10:04:04 +0200
changeset 6 942573423a60
parent 5 8ccc39f9d787
child 7 fa67e03b87df
New release based on our 2010wk04 release
adaptationlayer/tsy/nokiatsy_dll/inc/cmmphonebookoperationdelete.h
adaptationlayer/tsy/nokiatsy_dll/src/cmmphonebookoperationdelete.cpp
connectivitylayer/isimessage/isimessage_dll/src/tisi.cpp
connectivitylayer/isimessage/isimessagekernel_dll/src/isikernel.cpp
--- a/adaptationlayer/tsy/nokiatsy_dll/inc/cmmphonebookoperationdelete.h	Thu Jan 14 10:44:58 2010 +0200
+++ b/adaptationlayer/tsy/nokiatsy_dll/inc/cmmphonebookoperationdelete.h	Fri Jan 22 10:04:04 2010 +0200
@@ -176,7 +176,7 @@
         * @param aFileData File data
         * @return KErrNone or error value
         */
-        TInt HandleWriteMBIReadResp(TInt aStatus, TUint8 aDetails, const TDesC8& aFileData );
+        TInt HandleWriteMBIReadResp(TInt aStatus, TUint8 aDetails, TBool &aComplete, const TDesC8& aFileData );
         
         /**
         * Creates request to Delete MBI profile
--- a/adaptationlayer/tsy/nokiatsy_dll/src/cmmphonebookoperationdelete.cpp	Thu Jan 14 10:44:58 2010 +0200
+++ b/adaptationlayer/tsy/nokiatsy_dll/src/cmmphonebookoperationdelete.cpp	Fri Jan 22 10:04:04 2010 +0200
@@ -156,9 +156,11 @@
 
             if( PB_MBDN_FID == iFileId )
                 {
+                // Store MBI Profile
+                iMBIProfileType = iIndex;
                 // For MBDN PhoneBook first read MBI file 
                 // Check if the mailbox inidcation type is correct
-                if( iIndex <= iMmPhoneBookStoreMessHandler->
+                if( iIndex < iMmPhoneBookStoreMessHandler->
                         iPBStoreConf[iArrayIndex].iMbiRecLen )
                     {
                     iCurrentDeletePhase = EPBDeletePhase_Read_MBI_profile;
@@ -178,15 +180,38 @@
             }
         case EMmTsyPhoneBookStoreDeleteAllIPC:
             {
-            iNumOfEntries = iMmPhoneBookStoreMessHandler->
-                iPBStoreConf[iArrayIndex].iNoOfRecords;
-            if ( iNumOfEntries )
+            if( PB_MBDN_FID != iFileId)
+                {
+                iNumOfEntries = iMmPhoneBookStoreMessHandler->
+                    iPBStoreConf[iArrayIndex].iNoOfRecords;
+                if ( iNumOfEntries )
+                    {
+                    // Start to delete entries from the last one
+                    iIndex = iNumOfEntries;
+                    ret = UiccPbReqDelete();
+                    iNumOfEntries--;
+                    }
+                }
+            else
                 {
-                // Start to delete entries from the last one
-                iIndex = iNumOfEntries;
-                ret = UiccPbReqDelete();
-                iNumOfEntries--;
+                // For first Profile Type Read
+                iMBIProfileType = 0;
+                iIndex = iMBIProfileType;
+                // For MBDN PhoneBook first read MBI file 
+                // Check if the mailbox inidcation type is correct
+                if( iMBIProfileType < iMmPhoneBookStoreMessHandler->
+                        iPBStoreConf[iArrayIndex].iMbiRecLen )
+                    {
+                    iCurrentDeletePhase = EPBDeletePhase_Read_MBI_profile;
+                    // read MBDN record number from MBI first record Profile number
+                    ret = UiccPbReqReadMBI();
+                    }
+                else
+                    {
+                    ret = KErrArgument;
+                    }
                 }
+                
             break;
             }
 #ifdef INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS
@@ -216,7 +241,7 @@
 TFLOGSTRING3("TSY: CMmPhoneBookOperationDelete::UiccPbReqDelete, iTransId:%d,index:%d", iTransId, iIndex);
 OstTraceExt2( TRACE_NORMAL, CMmPhoneBookOperationDelete_UICCPBREQWRITEL, "CMmPhoneBookOperationDelete::UiccPbReqDelete;iTransId=%hhu;iIndex=%hd", iTransId, iIndex );
 
-    TInt ret( KErrNotSupported );
+    TInt ret( KErrArgument );
 
     switch ( iFileId )
         {
@@ -420,7 +445,7 @@
         cmdParams.fileId = PB_MBI_FID;
         cmdParams.serviceType =  UICC_APPL_READ_LINEAR_FIXED ;
         cmdParams.dataAmount = 1;
-        cmdParams.dataOffset = iIndex;
+        cmdParams.dataOffset = iMBIProfileType;
         cmdParams.record = 1;   // only first profile number is supported
         
         
@@ -461,7 +486,7 @@
     cmdParams.fileId = PB_MBI_FID;
     cmdParams.serviceType =  UICC_APPL_READ_LINEAR_FIXED ;
     cmdParams.dataAmount = 1;
-    cmdParams.dataOffset = iIndex;
+    cmdParams.dataOffset = iMBIProfileType;
     cmdParams.record = 1;   // only first profile number is supported
 
     // Append FileData needs to be write
@@ -601,18 +626,42 @@
 TInt CMmPhoneBookOperationDelete::HandleWriteMBIReadResp(
         TInt aStatus,
         TUint8 aDetails,
+        TBool &aComplete,
         const TDesC8 &aFileData ) 
     {
     TInt ret ( KErrNone );
 TFLOGSTRING("TSY: CMmPhoneBookOperationDelete::HandleWriteMBIReadResp");
 OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONDELETE_HANDLEWRITEMBIREADRESP, "CMmPhoneBookOperationDelete::HandleWriteMBIReadResp" );
 
-    // Store MBI Profile
-    iMBIProfileType = iIndex;
     if( UICC_STATUS_OK  == aStatus )
         {
         iIndex = aFileData[0];
-        ret = UiccPbReqDelete();
+        if( ( 0 != iIndex ) && ( iIndex <= iMmPhoneBookStoreMessHandler->
+                iPBStoreConf[iArrayIndex].iNoOfRecords ) )
+            {
+            ret = UiccPbReqDelete();
+            }
+        else
+            {
+            // Again read next MBI Profile type
+            iMBIProfileType++;
+            if ( EMmTsyPhoneBookStoreDeleteAllIPC == iIpc &&
+                    ( iMBIProfileType < iMmPhoneBookStoreMessHandler->
+                            iPBStoreConf[iArrayIndex].iMbiRecLen ) )
+                {
+                iCurrentDeletePhase = EPBDeletePhase_Read_MBI_profile;
+                // read MBDN record number from MBI first record Profile number
+                ret = UiccPbReqReadMBI();
+                }
+            else
+                {
+                if( EMmTsyPhoneBookStoreDeleteIPC == iIpc )
+                    {
+                    ret = KErrArgument;
+                    }
+                aComplete = ETrue;
+                }
+            }
         }
     else
         {
@@ -647,7 +696,6 @@
     TInt ret( KErrNone );
     TBool complete( EFalse );
 
-    TInt maxNumLength( 0 );
     TInt location( 0 );
 
     if ( UICC_STATUS_OK == aStatus )
@@ -735,8 +783,6 @@
                     {
                         // Ready for complete
                         complete = ETrue;
-                        maxNumLength = iMmPhoneBookStoreMessHandler->
-                            iPBStoreConf[iArrayIndex].iNumlength;
                     if ( EMmTsyPhoneBookStoreDeleteAllIPC == iIpc &&
                         iNumOfEntries )
                         {
@@ -749,8 +795,6 @@
                         {
                         // Ready for complete
                         complete = ETrue;
-                        maxNumLength = iMmPhoneBookStoreMessHandler->
-                            iPBStoreConf[iArrayIndex].iNumlength;
                         // In case of delete all location is 0
                         if ( EMmTsyPhoneBookStoreDeleteIPC == iIpc )
                             {
@@ -762,7 +806,7 @@
                 }
             case EPBDeletePhase_Read_MBI_profile:
                 {
-                ret = HandleWriteMBIReadResp( aStatus, aDetails, aFileData );
+                ret = HandleWriteMBIReadResp( aStatus, aDetails, complete, aFileData );
                 break;
                 }
             case EPBDeletePhase_delete_MBI_profile:
@@ -780,11 +824,28 @@
                     }
                 else
                     {
-                    // Ready for complete
-                    complete = ETrue;
-                    maxNumLength = iMmPhoneBookStoreMessHandler->
-                        iPBStoreConf[iArrayIndex].iNumlength;
-                    location = iMBIProfileType;
+                    // Continue deleting entries
+                    // increment iMBIProfileType to read next profile
+                    iMBIProfileType++;
+                    
+                    if ( EMmTsyPhoneBookStoreDeleteAllIPC == iIpc &&
+                        ( iMBIProfileType < iMmPhoneBookStoreMessHandler->
+                                iPBStoreConf[iArrayIndex].iMbiRecLen ) )
+                        {
+                        iCurrentDeletePhase = EPBDeletePhase_Read_MBI_profile;
+                        // read MBDN record number from MBI first record Profile number
+                        ret = UiccPbReqReadMBI();
+                        }
+                    else
+                        {
+                        // Ready for complete
+                        complete = ETrue;
+                        // In case of delete all location is 0
+                        if ( EMmTsyPhoneBookStoreDeleteIPC == iIpc )
+                            {
+                            location = iMBIProfileType - 1 ;
+                            }
+                        }
                     }
                 break;
                 }
@@ -813,7 +874,8 @@
     if ( complete )
         {
         TPBEntryInfo pbEntryInfo;
-        pbEntryInfo.iMaxNumLength = maxNumLength;
+        pbEntryInfo.iMaxNumLength = iMmPhoneBookStoreMessHandler->
+        iPBStoreConf[iArrayIndex].iNumlength;
         pbEntryInfo.iLocation = location;
 
         CPhoneBookDataPackage phoneBookData;
--- a/connectivitylayer/isimessage/isimessage_dll/src/tisi.cpp	Thu Jan 14 10:44:58 2010 +0200
+++ b/connectivitylayer/isimessage/isimessage_dll/src/tisi.cpp	Fri Jan 22 10:04:04 2010 +0200
@@ -554,21 +554,43 @@
     C_TRACE( ( _T ( "TIsiSend::Complete, length: 0x%x, calcfinallength: 0x%x" ), length, calcFinalLength ) );
     OstTraceExt2( TRACE_NORMAL, DUP1_TISISEND_COMPLETE, "TIsiSend::Complete;length=%hu;calcFinalLength=%hu", length, calcFinalLength );
     
-    if( iFinalLength == 0 )    // TIsiSend alternative constructor used
-       {
-           TUint8 byte1 = ( TUint8 )( ( length & 0xff00 ) >> 8 );
-           TUint8 byte2 = ( TUint8 )( length & 0x00ff );        
-           this->Set8bit( ISI_HEADER_OFFSET_LENGTH, byte1 );        // BE
-           this->Set8bit( ISI_HEADER_OFFSET_LENGTH + 1, byte2 );    // BE
-       }
-    else
-       {
-           TUint8 byte1 = ( TUint8 )( ( calcFinalLength & 0xff00 ) >> 8 );
-           TUint8 byte2 = ( TUint8 )( calcFinalLength & 0x00ff );        
-           this->Set8bit( ISI_HEADER_OFFSET_LENGTH, byte1 );        // BE
-           this->Set8bit( ISI_HEADER_OFFSET_LENGTH + 1, byte2 );    // BE               
-           iBuffer.SetLength( iFinalLength );
-       }
+    #if defined( __WINS__ ) || defined( __WINSCW__ )
+        {
+         if( iFinalLength == 0 )    // TIsiSend alternative constructor used
+            {
+                TUint8 byte1 = ( TUint8 )( ( length & 0xff00 ) >> 8 );
+                TUint8 byte2 = ( TUint8 )( length & 0x00ff );        
+                this->Set8bit( ISI_HEADER_OFFSET_LENGTH, byte1 );        // BE
+                this->Set8bit( ISI_HEADER_OFFSET_LENGTH + 1, byte2 );    // BE
+            }
+         else
+            {
+                TUint8 byte1 = ( TUint8 )( ( calcFinalLength & 0xff00 ) >> 8 );
+                TUint8 byte2 = ( TUint8 )( calcFinalLength & 0x00ff );        
+                this->Set8bit( ISI_HEADER_OFFSET_LENGTH, byte1 );        // BE
+                this->Set8bit( ISI_HEADER_OFFSET_LENGTH + 1, byte2 );    // BE               
+                iBuffer.SetLength( iFinalLength );
+            }
+        }
+    #else
+        {
+         if( iFinalLength == 0 )    // TIsiSend alternative constructor used
+                {
+                TUint8 byte1 = ( TUint8 )( ( length & 0xff00 ) >> 8 );
+                TUint8 byte2 = ( TUint8 )( length & 0x00ff );        
+                this->Set8bit( ISI_HEADER_OFFSET_LENGTH, byte2 );        // LE
+                this->Set8bit( ISI_HEADER_OFFSET_LENGTH + 1, byte1 );    // LE
+                }
+            else
+                {
+                TUint8 byte1 = ( TUint8 )( ( calcFinalLength & 0xff00 ) >> 8 );
+                TUint8 byte2 = ( TUint8 )( calcFinalLength & 0x00ff );        
+                this->Set8bit( ISI_HEADER_OFFSET_LENGTH, byte2 );        // LE
+                this->Set8bit( ISI_HEADER_OFFSET_LENGTH + 1, byte1 );    // LE               
+                iBuffer.SetLength( iFinalLength );
+                }
+        }
+    #endif    
 
     C_TRACE( ( _T ( "TIsiSend::Complete, byte2: 0x%x, byte1: 0x%x" ), iBuffer[5], iBuffer[4] ) );
     OstTraceExt2( TRACE_NORMAL, DUP2_TISISEND_COMPLETE, "TIsiSend::Complete;byte2=%hhu;byte1=%hhu", iBuffer[5], iBuffer[4] );
--- a/connectivitylayer/isimessage/isimessagekernel_dll/src/isikernel.cpp	Thu Jan 14 10:44:58 2010 +0200
+++ b/connectivitylayer/isimessage/isimessagekernel_dll/src/isikernel.cpp	Fri Jan 22 10:04:04 2010 +0200
@@ -561,17 +561,38 @@
     COMPONENT_TRACE( ( _T ( "TIsiKernelSend::Complete, length: 0x%x, calcfinallength: 0x%x" ), length, calcFinalLength ) );
     OstTraceExt2( TRACE_NORMAL, DUP1_TISIKERNELSEND_COMPLETE, "TIsiKernelSend::Complete;length=%hu;calcFinalLength=%hu", length, calcFinalLength );
     
-    if( iFinalLength == 0 )    // TIsiKernelSend alternative constructor used
-        {               
-        iBuffer[ ISI_HEADER_OFFSET_LENGTH ] = static_cast<TUint8>( (length & 0xff00) >> 8);   //BE             
-        iBuffer[ ISI_HEADER_OFFSET_LENGTH + 1 ] = static_cast<TUint8>(length & 0x00ff);    //BE
+    #if defined( __WINS__ ) || defined( __WINSCW__ )
+        {
+        if( iFinalLength == 0 )    // TIsiKernelSend alternative constructor used
+            {               
+            iBuffer[ ISI_HEADER_OFFSET_LENGTH ] = static_cast<TUint8>( (length & 0xff00) >> 8);   //BE             
+            iBuffer[ ISI_HEADER_OFFSET_LENGTH + 1 ] = static_cast<TUint8>(length & 0x00ff);    //BE
+            }
+        else
+            {
+            iBuffer[ ISI_HEADER_OFFSET_LENGTH ] = static_cast<TUint8>( (calcFinalLength & 0xff00 ) >> 8);   //BE             
+            iBuffer[ ISI_HEADER_OFFSET_LENGTH + 1 ] = static_cast<TUint8>(calcFinalLength & 0x00ff);    //BE
+            iBuffer.SetLength( iFinalLength );                
+            }
+        }        
+        
+    #else
+        {
+        if( iFinalLength == 0 )    // TIsiKernelSend alternative constructor used
+            {
+            iBuffer[ ISI_HEADER_OFFSET_LENGTH +1 ] = static_cast<TUint8>( (length & 0xff00) >> 8);   //LE             
+            iBuffer[ ISI_HEADER_OFFSET_LENGTH ] = static_cast<TUint8>(length & 0x00ff);    //LE               
+           }
+        else
+            {              
+            iBuffer[ ISI_HEADER_OFFSET_LENGTH +1 ] = static_cast<TUint8>( (calcFinalLength & 0xff00) >> 8);   //LE             
+            iBuffer[ ISI_HEADER_OFFSET_LENGTH ] = static_cast<TUint8>(calcFinalLength & 0x00ff);    //LE
+            iBuffer.SetLength( iFinalLength );                                
+             }
+        OstTraceExt2( TRACE_NORMAL, DUP2_TISIKERNELSEND_COMPLETE, "TIsiKernelSend::Complete;byte2=%hhu;byte1=%hhu", iBuffer[5], iBuffer[4] );
+        COMPONENT_TRACE( ( _T ( "TIsiKernelSend::Complete, byte2: 0x%x, byte1: 0x%x" ), iBuffer[5], iBuffer[4] ) );
         }
-    else
-        {
-        iBuffer[ ISI_HEADER_OFFSET_LENGTH ] = static_cast<TUint8>( (calcFinalLength & 0xff00 ) >> 8);   //BE             
-        iBuffer[ ISI_HEADER_OFFSET_LENGTH + 1 ] = static_cast<TUint8>(calcFinalLength & 0x00ff);    //BE
-        iBuffer.SetLength( iFinalLength );                
-        }
+    #endif    
 
     COMPONENT_TRACE( ( _T ( "TIsiKernelSend::Complete - return, buffer length = 0x%x, iFinalLength = 0x%x" ), length, iFinalLength ) );
     OstTraceExt2( TRACE_NORMAL, DUP3_TISIKERNELSEND_COMPLETE, "TIsiKernelSend::Complete - return;buffer length=%hu;iFinalLength=%u", length, iFinalLength );