connectivitymodules/SeCon/servers/pcconn/src/sconpcconnserver.cpp
changeset 40 b63e67867dcd
parent 20 e1de7d03f843
child 44 8f5e655bff70
equal deleted inserted replaced
39:9905f7d46607 40:b63e67867dcd
     1 /*
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include <s32mem.h> // For RMemReadStream
    19 #include <s32mem.h> // For RMemReadStream
    20 #include <utf.h>
    20 #include <utf.h>
       
    21 #include <Etel3rdParty.h>
       
    22 #include <f32file.h>
    21 
    23 
    22 #include "sconpcconnclientserver.h"
    24 #include "sconpcconnclientserver.h"
    23 #include "sconpcconnserver.h"
    25 #include "sconpcconnserver.h"
    24 #include "sconpcd.h"
    26 #include "sconpcd.h"
    25 #include "sconcsc.h"
    27 #include "sconcsc.h"
    26 #include "sconconmlhandler.h"
    28 #include "sconconmlhandler.h"
       
    29 #include "sconimsireader.h"
       
    30 #include "sconoviaccounthandler.h"
       
    31 #include "sconfolderlister.h"
       
    32 #include "sconbtengine.h"
    27 #include "debug.h"
    33 #include "debug.h"
    28 
    34 
    29 #ifdef DEBUG_XML
    35 #ifdef DEBUG_XML
    30 #include <s32file.h>
    36 #include <s32file.h>
    31 _LIT8( KTimeFormat, "%02d:%02d:%02d.%03d" );
    37 _LIT8( KTimeFormat, "%02d:%02d:%02d.%03d" );
    32 _LIT8( KXmlBegin, "\nXML:\n" );
    38 _LIT8( KXmlBegin, "\nXML:\n" );
    33 #endif
    39 #endif
    34 
    40 
    35 _LIT( KSCONGetMetadataRequest, "METADATA:" );
    41 _LIT( KSCONGetMetadataRequest, "METADATA:" );
       
    42 _LIT8( KSCONSyncRequest, "SYNC:" );
       
    43 _LIT( KSCONReadImsi, "READIMSI");
       
    44 _LIT( KSCONReadNetworkInfo, "READNETWORKINFO");
       
    45 _LIT( KSCONReadOviAccount, "READOVIACCOUNT");
       
    46 _LIT( KSCONListPath, "LISTP:");
       
    47 _LIT( KSCONReadBtInfo, "READBTINFO" );
       
    48 _LIT( KSCONSetBtPower, "SETBTPOWER:" );
       
    49 _LIT( KSCONSetBtName, "SETBTNAME:" );
       
    50 _LIT( KSCONSetBtAuthorized, "SETBTAUTHORIZED:" );
    36 
    51 
    37 //------------------------------------------------------------
    52 //------------------------------------------------------------
    38 // Global functions 
    53 // Global functions 
    39 //------------------------------------------------------------
    54 //------------------------------------------------------------
    40 
    55 
   270         delete iBuffer;
   285         delete iBuffer;
   271         iBuffer = NULL;
   286         iBuffer = NULL;
   272         }
   287         }
   273         
   288         
   274     iChunk.Close();
   289     iChunk.Close();
   275         
   290     delete iFolderLister;
       
   291     
       
   292     iFs.Close();
       
   293     
       
   294     delete iBtEngine;
       
   295      
   276     TRACE_FUNC_EXIT;
   296     TRACE_FUNC_EXIT;
   277     }
   297     }
   278 
   298 
   279 // -----------------------------------------------------------------------------
   299 // -----------------------------------------------------------------------------
   280 // CSConPCConnSession::NewL()
   300 // CSConPCConnSession::NewL()
   302     {
   322     {
   303     TRACE_FUNC_ENTRY;
   323     TRACE_FUNC_ENTRY;
   304     TInt ret ( KErrNone );
   324     TInt ret ( KErrNone );
   305     iResult = KErrNone;
   325     iResult = KErrNone;
   306     
   326     
       
   327     User::LeaveIfError( iFs.Connect() );
       
   328     
   307 #ifdef DEBUG_XML
   329 #ifdef DEBUG_XML
   308     // create log file 
   330     // create log file 
   309     RFs fs;
       
   310     User::LeaveIfError( fs.Connect () );
       
   311     CleanupClosePushL( fs );
       
   312     
   331     
   313     RFile file;
   332     RFile file;
   314     TInt err = file.Create ( fs, KSConConMLDebugFile, EFileWrite );
   333     TInt err = file.Create ( iFs, KSConConMLDebugFile, EFileWrite );
   315     if( err == KErrNone )
   334     if( err == KErrNone )
   316         {
   335         {
   317         // file created, close it
   336         // file created, close it
   318         file.Close();
   337         file.Close();
   319         }       
   338         }              
   320     
       
   321     CleanupStack::PopAndDestroy( &fs );               
       
   322 #endif
   339 #endif
   323     
   340     
   324     // initialize buffer
   341     // initialize buffer
   325     iBuffer = CBufFlat::NewL ( KSConPCConnBufferMaxSize );
   342     iBuffer = CBufFlat::NewL ( KSConPCConnBufferMaxSize );
   326     
   343     
   353             {
   370             {
   354             LOGGER_WRITE_1( "CSConPCConnSession::ConstructL() : Parser dll load failed with error code %d", ret );
   371             LOGGER_WRITE_1( "CSConPCConnSession::ConstructL() : Parser dll load failed with error code %d", ret );
   355             User::Leave ( ret );
   372             User::Leave ( ret );
   356             }
   373             }
   357         }
   374         }
   358 
   375     
       
   376     iFolderLister = CSconFolderLister::NewL( iFs );
       
   377     
   359     TRACE_FUNC_EXIT;
   378     TRACE_FUNC_EXIT;
   360     }
   379     }
   361 
   380 
   362 // -----------------------------------------------------------------------------
   381 // -----------------------------------------------------------------------------
   363 // CSConPCConnSession::ServiceL()
   382 // CSConPCConnSession::ServiceL()
   455 
   474 
   456 
   475 
   457     iBuffer->Reset();
   476     iBuffer->Reset();
   458 
   477 
   459     length = buf.ReadInt32L();
   478     length = buf.ReadInt32L();
   460     HBufC8* name = HBufC8::NewLC( length );
   479     HBufC8* name8 = HBufC8::NewLC( length );
   461     TPtr8 namePtr = name->Des();
   480     TPtr8 namePtr8 = name8->Des();
   462     buf.ReadL( namePtr, length);
   481     buf.ReadL( namePtr8, length);
       
   482     
       
   483     const TUint8* ptr8 = namePtr8.Ptr();
       
   484     const TUint16* ptr16 = reinterpret_cast<const TUint16*>( ptr8 );
       
   485     TPtrC namePtr;
       
   486     namePtr.Set( ptr16, length/2 );
   463         
   487         
   464     length = buf.ReadInt32L();
   488     length = buf.ReadInt32L();
   465     HBufC8* type = HBufC8::NewLC( length );
   489     HBufC8* type = HBufC8::NewLC( length );
   466     TPtr8 typePtr = type->Des();
   490     TPtr8 typePtr = type->Des();
   467     buf.ReadL( typePtr, length);
   491     buf.ReadL( typePtr, length);
   476     iBuffer->Write( 0, dataPtr );
   500     iBuffer->Write( 0, dataPtr );
   477             
   501             
   478     buf.Close();
   502     buf.Close();
   479     
   503     
   480 #ifdef DEBUG_XML
   504 #ifdef DEBUG_XML
   481     RFs fs;
       
   482     User::LeaveIfError( fs.Connect() );
       
   483     CleanupClosePushL( fs );
       
   484 
   505 
   485     RFile file;
   506     RFile file;
   486     if ( file.Open( fs, KSConConMLDebugFile, EFileWrite ) == KErrNone )
   507     if ( file.Open( iFs, KSConConMLDebugFile, EFileWrite ) == KErrNone )
   487         {
   508         {
   488         RFileWriteStream fws;
   509         RFileWriteStream fws;
   489         TInt fileSize;
   510         TInt fileSize;
   490         file.Size( fileSize );
   511         file.Size( fileSize );
   491         
   512         
   505         TRAP_IGNORE( fws.CommitL() );
   526         TRAP_IGNORE( fws.CommitL() );
   506         fws.Close();
   527         fws.Close();
   507  
   528  
   508         CleanupStack::PopAndDestroy( &fws );
   529         CleanupStack::PopAndDestroy( &fws );
   509         }
   530         }
   510     file.Close();   
   531     file.Close();
   511     CleanupStack::PopAndDestroy( &fs );
       
   512 #endif
   532 #endif
   513     
   533     if ( ( ( typePtr.CompareC( KSConPCDWBXMLObjectType)== KErrNone ) || 
   514     if ( ( typePtr.Compare( KSConPCDWBXMLObjectType ) == KErrNone) || 
   534                  ( typePtr.CompareC( KSConPCDWBXMLObjectType2 )== KErrNone ) )
       
   535                  && namePtr8.Find(KSCONSyncRequest) == 0 )
       
   536         {
       
   537         LOGGER_WRITE_1("Sync request: %S", &namePtr);
       
   538         RBufReadStream stream( *iBuffer );
       
   539         
       
   540         CleanupClosePushL( stream );
       
   541         TRAP( ret, iPCDHandler->HandlePutSyncRequestL( namePtr8, stream ));
       
   542         if ( ret )
       
   543             {
       
   544             LOGGER_WRITE_1("HandlePutSyncRequestL() Leaved with %d", ret);
       
   545             }
       
   546         
       
   547         CleanupStack::PopAndDestroy( &stream );
       
   548         }
       
   549     else if ( ( typePtr.Compare( KSConPCDWBXMLObjectType ) == KErrNone) || 
   515          ( typePtr.Compare( KSConPCDWBXMLObjectType2 )== KErrNone) )
   550          ( typePtr.Compare( KSConPCDWBXMLObjectType2 )== KErrNone) )
   516         {
   551         {
   517         LOGGER_WRITE( "CSConPCConnSession::HandlePutMessageL() : Object type PCD " );
   552         LOGGER_WRITE( "CSConPCConnSession::HandlePutMessageL() : Object type PCD " );
   518         TRAPD( err, ret = iConMLHandler->ParseDocumentL( *iBuffer, this ) );    
   553         TRAPD( err, ret = iConMLHandler->ParseDocumentL( *iBuffer, this ) );    
   519         if ( err != KErrNone )
   554         if ( err != KErrNone )
   531         LOGGER_WRITE( "Object type not regognized " );
   566         LOGGER_WRITE( "Object type not regognized " );
   532         ret = KErrNotSupported;
   567         ret = KErrNotSupported;
   533         }
   568         }
   534     CleanupStack::PopAndDestroy( data );
   569     CleanupStack::PopAndDestroy( data );
   535     CleanupStack::PopAndDestroy( type );
   570     CleanupStack::PopAndDestroy( type );
   536     CleanupStack::PopAndDestroy( name );
   571     CleanupStack::PopAndDestroy( name8 );
   537     LOGGER_WRITE_1( "CSConPCConnSession::HandlePutMessageL() end : Heap count : %d", User::Heap().Count() );
   572     LOGGER_WRITE_1( "CSConPCConnSession::HandlePutMessageL() end : Heap count : %d", User::Heap().Count() );
   538     LOGGER_WRITE_1( "CSConPCConnSession::HandlePutMessageL() : returned %d", ret );    
   573     LOGGER_WRITE_1( "CSConPCConnSession::HandlePutMessageL() : returned %d", ret );    
   539     return ret;
   574     return ret;
   540     }
   575     }
   541 
   576 
   585     if ( typePtr.Compare( KSConCapabilityObjectType ) == KErrNone )
   620     if ( typePtr.Compare( KSConCapabilityObjectType ) == KErrNone )
   586         {
   621         {
   587         ret = iCSCHandler->CapabilityObject( *iBuffer );
   622         ret = iCSCHandler->CapabilityObject( *iBuffer );
   588         
   623         
   589 #ifdef DEBUG_XML
   624 #ifdef DEBUG_XML
   590         RFs fs;
   625         
   591         User::LeaveIfError(fs.Connect());
       
   592         CleanupClosePushL(fs);
       
   593 
       
   594         RFile file;
   626         RFile file;
   595         if ( file.Open(fs, KSConConMLDebugFile, EFileWrite ) == KErrNone )
   627         if ( file.Open(iFs, KSConConMLDebugFile, EFileWrite ) == KErrNone )
   596             {
   628             {
   597             RFileWriteStream fws;
   629             RFileWriteStream fws;
   598             TInt fileSize;
   630             TInt fileSize;
   599             file.Size ( fileSize );
   631             file.Size ( fileSize );
   600             TTime now;
   632             TTime now;
   614             fws.Close();
   646             fws.Close();
   615 
   647 
   616             CleanupStack::PopAndDestroy( &fws );
   648             CleanupStack::PopAndDestroy( &fws );
   617             }
   649             }
   618         file.Close();
   650         file.Close();
   619         CleanupStack::PopAndDestroy( &fs );
       
   620 #endif
   651 #endif
   621 
   652 
   622         }
   653         }
   623     else if (  typePtr.CompareC( KSConPCDWBXMLObjectType) == KErrNone )
   654     else if (  typePtr.CompareC( KSConPCDWBXMLObjectType) == KErrNone )
   624         {
   655         {
   625         ret = HandleWBXMLGetRequestL( namePtr );
   656         if ( namePtr8.Find(KSCONSyncRequest) == 0 ) // 8-bit search
       
   657             {
       
   658             LOGGER_WRITE("Sync request");
       
   659             
       
   660             RBufWriteStream stream( *iBuffer );
       
   661                 
       
   662             CleanupClosePushL( stream );
       
   663             
       
   664             TRAP( ret, iPCDHandler->HandleGetSyncRequestL( namePtr8, stream, iChunk.MaxSize() - sizeof(TInt32) ));
       
   665             if ( ret )
       
   666                 {
       
   667                 LOGGER_WRITE_1("HandleGetSyncRequestL() Leaved with %d", ret);
       
   668                 }
       
   669             stream.CommitL();
       
   670             CleanupStack::PopAndDestroy( &stream );
       
   671             
       
   672             LOGGER_WRITE_1("iBuffer size: %d", iBuffer->Size());
       
   673             
       
   674             }
       
   675         else if ( namePtr.Find(KSCONReadImsi) == 0 ) // 16-bit search
       
   676             {
       
   677             LOGGER_WRITE("Read IMSI");
       
   678             TBuf<CTelephony::KIMSISize> imsi;
       
   679             ret = CSconImsiReader::GetImsiL( imsi );
       
   680             
       
   681             if ( ret == KErrNone )
       
   682                 {
       
   683                 TBuf8<CTelephony::KIMSISize> imsi8;
       
   684                 User::LeaveIfError( CnvUtfConverter::ConvertFromUnicodeToUtf8(imsi8,imsi) );
       
   685                 
       
   686                 iBuffer->ResizeL( imsi8.Length() );
       
   687                 iBuffer->Write( 0, imsi8 );
       
   688                 }
       
   689             else
       
   690                 {
       
   691                 // Change error code more generic
       
   692                 ret = KErrNotFound;
       
   693                 }
       
   694             }
       
   695         else if ( namePtr.Find(KSCONReadNetworkInfo) == 0 ) // 16-bit search
       
   696             {
       
   697             LOGGER_WRITE("Read NetworkInfo");
       
   698             CTelephony::TRegistrationStatus regStatus;
       
   699             ret = CSconImsiReader::GetNetworkStatusL( regStatus );
       
   700             
       
   701             if ( ret == KErrNone )
       
   702                 {
       
   703                 RBufWriteStream stream( *iBuffer );
       
   704                 CleanupClosePushL( stream );
       
   705                 stream.WriteInt8L( regStatus );
       
   706                 stream.CommitL();
       
   707                 CleanupStack::PopAndDestroy( &stream );
       
   708                 }
       
   709             else
       
   710                 {
       
   711                 // Change error code more generic
       
   712                 ret = KErrNotFound;
       
   713                 }
       
   714             }
       
   715         else if ( namePtr.Find(KSCONReadOviAccount) == 0 )
       
   716             {
       
   717             LOGGER_WRITE("Read Ovi account");
       
   718             RBufWriteStream stream( *iBuffer );
       
   719             CleanupClosePushL( stream );
       
   720             
       
   721             ret = ReadOviAccountInfoL( stream );
       
   722             stream.CommitL();
       
   723             CleanupStack::PopAndDestroy( &stream );
       
   724             
       
   725             }
       
   726         else if ( namePtr.Find(KSCONListPath) == 0 )
       
   727             {
       
   728             LOGGER_WRITE("List path");
       
   729             // LISTP:0:pathname
       
   730             if ( namePtr.Length() > KSCONListPath().Length()+2)
       
   731                 {
       
   732                 TPtrC pathname = namePtr.Mid( KSCONListPath().Length()+2 );
       
   733             
       
   734                 const TUint16 levelsChar = namePtr[ KSCONListPath().Length() ];
       
   735                 TInt level(KErrNotFound);
       
   736                 if ( levelsChar >= TChar('0') )
       
   737                     {
       
   738                     level = levelsChar - TChar('0');
       
   739                     }
       
   740                 
       
   741                 RBufWriteStream stream( *iBuffer );
       
   742                 CleanupClosePushL( stream );
       
   743                 TRAP( ret, iFolderLister->GenerateFolderListL( stream, pathname, level ));
       
   744                 LOGGER_WRITE_1("GenerateFolderListL leaved with err: %d", ret);
       
   745                 stream.CommitL();
       
   746                 CleanupStack::PopAndDestroy( &stream );
       
   747                 }
       
   748             else
       
   749                 {
       
   750                 ret = KErrArgument;
       
   751                 }
       
   752             
       
   753             }
       
   754         else if ( namePtr.Find(KSCONReadBtInfo) == 0 )
       
   755             {
       
   756             LOGGER_WRITE( "Read BT info");
       
   757             if ( !iBtEngine )
       
   758                 {
       
   759                 iBtEngine = CSconBtEngine::NewL();
       
   760                 }
       
   761             RBufWriteStream stream( *iBuffer );
       
   762             CleanupClosePushL( stream );
       
   763             TRAP( ret, iBtEngine->ReadBTInfoL( stream ) );
       
   764             LOGGER_WRITE_1("ReadBTInfoL leaved with err: %d", ret);
       
   765             stream.CommitL();
       
   766             CleanupStack::PopAndDestroy( &stream );
       
   767             }
       
   768         else if ( namePtr.Find(KSCONSetBtPower) == 0 )
       
   769             {
       
   770             LOGGER_WRITE( "Change BT Power state");
       
   771             if ( namePtr.Length() == KSCONSetBtPower().Length()+1 )
       
   772                 {
       
   773                 const TUint16 lastChar = namePtr[ KSCONSetBtPower().Length() ];
       
   774                 TBool changeBtOn;
       
   775                 if ( lastChar == TChar('0') )
       
   776                     {
       
   777                     changeBtOn = EFalse;
       
   778                     }
       
   779                 else if ( lastChar == TChar('1') )
       
   780                     {
       
   781                     changeBtOn = ETrue;
       
   782                     }
       
   783                 else
       
   784                     {
       
   785                     ret = KErrArgument;
       
   786                     }
       
   787                 
       
   788                 if ( !ret )
       
   789                     {
       
   790                     if ( !iBtEngine )
       
   791                        {
       
   792                        iBtEngine = CSconBtEngine::NewL();
       
   793                        }
       
   794                     TInt err = iBtEngine->SetBtPowerState( changeBtOn );
       
   795                     
       
   796                     RBufWriteStream stream( *iBuffer );
       
   797                     CleanupClosePushL( stream );
       
   798                     stream.WriteInt32L( err );
       
   799                     stream.CommitL();
       
   800                     CleanupStack::PopAndDestroy( &stream );
       
   801                     }
       
   802                 }
       
   803             else
       
   804                 {
       
   805                 ret = KErrArgument;
       
   806                 }
       
   807             }
       
   808         else if ( namePtr.Find(KSCONSetBtName) == 0 )
       
   809             {
       
   810             LOGGER_WRITE( "Set BT Name");
       
   811             TPtrC btName = namePtr.Mid( KSCONSetBtName().Length() );
       
   812             TInt err = iBtEngine->SetBtName( btName  );
       
   813             
       
   814             RBufWriteStream stream( *iBuffer );
       
   815             CleanupClosePushL( stream );
       
   816             stream.WriteInt32L( err );
       
   817             stream.CommitL();
       
   818             CleanupStack::PopAndDestroy( &stream );
       
   819             }
       
   820         else if ( namePtr.Find(KSCONSetBtAuthorized) == 0 )
       
   821             {
       
   822             LOGGER_WRITE( "Set BT Authorized");
       
   823             ret = KErrArgument;
       
   824             // SETBTAUTHORIZED:0:00245f8d6a26
       
   825             // 1. param = auth. state ("0"=off, "1"=true)
       
   826             // 2. param = bt address (hex string)
       
   827             
       
   828             if ( namePtr.Length() > KSCONSetBtAuthorized().Length()+2)
       
   829                 {
       
   830                 TPtrC btAddr = namePtr.Mid( KSCONSetBtAuthorized().Length()+2 );
       
   831                 
       
   832                 const TUint16 authStateChar = namePtr[ KSCONSetBtAuthorized().Length() ];
       
   833                 TBool authorize(EFalse);
       
   834                 if ( authStateChar == TChar('0') )
       
   835                     {
       
   836                     authorize = EFalse;
       
   837                     ret = KErrNone;
       
   838                     }
       
   839                 else if ( authStateChar == TChar('1') )
       
   840                     {
       
   841                     authorize = ETrue;
       
   842                     ret = KErrNone;
       
   843                     }
       
   844                 
       
   845                 if ( !iBtEngine )
       
   846                    {
       
   847                    iBtEngine = CSconBtEngine::NewL();
       
   848                    }
       
   849                 TRAPD(err, iBtEngine->SetBtAuthorizedL( btAddr, authorize ) );
       
   850                 
       
   851                 RBufWriteStream stream( *iBuffer );
       
   852                 CleanupClosePushL( stream );
       
   853                 stream.WriteInt32L( err );
       
   854                 stream.CommitL();
       
   855                 CleanupStack::PopAndDestroy( &stream );
       
   856                 }
       
   857             
       
   858             }
       
   859         else 
       
   860             {
       
   861             ret = HandleWBXMLGetRequestL( namePtr );
       
   862             }
   626         }
   863         }
   627     else
   864     else
   628         {
   865         {
   629         LOGGER_WRITE( "CSConPCConnSession::HandleGetMessageL() : Header type not regognized " );
   866         LOGGER_WRITE( "CSConPCConnSession::HandleGetMessageL() : Header type not regognized " );
   630         ret = KErrNotSupported;
   867         ret = KErrNotSupported;
   758 #endif
   995 #endif
   759     TRACE_FUNC_RET(ret);
   996     TRACE_FUNC_RET(ret);
   760     return ret;
   997     return ret;
   761     }
   998     }
   762 
   999 
       
  1000 
       
  1001 // -----------------------------------------------------------------------------
       
  1002 // CSConPCConnSession::ReadOviAccountInfoL()
       
  1003 // Reads ovi account information to stream
       
  1004 // -----------------------------------------------------------------------------
       
  1005 //
       
  1006 TInt CSConPCConnSession::ReadOviAccountInfoL( RWriteStream& aAccountInfoStream )
       
  1007     {
       
  1008 	TRACE_FUNC_ENTRY;
       
  1009     RLibrary oviaccounthandlerLib;
       
  1010     CleanupClosePushL( oviaccounthandlerLib );
       
  1011     // Dynamically load DLL
       
  1012     TInt err = oviaccounthandlerLib.Load( KSconOviAccountHandlerDllName );
       
  1013     if ( err )
       
  1014         {
       
  1015         LOGGER_WRITE_1("oviaccounthandlerLib.Load err: %d", err);
       
  1016         err = KErrNotSupported;
       
  1017         }
       
  1018     else if( oviaccounthandlerLib.Type()[1] != KSconOviAccountHandlerDllUid )
       
  1019         {
       
  1020         LOGGER_WRITE_1( "KSconOviAccountHandlerDllUid incorrect... (0x%08X)",oviaccounthandlerLib.Type()[1].iUid  );
       
  1021         err = KErrNotSupported;
       
  1022         }
       
  1023     
       
  1024     if ( err == KErrNone )
       
  1025         {
       
  1026         TSConCreateCSconOviAccountHandlerFunc CreateCSconOviAccountHandlerL =
       
  1027         (TSConCreateCSconOviAccountHandlerFunc)oviaccounthandlerLib.Lookup(1);
       
  1028         
       
  1029         CSconOviAccountHandler* oviAccountHandler = (CSconOviAccountHandler*)CreateCSconOviAccountHandlerL();
       
  1030         
       
  1031         TRAP(err, oviAccountHandler->GetOviAccountDetailsL( aAccountInfoStream ) );
       
  1032         LOGGER_WRITE_1("GetOviAccountDetailsL err: %d", err);
       
  1033         
       
  1034         delete oviAccountHandler;
       
  1035         oviAccountHandler = NULL;
       
  1036         
       
  1037         if ( err )
       
  1038             {
       
  1039             // change error code
       
  1040             err = KErrNotFound;
       
  1041             }
       
  1042         }
       
  1043     else
       
  1044         {
       
  1045         err = KErrNotSupported;
       
  1046         }
       
  1047 	
       
  1048     CleanupStack::PopAndDestroy( &oviaccounthandlerLib );
       
  1049 	TRACE_FUNC_EXIT;
       
  1050     return err;
       
  1051     }
       
  1052 
   763 // -----------------------------------------------------------------------------
  1053 // -----------------------------------------------------------------------------
   764 // CSConPCConnSession::HandleResetMessage()
  1054 // CSConPCConnSession::HandleResetMessage()
   765 // Resets the PCCS service
  1055 // Resets the PCCS service
   766 // -----------------------------------------------------------------------------
  1056 // -----------------------------------------------------------------------------
   767 //
  1057 //
   876     TRACE_FUNC_ENTRY;
  1166     TRACE_FUNC_ENTRY;
   877     TInt ret ( KErrNone );
  1167     TInt ret ( KErrNone );
   878     
  1168     
   879 #ifdef DEBUG_XML
  1169 #ifdef DEBUG_XML
   880     iConMLHandler->GenerateDocument( aContent );
  1170     iConMLHandler->GenerateDocument( aContent );
   881     RFs fs;
       
   882     User::LeaveIfError(fs.Connect());
       
   883     CleanupClosePushL(fs);
       
   884     RFile file;
  1171     RFile file;
   885     
  1172     if ( file.Open(iFs, KSConConMLDebugFile, EFileWrite) == KErrNone )
   886     if ( file.Open(fs, KSConConMLDebugFile, EFileWrite) == KErrNone )
       
   887         {
  1173         {
   888         RFileWriteStream fws;
  1174         RFileWriteStream fws;
   889         TInt fileSize;
  1175         TInt fileSize;
   890         file.Size( fileSize );
  1176         file.Size( fileSize );
   891         fws.Attach ( file, fileSize );
  1177         fws.Attach ( file, fileSize );
   908         TRAP_IGNORE( fws.CommitL() );
  1194         TRAP_IGNORE( fws.CommitL() );
   909         fws.Close();
  1195         fws.Close();
   910         CleanupStack::PopAndDestroy( &fws );
  1196         CleanupStack::PopAndDestroy( &fws );
   911         }
  1197         }
   912     file.Close();
  1198     file.Close();
   913     CleanupStack::PopAndDestroy( &fs );
       
   914     
  1199     
   915 #endif
  1200 #endif
   916 
  1201 
   917 
  1202 
   918     if ( aContent )
  1203     if ( aContent )
  2214         if ( aResult->iComplete )
  2499         if ( aResult->iComplete )
  2215             {
  2500             {
  2216             aContent->complete = new ( ELeave ) pcdata_t();
  2501             aContent->complete = new ( ELeave ) pcdata_t();
  2217             }
  2502             }
  2218         AppendProgressL( aContent, aResult->iProgress );
  2503         AppendProgressL( aContent, aResult->iProgress );
       
  2504         
       
  2505         if ( aResult->iData && aResult->iData->Length() > 0 )
       
  2506             {
       
  2507             aContent->data = new ( ELeave ) pcdata_t();
       
  2508             aContent->data->SetDataL( aResult->iData->Des() );
       
  2509             }
  2219         }
  2510         }
  2220     TRACE_FUNC_EXIT;
  2511     TRACE_FUNC_EXIT;
  2221     }
  2512     }
  2222     
  2513     
  2223 // -----------------------------------------------------------------------------
  2514 // -----------------------------------------------------------------------------
  2236             LOGGER_WRITE( "CSConPCConnSession::AppendUninstallResultsL() Complete" );
  2527             LOGGER_WRITE( "CSConPCConnSession::AppendUninstallResultsL() Complete" );
  2237             aContent->complete = new ( ELeave ) pcdata_t();
  2528             aContent->complete = new ( ELeave ) pcdata_t();
  2238             }
  2529             }
  2239         LOGGER_WRITE_1( "CSConPCConnSession::AppendUninstallResultsL() iProgress: %d", aResult->iProgress );
  2530         LOGGER_WRITE_1( "CSConPCConnSession::AppendUninstallResultsL() iProgress: %d", aResult->iProgress );
  2240         AppendProgressL( aContent, aResult->iProgress );
  2531         AppendProgressL( aContent, aResult->iProgress );
       
  2532         
       
  2533         if ( aResult->iData && aResult->iData->Length() > 0 )
       
  2534             {
       
  2535             aContent->data = new ( ELeave ) pcdata_t();
       
  2536             aContent->data->SetDataL( aResult->iData->Des() );
       
  2537             }
  2241         }
  2538         }
  2242     TRACE_FUNC_EXIT;
  2539     TRACE_FUNC_EXIT;
  2243     }
  2540     }
  2244     
  2541     
  2245 // -----------------------------------------------------------------------------
  2542 // -----------------------------------------------------------------------------