# HG changeset patch # User William Roberts # Date 1279813081 -3600 # Node ID 3d9988ee47f52c5b06bde2dcedefd51ce5768232 # Parent bf039b7fe409d9e1e747dd3979168436f161576e# Parent aa5a574040a43dd5842d6b81686f78e0304f656e Catchup to latest Symbian^4 diff -r bf039b7fe409 -r 3d9988ee47f5 clfwrapper/ClientSrc/CCLFServerProxy.cpp --- a/clfwrapper/ClientSrc/CCLFServerProxy.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/clfwrapper/ClientSrc/CCLFServerProxy.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -32,7 +32,7 @@ // CONSTANTS const TInt KCLFDefaultBufferLength( 64 ); const TInt KCLFDefaultArrayGranularity( 4 ); -const TInt KCLFExtensionArrayGranularity( 50 ); +const TInt KCLFExtensionArrayGranularity( 51 ); _LIT( KCLFDriveLetterFormatString, ":\\" ); const TInt KCLFDriveC( 'C' ); @@ -93,6 +93,7 @@ _LIT( KExtensionWmv, "wmv" ); _LIT( KExtensionAvi, "avi" ); _LIT( KExtensionDivx, "divx" ); +_LIT( KExtensionAsf, "asf" ); // ======== MEMBER FUNCTIONS ======== @@ -1285,6 +1286,7 @@ iExtensionArray->InsertIsqL( KExtensionWmv ); iExtensionArray->InsertIsqL( KExtensionAvi ); iExtensionArray->InsertIsqL( KExtensionDivx ); + iExtensionArray->InsertIsqL( KExtensionAsf ); } // End of File diff -r bf039b7fe409 -r 3d9988ee47f5 group/bld.inf --- a/group/bld.inf Fri Jun 25 13:56:30 2010 +0100 +++ b/group/bld.inf Thu Jul 22 16:38:01 2010 +0100 @@ -17,6 +17,7 @@ #include +#include "../locationmanager/inc/locplatsupport.mmh" #include "../metadataengine/group/bld.inf" #include "../locationmanager/group/bld.inf" @@ -34,7 +35,22 @@ DEFAULT PRJ_EXPORTS -../rom/mds.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) + +#if defined(_LOC_GEOTAGGING_CELLID) +#ifdef _LOC_REVERSEGEOCODE +../rom/mds_cellid_reverse_geocode_enabled.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) +#else +../rom/mds_cellidenabled.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) +#endif +#elif defined(_LOC_REVERSEGEOCODE) +#ifdef _LOC_GEOTAGGING_CELLID +../rom/mds_cellid_reverse_geocode_enabled.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) +#else +../rom/mds_reverse_geocode_enabled_only.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) +#endif +#else +../rom/mds.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mds.iby) +#endif #ifdef RD_MDS_2_5 ../rom/ContentListingFramework.iby CORE_MW_LAYER_IBY_EXPORT_PATH( ContentListingFramework.iby ) diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/blacklistclient/group/blacklistclient.mmp --- a/harvester/blacklistclient/group/blacklistclient.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/blacklistclient/group/blacklistclient.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -28,6 +28,7 @@ USERINCLUDE ../../blacklistserver/inc USERINCLUDE ../../common/inc USERINCLUDE ../../../inc +USERINCLUDE ../traces SOURCEPATH ../src SOURCE blacklistclient.cpp diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/blacklistclient/src/blacklistclient.cpp --- a/harvester/blacklistclient/src/blacklistclient.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/blacklistclient/src/blacklistclient.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -20,6 +20,11 @@ #include "mdcserializationbuffer.h" #include "blacklistitem.h" #include "harvesterlog.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "blacklistclientTraces.h" +#endif + // --------------------------------------------------------------------------- @@ -38,6 +43,7 @@ EXPORT_C RBlacklistClient::~RBlacklistClient() { WRITELOG( "RBlacklistClient::~RBlacklistClient - begin" ); + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_RBLACKLISTCLIENT, "RBlacklistClient::~RBlacklistClient -begin" ); RSessionBase::Close(); iBlacklistMemoryTable.ResetAndDestroy(); @@ -46,6 +52,8 @@ iFs.Close(); WRITELOG( "RBlacklistClient::~RBlacklistClient - end" ); + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_RBLACKLISTCLIENT, "RBlacklistClient::~RBlacklistClient - end" ); + } // --------------------------------------------------------------------------- @@ -55,7 +63,8 @@ EXPORT_C TInt RBlacklistClient::Connect() { WRITELOG( "RBlacklistClient::Connect - begin" ); - + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_CONNECT, "RBlacklistClient::Connect - begin" ); + iSessionOk = EFalse; TInt error = iFs.Connect(); @@ -83,7 +92,8 @@ } WRITELOG( "RBlacklistClient::Connect - end" ); - + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_CONNECT, "RBlacklistClient::Connect - end" ); + return error; } @@ -94,7 +104,8 @@ TVersion RBlacklistClient::Version() const { WRITELOG( "RBlacklistClient::Version - begin" ); - + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_VERSION, "RBlacklistClient::Version - begin" ); + return TVersion( KBlacklistServerMajorVersion, KBlacklistServerMinorVersion, KBlacklistServerBuildVersion ); @@ -107,6 +118,7 @@ TInt RBlacklistClient::StartServer() { WRITELOG( "RBlacklistClient::StartServer - begin" ); + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_STARTSERVER, "RBlacklistClient::StartServer - begin" ); RProcess server; TInt error = server.Create( KBlacklistServerExe, KNullDesC ); @@ -132,7 +144,8 @@ server.Close(); WRITELOG( "RBlacklistClient::StartServer - end" ); - + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_STARTSERVER, "RBlacklistClient::StartServer - end" ); + return error; } @@ -143,7 +156,8 @@ void RBlacklistClient::RemoveFromDBL( const TDesC& aUri, TUint32 aMediaId ) const { WRITELOG( "RBlacklistClient::RemoveFromDBL - begin" ); - + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_REMOVEFROMDBL, "RBlacklistClient::RemoveFromDBL - begin" ); + TPckgBuf mediaIdPckg( aMediaId ); TIpcArgs ipcArgs; @@ -154,6 +168,8 @@ User::LeaveIfError( err ); WRITELOG( "RBlacklistClient::RemoveFromDBL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_REMOVEFROMDBL, "RBlacklistClient::RemoveFromDBL end" ); + } // --------------------------------------------------------------------------- @@ -163,7 +179,8 @@ void RBlacklistClient::DoLoadBlacklistL( TInt& aHandle ) const { WRITELOG( "RBlacklistClient::DoLoadBlacklistL - begin" ); - + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_DOLOADBLACKLISTL, "RBlacklistClient::DoLoadBlacklistL - begin" ); + TPckgBuf handleBuf; TIpcArgs ipcArgs; ipcArgs.Set( 1, &handleBuf ); @@ -172,6 +189,8 @@ aHandle = handleBuf(); WRITELOG( "RBlacklistClient::DoLoadBlacklistL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_DOLOADBLACKLISTL, "RBlacklistClient::DoLoadBlacklistL - end" ); + } // --------------------------------------------------------------------------- @@ -181,7 +200,8 @@ EXPORT_C void RBlacklistClient::LoadBlacklistL() { WRITELOG( "RBlacklistClient::LoadBlacklistL - begin" ); - + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_LOADBLACKLISTL, "RBlacklistClient::LoadBlacklistL - begin" ); + if ( !iSessionOk ) { return; @@ -238,6 +258,8 @@ CleanupStack::PopAndDestroy( name ); WRITELOG( "RBlacklistClient::LoadBlacklistL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_LOADBLACKLISTL, "RBlacklistClient::LoadBlacklistL - end" ); + } // --------------------------------------------------------------------------- @@ -248,7 +270,8 @@ const TDesC& aUri, const TUint32 aMediaId ) { WRITELOG( "RBlacklistClient::AddToMemoryTableL - begin" ); - + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_ADDTOMEMORYTABLEL, "RBlacklistClient::AddToMemoryTableL - begin" ); + CBlacklistItem* item = CBlacklistItem::NewL( aModified, aUri, aMediaId ); const TInt err = iBlacklistMemoryTable.Append( item ); // ownership is transferred @@ -259,6 +282,8 @@ WRITELOG( "RBlacklistClient::AddToMemoryTableL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_ADDTOMEMORYTABLEL, "RBlacklistClient::AddToMemoryTableL - end" ); + } // --------------------------------------------------------------------------- @@ -268,7 +293,8 @@ void RBlacklistClient::RemoveFromMemoryTableL( const TDesC& aUri, const TUint32 aMediaId ) { WRITELOG( "RBlacklistClient::RemoveFromMemoryTableL - begin" ); - + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL, "RBlacklistClient::RemoveFromMemoryTableL - begin" ); + const TInt index = GetListIndex( aUri, aMediaId ); if ( index >= 0 ) { @@ -278,6 +304,8 @@ } WRITELOG( "RBlacklistClient::RemoveFromMemoryTableL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL, "RBlacklistClient::RemoveFromMemoryTableL - end" ); + } @@ -288,6 +316,8 @@ EXPORT_C TBool RBlacklistClient::IsBlacklistedL( const TDesC& aUri, TUint32 aMediaId, TTime /*aLastModifiedTime*/ ) { WRITELOG( "RBlacklistClient::IsBlacklistedL - begin" ); + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_ISBLACKLISTEDL, "RBlacklistClient::IsBlacklistedL - begin" ); + if ( !iSessionOk ) { @@ -316,6 +346,8 @@ if ( modified == fileLastModified.Int64() ) { WRITELOG( "RBlacklistClient::IsBlacklistedL - file is blacklisted, modification time is the same" ); + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_ISBLACKLISTEDL, "RBlacklistClient::IsBlacklistedL - file is blacklisted, modification time is the same" ); + return ETrue; } else @@ -331,12 +363,16 @@ else { WRITELOG( "RBlacklistClient::IsBlacklistedL - file is blacklisted, no modification time found" ); + OstTrace0( TRACE_NORMAL, DUP2_RBLACKLISTCLIENT_ISBLACKLISTEDL, "RBlacklistClient::IsBlacklistedL - file is blacklisted, no modification time found" ); + return ETrue; } } WRITELOG( "RBlacklistClient::IsBlacklistedL - end" ); + OstTrace0( TRACE_NORMAL, DUP3_RBLACKLISTCLIENT_ISBLACKLISTEDL, "RBlacklistClient::IsBlacklistedL - end" ); + return EFalse; } @@ -347,7 +383,8 @@ TInt RBlacklistClient::GetListIndex( const TDesC& aUri, TUint32 aMediaId ) { WRITELOG( "RBlacklistClient::GetListIndex - begin" ); - + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_GETLISTINDEX, "RBlacklistClient::GetListIndex - begin" ); + for ( TInt i( 0 ); i < iBlacklistMemoryTable.Count(); ++i ) { if ( iBlacklistMemoryTable[i]->Compare( aUri, aMediaId ) ) @@ -357,7 +394,8 @@ } WRITELOG( "RBlacklistClient::GetListIndex - end" ); - + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_GETLISTINDEX, "RBlacklistClient::GetListIndex - end" ); + return KErrNotFound; } @@ -369,7 +407,8 @@ EXPORT_C void RBlacklistClient::AddL( const TDesC& aUri, TUint32 aMediaId, TTime aLastModifiedTime ) const { WRITELOG( "RBlacklistClient::AddL - begin" ); - + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_ADDL, "RBlacklistClient::AddL - begin" ); + TPckgC mediaIdPckg( aMediaId ); TPckgC lastModifiedTimePckg( aLastModifiedTime ); @@ -382,6 +421,8 @@ User::LeaveIfError( err ); WRITELOG( "RBlacklistClient::AddL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_ADDL, "RBlacklistClient::AddL - end" ); + } @@ -392,7 +433,8 @@ EXPORT_C void RBlacklistClient::RemoveL( const TDesC& aUri, TUint32 aMediaId ) const { WRITELOG( "RBlacklistClient::RemoveL - begin" ); - + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_REMOVEL, "RBlacklistClient::RemoveL - begin" ); + TPckgBuf mediaIdPckg( aMediaId ); TIpcArgs ipcArgs; @@ -403,6 +445,8 @@ User::LeaveIfError( err ); WRITELOG( "RBlacklistClient::RemoveL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_REMOVEL, "RBlacklistClient::RemoveL - end" ); + } // --------------------------------------------------------------------------- @@ -412,7 +456,8 @@ EXPORT_C void RBlacklistClient::CloseDBL() { WRITELOG( "RBlacklistClient::CloseDBL - begin" ); - + OstTrace0( TRACE_NORMAL, RBLACKLISTCLIENT_CLOSEDBL, "RBlacklistClient::CloseDBL - begin" ); + if ( !iSessionOk ) { User::Leave( KErrDisconnected ); @@ -423,6 +468,8 @@ } WRITELOG( "RBlacklistClient::CloseDBL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_RBLACKLISTCLIENT_CLOSEDBL, "RBlacklistClient::CloseDBL- end" ); + } diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/blacklistclient/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/blacklistclient/traces/OstTraceDefinitions.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,7 @@ +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler +// REMOVE BEFORE CHECK-IN TO VERSION CONTROL +#define OST_TRACE_COMPILER_IN_USE +#include +#endif diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/blacklistclient/traces/blacklistclientTraces.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/blacklistclient/traces/blacklistclientTraces.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,43 @@ +// Created by TraceCompiler 2.2.3 +// DO NOT EDIT, CHANGES WILL BE LOST + +#ifndef __BLACKLISTCLIENTTRACES_H__ +#define __BLACKLISTCLIENTTRACES_H__ + +#define KOstTraceComponentID 0x2001b2ed + +#define RBLACKLISTCLIENT_RBLACKLISTCLIENT 0x860001 +#define DUP1_RBLACKLISTCLIENT_RBLACKLISTCLIENT 0x860002 +#define RBLACKLISTCLIENT_CONNECT 0x860003 +#define DUP1_RBLACKLISTCLIENT_CONNECT 0x860004 +#define RBLACKLISTCLIENT_VERSION 0x860005 +#define RBLACKLISTCLIENT_STARTSERVER 0x860006 +#define DUP1_RBLACKLISTCLIENT_STARTSERVER 0x860007 +#define RBLACKLISTCLIENT_REMOVEFROMDBL 0x860008 +#define DUP1_RBLACKLISTCLIENT_REMOVEFROMDBL 0x860009 +#define RBLACKLISTCLIENT_DOLOADBLACKLISTL 0x86000a +#define DUP1_RBLACKLISTCLIENT_DOLOADBLACKLISTL 0x86000b +#define RBLACKLISTCLIENT_LOADBLACKLISTL 0x86000c +#define DUP1_RBLACKLISTCLIENT_LOADBLACKLISTL 0x86000d +#define RBLACKLISTCLIENT_ADDTOMEMORYTABLEL 0x86000e +#define DUP1_RBLACKLISTCLIENT_ADDTOMEMORYTABLEL 0x86000f +#define RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL 0x860010 +#define DUP1_RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL 0x860011 +#define RBLACKLISTCLIENT_ISBLACKLISTEDL 0x860012 +#define DUP1_RBLACKLISTCLIENT_ISBLACKLISTEDL 0x860013 +#define DUP2_RBLACKLISTCLIENT_ISBLACKLISTEDL 0x860014 +#define DUP3_RBLACKLISTCLIENT_ISBLACKLISTEDL 0x860015 +#define RBLACKLISTCLIENT_GETLISTINDEX 0x860016 +#define DUP1_RBLACKLISTCLIENT_GETLISTINDEX 0x860017 +#define RBLACKLISTCLIENT_ADDL 0x860018 +#define DUP1_RBLACKLISTCLIENT_ADDL 0x860019 +#define RBLACKLISTCLIENT_REMOVEL 0x86001a +#define DUP1_RBLACKLISTCLIENT_REMOVEL 0x86001b +#define RBLACKLISTCLIENT_CLOSEDBL 0x86001c +#define DUP1_RBLACKLISTCLIENT_CLOSEDBL 0x86001d + + +#endif + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/blacklistclient/traces/fixed_id.definitions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/blacklistclient/traces/fixed_id.definitions Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,31 @@ +#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. +[GROUP]TRACE_NORMAL=0x86 +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_ADDL=0x19 +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_ADDTOMEMORYTABLEL=0xf +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_CLOSEDBL=0x1d +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_CONNECT=0x4 +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_DOLOADBLACKLISTL=0xb +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_GETLISTINDEX=0x17 +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_ISBLACKLISTEDL=0x13 +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_LOADBLACKLISTL=0xd +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_RBLACKLISTCLIENT=0x2 +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_REMOVEFROMDBL=0x9 +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL=0x11 +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_REMOVEL=0x1b +[TRACE]TRACE_NORMAL[0x86]_DUP1_RBLACKLISTCLIENT_STARTSERVER=0x7 +[TRACE]TRACE_NORMAL[0x86]_DUP2_RBLACKLISTCLIENT_ISBLACKLISTEDL=0x14 +[TRACE]TRACE_NORMAL[0x86]_DUP3_RBLACKLISTCLIENT_ISBLACKLISTEDL=0x15 +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_ADDL=0x18 +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_ADDTOMEMORYTABLEL=0xe +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_CLOSEDBL=0x1c +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_CONNECT=0x3 +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_DOLOADBLACKLISTL=0xa +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_GETLISTINDEX=0x16 +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_ISBLACKLISTEDL=0x12 +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_LOADBLACKLISTL=0xc +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_RBLACKLISTCLIENT=0x1 +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_REMOVEFROMDBL=0x8 +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_REMOVEFROMMEMORYTABLEL=0x10 +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_REMOVEL=0x1a +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_STARTSERVER=0x6 +[TRACE]TRACE_NORMAL[0x86]_RBLACKLISTCLIENT_VERSION=0x5 diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/blacklistserver/group/blacklistserver.mmp --- a/harvester/blacklistserver/group/blacklistserver.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/blacklistserver/group/blacklistserver.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -31,6 +31,7 @@ USERINCLUDE ../../common/inc USERINCLUDE ../../../metadataengine/server/inc USERINCLUDE ../../../inc +USERINCLUDE ../traces SOURCEPATH ../src SOURCE blacklistserver.cpp diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/blacklistserver/src/blacklistserver.cpp --- a/harvester/blacklistserver/src/blacklistserver.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/blacklistserver/src/blacklistserver.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -24,6 +24,11 @@ #include "mdcserializationbuffer.h" #include +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "blacklistserverTraces.h" +#endif + // Security policy const TUint KServerPolicyRangeCount = 6; @@ -67,7 +72,8 @@ const RMessage2& aMsg, TInt& /*aAction*/, TSecurityInfo& /*aMissing*/ ) { WRITELOG( "CBlacklistServer::CustomSecurityCheckL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_CUSTOMSECURITYCHECKL, "CBlacklistServer::CustomSecurityCheckL -begin" ); + CPolicyServer::TCustomResult securityCheckResult = EFail; switch ( aMsg.Function() ) @@ -92,7 +98,8 @@ } WRITELOG( "CBlacklistServer::CustomSecurityCheckL - end" ); - + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_CUSTOMSECURITYCHECKL, "CBlacklistServer::CustomSecurityCheckL- end" ); + return securityCheckResult; } @@ -105,7 +112,8 @@ const RMessage2& /*aMsg*/, TInt /*aAction*/, const TSecurityInfo& /*aMissing*/ ) { WRITELOG( "CBlacklistServer::CustomFailureActionL" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_CUSTOMFAILUREACTIONL, "CBlacklistServer::CustomFailureActionL" ); + // Not used return EFail; } @@ -117,11 +125,14 @@ CBlacklistServer* CBlacklistServer::NewL() { WRITELOG( "CBlacklistServer::NewL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_NEWL, "CBlacklistServer::NewL -begin" ); + CBlacklistServer* self = NewLC(); CleanupStack::Pop( self ); WRITELOG( "CBlacklistServer::NewL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_NEWL, "CBlacklistServer::NewL - end" ); + return self; } @@ -132,12 +143,15 @@ CBlacklistServer* CBlacklistServer::NewLC() { WRITELOG( "CBlacklistServer::NewLC - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_NEWLC, "CBlacklistServer::NewLC -begin" ); + CBlacklistServer* self = new( ELeave ) CBlacklistServer(); CleanupStack::PushL( self ); self->ConstructL(); WRITELOG( "CBlacklistServer::NewLC - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_NEWLC, "CBlacklistServer::NewLC - end" ); + return self; } @@ -153,12 +167,15 @@ void CBlacklistServer::ConstructL() { WRITELOG( "CBlacklistServer::ConstructL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_CONSTRUCTL, "CBlacklistServer::ConstructL - begin" ); + StartL( KBlacklistServerName ); iSqLiteConnection = CMdSSqLiteConnection::NewL(); WRITELOG( "CBlacklistServer::ConstructL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_CONSTRUCTL, "CBlacklistServer::ConstructL -end" ); + } // --------------------------------------------------------------------------- @@ -168,6 +185,7 @@ CBlacklistServer::~CBlacklistServer() { WRITELOG( "CBlacklistServer::~CBlacklistServer - begin" ); + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_CBLACKLISTSERVER, "CBlacklistServer::~CBlacklistServer -begin" ); if ( iDatabaseOpen ) { @@ -201,6 +219,7 @@ delete iSqLiteConnection; WRITELOG( "CBlacklistServer::~CBlacklistServer - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_CBLACKLISTSERVER, "CBlacklistServer::~CBlacklistServer -end " ); } // --------------------------------------------------------------------------- @@ -210,7 +229,8 @@ void CBlacklistServer::CloseDB() { WRITELOG( "CBlacklistServer::CloseDB - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_CLOSEDB, "CBlacklistServer::CloseDB -begin" ); + if ( iDatabaseOpen ) { iSqLiteConnection->CloseDb(); @@ -218,6 +238,8 @@ } WRITELOG( "CBlacklistServer::CloseDB - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_CLOSEDB, "CBlacklistServer::CloseDB - end" ); + } // --------------------------------------------------------------------------- @@ -227,6 +249,8 @@ void CBlacklistServer::ExeMainL() { WRITELOG( "CBlacklistServer::ExeMainL - begin" ); + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_EXEMAINL, "CBlacklistServer::ExeMainL -begin" ); + User::LeaveIfError( User::RenameThread(KBlacklistServerName) ); // Construct active scheduler CActiveScheduler* activeScheduler = new ( ELeave ) CActiveScheduler; @@ -247,6 +271,8 @@ CleanupStack::PopAndDestroy( 2, activeScheduler ); WRITELOG( "CBlacklistServer::ExeMainL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_EXEMAINL, "CBlacklistServer::ExeMainL - end" ); + } // --------------------------------------------------------------------------- @@ -256,6 +282,8 @@ TInt E32Main() { WRITELOG( "CBlacklistServer::E32Main - begin" ); + OstTrace0( TRACE_NORMAL, _E32MAIN, "CBlacklistServer::E32Main - begin" ); + __UHEAP_MARK; CTrapCleanup* cleanup=CTrapCleanup::New(); TInt result = KErrNoMemory; @@ -266,6 +294,8 @@ } __UHEAP_MARKEND; WRITELOG( "CBlacklistServer::E32Main - end" ); + OstTrace0( TRACE_NORMAL, DUP1__E32MAIN, "CBlacklistServer::E32Main -end" ); + return result; } @@ -277,6 +307,7 @@ void CBlacklistServer::OpenDatabaseL() { WRITELOG( "CBlacklistServer::OpenDatabaseL - begin" ); + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_OPENDATABASEL, "CBlacklistServer::OpenDatabaseL - begin" ); if ( iDatabaseOpen ) { @@ -307,6 +338,8 @@ SerializeToSharedMemoryL(); WRITELOG( "CBlacklistServer::OpenDatabaseL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_OPENDATABASEL, "CBlacklistServer::OpenDatabaseL - end" ); + } // --------------------------------------------------------------------------- @@ -316,7 +349,8 @@ void CBlacklistServer::SerializeToSharedMemoryL() { WRITELOG( "CBlacklistServer::SerializeToSharedMemoryL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL, "CBlacklistServer::SerializeToSharedMemoryL - begin" ); + TUint32 bufferSize = 0; TUint32 blacklistMemoryTableCount = iBlacklistMemoryTable.Count(); @@ -365,6 +399,8 @@ iBlacklistMemoryTable.ResetAndDestroy(); WRITELOG( "CBlacklistServer::SerializeToSharedMemoryL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL, "CBlacklistServer::SerializeToSharedMemoryL- end" ); + } // --------------------------------------------------------------------------- @@ -374,6 +410,8 @@ TInt CBlacklistServer::MemoryHandle() { WRITELOG( "CBlacklistServer::MemoryHandle" ); + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_MEMORYHANDLE, "CBlacklistServer::MemoryHandle" ); + return iHandle; } @@ -384,7 +422,8 @@ void CBlacklistServer::LoadDatabaseToMemoryL() { WRITELOG( "CBlacklistServer::LoadDatabaseToMemoryL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_LOADDATABASETOMEMORYL, "CBlacklistServer::LoadDatabaseToMemoryL - begin" ); + iBlacklistMemoryTable.ResetAndDestroy(); RMdsStatement statement; CleanupClosePushL( statement ); @@ -415,6 +454,8 @@ CleanupStack::PopAndDestroy( &statement ); WRITELOG( "CBlacklistServer::LoadDatabaseToMemoryL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_LOADDATABASETOMEMORYL, "CBlacklistServer::LoadDatabaseToMemoryL - end" ); + } // --------------------------------------------------------------------------- @@ -424,7 +465,8 @@ void CBlacklistServer::CreateBlacklistTableL() { WRITELOG( "CBlacklistServer::CreateBlacklistTableL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_CREATEBLACKLISTTABLEL, "CBlacklistServer::CreateBlacklistTableL - begin" ); + RRowData emptyRowData; CleanupClosePushL( emptyRowData ); iSqLiteConnection->ExecuteL( KDropBlacklistTable, emptyRowData ); @@ -432,6 +474,8 @@ CleanupStack::PopAndDestroy( &emptyRowData ); WRITELOG( "CBlacklistServer::CreateBlacklistTableL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_CREATEBLACKLISTTABLEL, "CBlacklistServer::CreateBlacklistTableL - end" ); + } @@ -444,7 +488,8 @@ { WRITELOG( "CBlacklistServer::AddToMemoryTableL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_ADDTOMEMORYTABLEL, "CBlacklistServer::AddToMemoryTableL - begin" ); + CBlacklistItem* item = CBlacklistItem::NewL( aModified, aUri, aMediaId ); const TInt err = iBlacklistMemoryTable.Append( item ); // ownership is transferred if ( err != KErrNone ) @@ -453,6 +498,8 @@ } WRITELOG( "CBlacklistServer::AddToMemoryTableL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_ADDTOMEMORYTABLEL, "CBlacklistServer::AddToMemoryTableL - end" ); + } // --------------------------------------------------------------------------- @@ -464,7 +511,8 @@ { WRITELOG( "CBlacklistServer::RemoveFromMemoryTable - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE, "CBlacklistServer::RemoveFromMemoryTable - begin" ); + const TInt index = GetMemoryTableIndex( aUri, aMediaId ); if ( index >= 0 ) { @@ -474,6 +522,8 @@ } WRITELOG( "CBlacklistServer::RemoveFromMemoryTable - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE, "CBlacklistServer::RemoveFromMemoryTable - end" ); + } // --------------------------------------------------------------------------- @@ -483,7 +533,8 @@ TInt CBlacklistServer::GetMemoryTableIndex( const TDesC& aUri, TUint32 aMediaId ) { WRITELOG( "CBlacklistServer::GetMemoryTableIndex - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_GETMEMORYTABLEINDEX, "CBlacklistServer::GetMemoryTableIndex - begin" ); + for ( TInt i( 0 ); i < iBlacklistMemoryTable.Count(); ++i ) { if ( iBlacklistMemoryTable[i]->Compare( aUri, aMediaId ) ) @@ -493,6 +544,8 @@ } WRITELOG( "CBlacklistServer::GetMemoryTableIndex - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_GETMEMORYTABLEINDEX, "CBlacklistServer::GetMemoryTableIndex - end" ); + return KErrNotFound; } @@ -503,7 +556,8 @@ TBool CBlacklistServer::TableExistsL() { WRITELOG( "CBlacklistServer::TableExistsL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_TABLEEXISTSL, "CBlacklistServer::TableExistsL - begin" ); + RMdsStatement validationQuery; CleanupClosePushL( validationQuery ); RRowData emptyRowData; @@ -515,7 +569,8 @@ CleanupStack::PopAndDestroy( &validationQuery ); // validationQuery WRITELOG( "CBlacklistServer::TableExistsL - end" ); - + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_TABLEEXISTSL, "CBlacklistServer::TableExistsL - end" ); + return ( err == KErrNone ); } @@ -526,7 +581,8 @@ CSession2* CBlacklistServer::NewSessionL( const TVersion& aVersion, const RMessage2& /*aMessage*/ ) const { WRITELOG( "CBlacklistServer::NewSessionL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_NEWSESSIONL, "CBlacklistServer::NewSessionL - begin" ); + // Check we are the right version if ( !User::QueryVersionSupported( TVersion( KBlacklistServerMajorVersion, KBlacklistServerMinorVersion, @@ -537,7 +593,8 @@ } WRITELOG( "CBlacklistServer::NewSessionL - end" ); - + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_NEWSESSIONL, "CBlacklistServer::NewSessionL - end" ); + return new( ELeave ) CBlacklistSession; } @@ -548,7 +605,8 @@ TInt CBlacklistServer::RunError( TInt aError ) { WRITELOG1( "CBlacklistServer::RunError - begin, error %d", aError ); - + OstTrace1( TRACE_NORMAL, CBLACKLISTSERVER_RUNERROR, "CBlacklistServer::RunError - begin, error %d", aError ); + // Bad descriptor implies bad client if ( aError == KErrBadDescriptor ) { @@ -563,7 +621,8 @@ ReStart(); WRITELOG( "CBlacklistServer::RunError - end" ); - + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_RUNERROR, "CBlacklistServer::RunError - end" ); + return KErrNone; } @@ -574,6 +633,8 @@ void CBlacklistServer::AddSession() { WRITELOG( "CBlacklistServer::AddSession" ); + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_ADDSESSION, "CBlacklistServer::AddSession" ); + ++iSessionCount; } @@ -584,7 +645,8 @@ void CBlacklistServer::RemoveSession() { WRITELOG( "CBlacklistServer::RemoveSession - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_REMOVESESSION, "CBlacklistServer::RemoveSession - begin" ); + --iSessionCount; #ifdef _DEBUG @@ -593,6 +655,9 @@ TRAP_IGNORE ( WriteAllDataToDBL() ); #endif WRITELOG1( "CBlacklistServer::RemoveSession - err %d", err ); +#ifdef _DEBUG + OstTrace1( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_REMOVESESSION, "CBlacklistServer::RemoveSession - err %d", err ); +#endif if ( iSessionCount == 0 ) { @@ -600,6 +665,8 @@ } WRITELOG( "CBlacklistServer::RemoveSession - end" ); + OstTrace0( TRACE_NORMAL, DUP2_CBLACKLISTSERVER_REMOVESESSION, "CBlacklistServer::RemoveSession - end" ); + } // --------------------------------------------------------------------------- @@ -609,10 +676,13 @@ void CBlacklistServer::AddL( const TUint32& mediaId, const TDesC& aUri, const TTime& aLastModifiedTime ) { WRITELOG( "CBlacklistServer::AddL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_ADDL, "CBlacklistServer::AddL - begin" ); + AddToMemoryTableL( aLastModifiedTime.Int64(), aUri, mediaId ); WRITELOG( "CBlacklistServer::AddL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_ADDL, "CBlacklistServer::AddL - end" ); + } // --------------------------------------------------------------------------- @@ -622,10 +692,13 @@ void CBlacklistServer::RemoveL( const TUint32& mediaId, const TDesC& aUri ) { WRITELOG( "CBlacklistServer::RemoveL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_REMOVEL, "CBlacklistServer::RemoveL - begin" ); + RemoveFromMemoryTable( aUri, mediaId ); WRITELOG( "CBlacklistServer::RemoveL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_REMOVEL, "CBlacklistServer::RemoveL - end" ); + } // --------------------------------------------------------------------------- @@ -635,6 +708,7 @@ void CBlacklistServer::RemoveFromDBL( const TDesC& aUri, const TUint32 aMediaId ) { WRITELOG( "CBlacklistServer::RemoveFromDBL - begin" ); + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_REMOVEFROMDBL, "CBlacklistServer::RemoveFromDBL - begin" ); RRowData* variables = new ( ELeave ) RRowData(); CleanupStack::PushL( variables ); @@ -666,6 +740,8 @@ } WRITELOG( "CBlacklistServer::RemoveFromDBL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_REMOVEFROMDBL, "CBlacklistServer::RemoveFromDBL - end" ); + } @@ -677,7 +753,8 @@ const TInt64& aLastModifiedTime ) { WRITELOG( "CBlacklistServer::AddToDBL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_ADDTODBL, "CBlacklistServer::AddToDBL - begin" ); + RRowData* rowData = new ( ELeave ) RRowData(); CleanupStack::PushL( rowData ); CleanupClosePushL( *rowData ); @@ -711,6 +788,8 @@ } WRITELOG( "CBlacklistServer::AddToDBL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_ADDTODBL, "CBlacklistServer::AddToDBL - end" ); + } // --------------------------------------------------------------------------- @@ -720,13 +799,16 @@ void CBlacklistServer::WriteAllDataToDBL() { WRITELOG( "CBlacklistServer::WriteAllDataToDBL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_WRITEALLDATATODBL, "CBlacklistServer::WriteAllDataToDBL - begin" ); + for ( TInt i( 0 ); i < iBlacklistMemoryTable.Count(); ++i ) { AddToDBL( *iBlacklistMemoryTable[i]->Uri(), iBlacklistMemoryTable[i]->MediaId(), iBlacklistMemoryTable[i]->Modified() ); } WRITELOG( "CBlacklistServer::WriteAllDataToDBL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_WRITEALLDATATODBL, "CBlacklistServer::WriteAllDataToDBL - end" ); + } // --------------------------------------------------------------------------- @@ -736,7 +818,8 @@ void CBlacklistServer::CommitBufferedItemsL() { WRITELOG( "CBlacklistServer::CommitBufferedItemsL - begin" ); - + OstTrace0( TRACE_NORMAL, CBLACKLISTSERVER_COMMITBUFFEREDITEMSL, "CBlacklistServer::CommitBufferedItemsL - begin" ); + // First, removed items const TInt removedCount( iBufferedRemoveItems.Count() ); for ( TInt i( 0 ); i < removedCount; ++i ) @@ -754,6 +837,8 @@ } WRITELOG( "CBlacklistServer::CommitBufferedItemsL - end" ); + OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_COMMITBUFFEREDITEMSL, "CBlacklistServer::CommitBufferedItemsL - end" ); + } // End of File diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/blacklistserver/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/blacklistserver/traces/OstTraceDefinitions.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,7 @@ +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler +// REMOVE BEFORE CHECK-IN TO VERSION CONTROL +#define OST_TRACE_COMPILER_IN_USE +#include +#endif diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/blacklistserver/traces/blacklistserverTraces.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/blacklistserver/traces/blacklistserverTraces.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,68 @@ +// Created by TraceCompiler 2.2.3 +// DO NOT EDIT, CHANGES WILL BE LOST + +#ifndef __BLACKLISTSERVERTRACES_H__ +#define __BLACKLISTSERVERTRACES_H__ + +#define KOstTraceComponentID 0x2001b2eb + +#define CBLACKLISTSERVER_CUSTOMSECURITYCHECKL 0x860001 +#define DUP1_CBLACKLISTSERVER_CUSTOMSECURITYCHECKL 0x860002 +#define CBLACKLISTSERVER_CUSTOMFAILUREACTIONL 0x860003 +#define CBLACKLISTSERVER_NEWL 0x860004 +#define DUP1_CBLACKLISTSERVER_NEWL 0x860005 +#define CBLACKLISTSERVER_NEWLC 0x860006 +#define DUP1_CBLACKLISTSERVER_NEWLC 0x860007 +#define CBLACKLISTSERVER_CONSTRUCTL 0x860008 +#define DUP1_CBLACKLISTSERVER_CONSTRUCTL 0x860009 +#define CBLACKLISTSERVER_CBLACKLISTSERVER 0x86000a +#define DUP1_CBLACKLISTSERVER_CBLACKLISTSERVER 0x86000b +#define CBLACKLISTSERVER_CLOSEDB 0x86000c +#define DUP1_CBLACKLISTSERVER_CLOSEDB 0x86000d +#define CBLACKLISTSERVER_EXEMAINL 0x86000e +#define DUP1_CBLACKLISTSERVER_EXEMAINL 0x86000f +#define _E32MAIN 0x860010 +#define DUP1__E32MAIN 0x860011 +#define CBLACKLISTSERVER_OPENDATABASEL 0x860012 +#define DUP1_CBLACKLISTSERVER_OPENDATABASEL 0x860013 +#define CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL 0x860014 +#define DUP1_CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL 0x860015 +#define CBLACKLISTSERVER_MEMORYHANDLE 0x860016 +#define CBLACKLISTSERVER_LOADDATABASETOMEMORYL 0x860017 +#define DUP1_CBLACKLISTSERVER_LOADDATABASETOMEMORYL 0x860018 +#define CBLACKLISTSERVER_CREATEBLACKLISTTABLEL 0x860019 +#define DUP1_CBLACKLISTSERVER_CREATEBLACKLISTTABLEL 0x86001a +#define CBLACKLISTSERVER_ADDTOMEMORYTABLEL 0x86001b +#define DUP1_CBLACKLISTSERVER_ADDTOMEMORYTABLEL 0x86001c +#define CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE 0x86001d +#define DUP1_CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE 0x86001e +#define CBLACKLISTSERVER_GETMEMORYTABLEINDEX 0x86001f +#define DUP1_CBLACKLISTSERVER_GETMEMORYTABLEINDEX 0x860020 +#define CBLACKLISTSERVER_TABLEEXISTSL 0x860021 +#define DUP1_CBLACKLISTSERVER_TABLEEXISTSL 0x860022 +#define CBLACKLISTSERVER_NEWSESSIONL 0x860023 +#define DUP1_CBLACKLISTSERVER_NEWSESSIONL 0x860024 +#define CBLACKLISTSERVER_RUNERROR 0x860025 +#define DUP1_CBLACKLISTSERVER_RUNERROR 0x860026 +#define CBLACKLISTSERVER_ADDSESSION 0x860027 +#define CBLACKLISTSERVER_REMOVESESSION 0x860028 +#define DUP1_CBLACKLISTSERVER_REMOVESESSION 0x860029 +#define DUP2_CBLACKLISTSERVER_REMOVESESSION 0x86002a +#define CBLACKLISTSERVER_ADDL 0x86002b +#define DUP1_CBLACKLISTSERVER_ADDL 0x86002c +#define CBLACKLISTSERVER_REMOVEL 0x86002d +#define DUP1_CBLACKLISTSERVER_REMOVEL 0x86002e +#define CBLACKLISTSERVER_REMOVEFROMDBL 0x86002f +#define DUP1_CBLACKLISTSERVER_REMOVEFROMDBL 0x860030 +#define CBLACKLISTSERVER_ADDTODBL 0x860031 +#define DUP1_CBLACKLISTSERVER_ADDTODBL 0x860032 +#define CBLACKLISTSERVER_WRITEALLDATATODBL 0x860033 +#define DUP1_CBLACKLISTSERVER_WRITEALLDATATODBL 0x860034 +#define CBLACKLISTSERVER_COMMITBUFFEREDITEMSL 0x860035 +#define DUP1_CBLACKLISTSERVER_COMMITBUFFEREDITEMSL 0x860036 + + +#endif + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/blacklistserver/traces/fixed_id.definitions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/blacklistserver/traces/fixed_id.definitions Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,56 @@ +#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. +[GROUP]TRACE_NORMAL=0x86 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_ADDL=0x2b +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_ADDSESSION=0x27 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_ADDTODBL=0x31 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_ADDTOMEMORYTABLEL=0x1b +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_CBLACKLISTSERVER=0xa +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_CLOSEDB=0xc +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_COMMITBUFFEREDITEMSL=0x35 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_CONSTRUCTL=0x8 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_CREATEBLACKLISTTABLEL=0x19 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_CUSTOMFAILUREACTIONL=0x3 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_CUSTOMSECURITYCHECKL=0x1 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_EXEMAINL=0xe +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_GETMEMORYTABLEINDEX=0x1f +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_LOADDATABASETOMEMORYL=0x17 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_MEMORYHANDLE=0x16 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_NEWL=0x4 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_NEWLC=0x6 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_NEWSESSIONL=0x23 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_OPENDATABASEL=0x12 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_REMOVEFROMDBL=0x2f +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE=0x1d +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_REMOVEL=0x2d +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_REMOVESESSION=0x28 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_RUNERROR=0x25 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL=0x14 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_TABLEEXISTSL=0x21 +[TRACE]TRACE_NORMAL[0x86]_CBLACKLISTSERVER_WRITEALLDATATODBL=0x33 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_ADDL=0x2c +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_ADDTODBL=0x32 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_ADDTOMEMORYTABLEL=0x1c +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_CBLACKLISTSERVER=0xb +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_CLOSEDB=0xd +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_COMMITBUFFEREDITEMSL=0x36 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_CONSTRUCTL=0x9 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_CREATEBLACKLISTTABLEL=0x1a +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_CUSTOMSECURITYCHECKL=0x2 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_EXEMAINL=0xf +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_GETMEMORYTABLEINDEX=0x20 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_LOADDATABASETOMEMORYL=0x18 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_NEWL=0x5 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_NEWLC=0x7 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_NEWSESSIONL=0x24 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_OPENDATABASEL=0x13 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_REMOVEFROMDBL=0x30 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE=0x1e +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_REMOVEL=0x2e +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_REMOVESESSION=0x29 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_RUNERROR=0x26 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_SERIALIZETOSHAREDMEMORYL=0x15 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_TABLEEXISTSL=0x22 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CBLACKLISTSERVER_WRITEALLDATATODBL=0x34 +[TRACE]TRACE_NORMAL[0x86]_DUP1__E32MAIN=0x11 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CBLACKLISTSERVER_REMOVESESSION=0x2a +[TRACE]TRACE_NORMAL[0x86]__E32MAIN=0x10 diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/client/bwincw/harvesterclientwinscw.def --- a/harvester/client/bwincw/harvesterclientwinscw.def Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/client/bwincw/harvesterclientwinscw.def Thu Jul 22 16:38:01 2010 +0100 @@ -12,4 +12,6 @@ ?Stop@RHarvesterClient@@QAEXXZ @ 11 NONAME ABSENT ; void RHarvesterClient::Stop(void) ?HarvestFile@RHarvesterClient@@QAEXABVTDesC16@@AAV?$RArray@K@@H@Z @ 12 NONAME ; void RHarvesterClient::HarvestFile(class TDesC16 const &, class RArray &, int) ?HarvestFileWithUID@RHarvesterClient@@QAEXABVTDesC16@@AAV?$RArray@K@@HVTUid@@@Z @ 13 NONAME ; void RHarvesterClient::HarvestFileWithUID(class TDesC16 const &, class RArray &, int, class TUid) + ?AddSessionObserverL@RHarvesterClient@@QAEXAAVMHarvesterSessionObserver@@@Z @ 14 NONAME ; void RHarvesterClient::AddSessionObserverL(class MHarvesterSessionObserver &) + ?RemoveSessionObserver@RHarvesterClient@@QAEXXZ @ 15 NONAME ; void RHarvesterClient::RemoveSessionObserver(void) diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/client/eabi/harvesterclientarm.def --- a/harvester/client/eabi/harvesterclientarm.def Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/client/eabi/harvesterclientarm.def Thu Jul 22 16:38:01 2010 +0100 @@ -18,4 +18,6 @@ _ZN16RHarvesterClient18HarvestFileWithUIDERK7TDesC16R6RArrayImEi4TUid @ 17 NONAME _ZTI22CHarvesterRequestQueue @ 18 NONAME ; ## _ZTV22CHarvesterRequestQueue @ 19 NONAME ; ## + _ZN16RHarvesterClient19AddSessionObserverLER25MHarvesterSessionObserver @ 20 NONAME + _ZN16RHarvesterClient21RemoveSessionObserverEv @ 21 NONAME diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/client/group/harvesterclient.mmp --- a/harvester/client/group/harvesterclient.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/client/group/harvesterclient.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -37,10 +37,12 @@ USERINCLUDE ../../../inc USERINCLUDE ../../common/inc USERINCLUDE ../inc +USERINCLUDE ../traces SOURCEPATH ../src SOURCE harvesterclient.cpp SOURCE harvesterclientao.cpp +SOURCE harvestersessionwatcher.cpp SOURCE harvestereventobserverao.cpp SOURCE harvesterrequestactive.cpp SOURCE harvesterrequestqueue.cpp diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/client/inc/harvestersessionwatcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/client/inc/harvestersessionwatcher.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2007-2009 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: +*/ + +#ifndef HARVESTERSESSIONWATCHER_H +#define HARVESTERSESSIONWATCHER_H + +#include +#include + +NONSHARABLE_CLASS( CHarvesterSessionWatcher ) : public CActive + { +public: + + enum THarvesterWatcherState + { + EIdle, + ERunning, + ESCancelled + }; + + // Cancel and destroy + ~CHarvesterSessionWatcher(); + + // Two-phased constructor. + static CHarvesterSessionWatcher* NewL( MHarvesterSessionObserver& aObserver ); + +public: + + // from base class CActive + void RunL(); + TInt RunError( TInt aError ); + void DoCancel(); + +private: + + CHarvesterSessionWatcher( MHarvesterSessionObserver& aObserver ); + + void ConstructL(); + + void Start(); + +private: + + RProcess iProcess; + + THarvesterWatcherState iState; + + MHarvesterSessionObserver* iObserver; + }; + +#endif // HARVESTERSESSIONWATCHER_H diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/client/src/harvesterclient.cpp --- a/harvester/client/src/harvesterclient.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/client/src/harvesterclient.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -22,9 +22,14 @@ #include "harvestereventobserverao.h" #include "harvesterlog.h" #include "harvesterclientao.h" +#include "harvestersessionwatcher.h" #include "mdsutils.h" #include "harvesterrequestactive.h" #include "mdscommoninternal.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "harvesterclientTraces.h" +#endif /** @var Message slots */ const TInt KDefaultMessageSlots = -1; // Global pool @@ -47,6 +52,8 @@ EXPORT_C RHarvesterClient::RHarvesterClient() : RSessionBase() { WRITELOG( "RHarvesterClient::RHarvesterClient() - Constructor" ); + OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_RHARVESTERCLIENT, "RHarvesterClient::RHarvesterClient" ); + iHarvesterClientAO = NULL; iObserver = NULL; iHEO = NULL; @@ -60,7 +67,9 @@ EXPORT_C TInt RHarvesterClient::Connect() { WRITELOG( "RHarvesterClient::Connect()" ); - + OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_CONNECT, "RHarvesterClient::Connect" ); + + RProperty property; const TInt error( property.Attach( KHarvesterPSShutdown, KShutdown, EOwnerThread ) ); TInt value = 0; @@ -125,6 +134,8 @@ iHEO = NULL; + iSessionWatcher = NULL; + return err; } @@ -134,6 +145,8 @@ // EXPORT_C TInt RHarvesterClient::Pause() { + OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_PAUSE, "RHarvesterClient::Pause" ); + WRITELOG( "RHarvesterClient::Pause() - sending command EPauseHarvester" ); if( iHandle ) { @@ -149,6 +162,8 @@ EXPORT_C TInt RHarvesterClient::Resume() { WRITELOG( "RHarvesterClient::Resume() - sending command EResumeHarvester" ); + OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_RESUME, "RHarvesterClient::Resume" ); + if( iHandle ) { return SendReceive( EResumeHarvester ); @@ -163,6 +178,10 @@ EXPORT_C void RHarvesterClient::Close() { WRITELOG( "RHarvesterClient::Close()" ); + OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_CLOSE, "RHarvesterClient::Close" ); + + delete iSessionWatcher; + iSessionWatcher = NULL; // cancels Harvest Complete request if it exist at server UnregisterHarvestComplete(); @@ -196,11 +215,12 @@ EXPORT_C void RHarvesterClient::SetObserver( MHarvestObserver* aObserver ) { WRITELOG( "RHarvesterClient::SetObserver()" ); + OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_SETOBSERVER, "RHarvesterClient::SetObserver" ); if ( iHarvesterClientAO ) { - iHarvesterClientAO->SetObserver( aObserver ); - } + iHarvesterClientAO->SetObserver( aObserver ); + } iObserver = aObserver; } @@ -211,6 +231,7 @@ EXPORT_C void RHarvesterClient::RemoveObserver( MHarvestObserver* aObserver ) { WRITELOG( "RHarvesterClient::RemoveObserver()" ); + OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_REMOVEOBSERVER, "RHarvesterClient::RemoveObserver" ); if ( iHarvesterClientAO ) { @@ -277,6 +298,8 @@ EXPORT_C void RHarvesterClient::HarvestFile( const TDesC& aURI, RArray& aAlbumIds, TBool aAddLocation ) { WRITELOG1( "RHarvesterClient::HarvestFile() - file %S", &aURI ); + OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_HARVESTFILE, "RHarvesterClient::HarvestFile" ); + HBufC8* paramBuf = NULL; TRAPD( err, paramBuf = SerializeArrayL( aAlbumIds ) ); @@ -348,6 +371,8 @@ TUid /*aUid*/ ) { WRITELOG1( "RHarvesterClient::HarvestFileWithUID() - file %S", &aURI ); + OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_HARVESTFILEWITHUID, "RHarvesterClient::HarvestFileWithUID" ); + HBufC8* paramBuf = NULL; TRAPD( err, paramBuf = SerializeArrayL( aAlbumIds ) ); @@ -408,12 +433,41 @@ } // ---------------------------------------------------------------------------------------- +// AddSessionObserver +// ---------------------------------------------------------------------------------------- +// +EXPORT_C void RHarvesterClient::AddSessionObserverL( MHarvesterSessionObserver& aObserver ) + { + if( iSessionWatcher ) + { + delete iSessionWatcher; + iSessionWatcher = NULL; + } + iSessionWatcher = CHarvesterSessionWatcher::NewL( aObserver ); + } + +// ---------------------------------------------------------------------------------------- +// RemoveSessionObserver +// ---------------------------------------------------------------------------------------- +// +EXPORT_C void RHarvesterClient::RemoveSessionObserver() + { + if( iSessionWatcher ) + { + delete iSessionWatcher; + iSessionWatcher = NULL; + } + } + +// ---------------------------------------------------------------------------------------- // RegisterHarvestComplete // ---------------------------------------------------------------------------------------- // void RHarvesterClient::RegisterHarvestComplete(TDes& aURI, TRequestStatus& aStatus) { TIpcArgs ipcArgs( &aURI ); + OstTrace0( TRACE_NORMAL, RHARVESTERCLIENT_REGISTERHARVESTCOMPLETE, "RHarvesterClient::RegisterHarvestComplete" ); + if( !iHandle ) { @@ -479,6 +533,7 @@ static TInt StartServer() { WRITELOG( "StartServer() - begin" ); + OstTrace0( TRACE_NORMAL, _STARTSERVER, "::StartServer" ); TFindServer findHarvesterServer( KHarvesterServerName ); TFullName name; @@ -522,6 +577,8 @@ static TInt CreateServerProcess() { WRITELOG( "CreateServerProcess() - begin" ); + OstTrace0( TRACE_NORMAL, _CREATESERVERPROCESS, "::CreateServerProcess" ); + RProcess server; TInt result = server.Create( KHarvesterServerExe, KNullDesC ); if ( result != KErrNone ) diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/client/src/harvesterclientao.cpp --- a/harvester/client/src/harvesterclientao.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/client/src/harvesterclientao.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -20,6 +20,10 @@ #include "harvestercommon.h" #include "harvesterlog.h" #include "mdsutils.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "harvesterclientaoTraces.h" +#endif // --------------------------------------------------------------------------- @@ -29,6 +33,8 @@ CHarvesterClientAO* CHarvesterClientAO::NewL( RHarvesterClient& aHarvesterClient ) { WRITELOG( "CHarvesterClientAO::NewL()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_NEWL, "CHarvesterClientAO::NewL" ); + CHarvesterClientAO* self = new (ELeave) CHarvesterClientAO( aHarvesterClient ); CleanupStack::PushL( self ); self->ConstructL(); @@ -42,6 +48,8 @@ // CHarvesterClientAO::~CHarvesterClientAO() // destruct { + OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_CHARVESTERCLIENTAO, "CHarvesterClientAO::~CHarvesterClientAO" ); + WRITELOG( "CHarvesterClientAO::~CHarvesterClientAO()" ); Cancel(); } @@ -56,6 +64,8 @@ iObserver( NULL ), iHarvesterClient( aHarvesterClient ) { + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO, "CHarvesterClientAO::CHarvesterClientAO" ); + WRITELOG( "CHarvesterClientAO::CHarvesterClientAO()" ); } @@ -65,7 +75,9 @@ // void CHarvesterClientAO::ConstructL() // second-phase constructor { - WRITELOG( "CHarvesterClientAO::ConstructL()" ); + WRITELOG( "CHarvesterClientAO::ConstructL()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_CONSTRUCTL, "CHarvesterClientAO::ConstructL" ); + CActiveScheduler::Add( this ); } @@ -76,6 +88,8 @@ void CHarvesterClientAO::SetObserver( MHarvestObserver* aObserver ) { WRITELOG( "CHarvesterClientAO::SetObserver()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_SETOBSERVER, "CHarvesterClientAO::SetObserver" ); + iObserver = aObserver; } @@ -86,6 +100,8 @@ void CHarvesterClientAO::RemoveObserver( MHarvestObserver* aObserver ) { WRITELOG( "CHarvesterClientAO::RemoveObserver()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_REMOVEOBSERVER, "CHarvesterClientAO::RemoveObserver" ); + if ( aObserver == iObserver ) { if ( iObserver ) @@ -103,6 +119,8 @@ void CHarvesterClientAO::DoCancel() { WRITELOG( "CHarvesterClientAO::DoCancel()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_DOCANCEL, "CHarvesterClientAO::DoCancel" ); + } // --------------------------------------------------------------------------- @@ -125,6 +143,8 @@ void CHarvesterClientAO::RunL() { WRITELOG( "CHarvesterClientAO::RunL()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERCLIENTAO_RUNL, "CHarvesterClientAO::RunL" ); + const TInt status = iStatus.Int(); diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/client/src/harvestersessionwatcher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/client/src/harvestersessionwatcher.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2007-2009 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: Harvester session watcher +* +*/ + +#include "harvestersessionwatcher.h" + +// --------------------------------------------------------------------------- +// NewL +// --------------------------------------------------------------------------- +// +CHarvesterSessionWatcher* CHarvesterSessionWatcher::NewL( MHarvesterSessionObserver& aObserver ) + { + CHarvesterSessionWatcher* self = new ( ELeave ) CHarvesterSessionWatcher( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + + return self; + } + +// --------------------------------------------------------------------------- +// ~CHarvesterSessionWatcher +// --------------------------------------------------------------------------- +// +CHarvesterSessionWatcher::~CHarvesterSessionWatcher() // destruct + { + Cancel(); + } + +// --------------------------------------------------------------------------- +// CHarvesterSessionWatcher +// First-phase C++ constructor +// --------------------------------------------------------------------------- +// +CHarvesterSessionWatcher::CHarvesterSessionWatcher( MHarvesterSessionObserver& aObserver ) + : CActive( CActive::EPriorityStandard ), iState( EIdle ), iObserver( &aObserver ) + { + // Add to active scheduler. + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// ConstructL +// --------------------------------------------------------------------------- +// +void CHarvesterSessionWatcher::ConstructL() // second-phase constructor + { + _LIT( KHarvesterServerProcess, "HarvesterServer*" ); + TFullName name; + + // find Harvester Server + TFindProcess findProcess( KHarvesterServerProcess ); + if ( findProcess.Next(name) == KErrNone ) + { + User::LeaveIfError( iProcess.Open(name) ); + iState = ERunning; + // logon to get termination signal + iProcess.Logon( iStatus ); + SetActive(); + } + else + { + User::Leave( KErrCommsBreak ); + } + } + +// --------------------------------------------------------------------------- +// DoCancel +// --------------------------------------------------------------------------- +// +void CHarvesterSessionWatcher::DoCancel() + { + iState = ESCancelled; + iProcess.LogonCancel( iStatus ); + iProcess.Close(); + } + +// --------------------------------------------------------------------------- +// RunL +// --------------------------------------------------------------------------- +// +void CHarvesterSessionWatcher::RunL() + { + switch (iState) + { + case EIdle: + case ESCancelled: + { + break; + } + + case ERunning: + { + // server terminated, notify clients + iObserver->HarvesterServerTerminated(); + break; + } + + default: + break; + } + } + +// --------------------------------------------------------------------------- +// RunError +// --------------------------------------------------------------------------- +// +TInt CHarvesterSessionWatcher::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/client/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/client/traces/OstTraceDefinitions.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,7 @@ +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler +// REMOVE BEFORE CHECK-IN TO VERSION CONTROL +#define OST_TRACE_COMPILER_IN_USE +#include +#endif diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/client/traces/fixed_id.definitions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/client/traces/fixed_id.definitions Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,22 @@ +#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. +[GROUP]TRACE_NORMAL=0x86 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO=0xe +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_CONSTRUCTL=0x10 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_DOCANCEL=0x13 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_NEWL=0xd +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_REMOVEOBSERVER=0x12 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_RUNL=0x14 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERCLIENTAO_SETOBSERVER=0x11 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO=0xf +[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_CLOSE=0x5 +[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_CONNECT=0x2 +[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_HARVESTFILE=0x8 +[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_HARVESTFILEWITHUID=0x9 +[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_PAUSE=0x3 +[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_REGISTERHARVESTCOMPLETE=0xa +[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_REMOVEOBSERVER=0x7 +[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_RESUME=0x4 +[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_RHARVESTERCLIENT=0x1 +[TRACE]TRACE_NORMAL[0x86]_RHARVESTERCLIENT_SETOBSERVER=0x6 +[TRACE]TRACE_NORMAL[0x86]__CREATESERVERPROCESS=0xc +[TRACE]TRACE_NORMAL[0x86]__STARTSERVER=0xb diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/client/traces/harvesterclientTraces.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/client/traces/harvesterclientTraces.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,26 @@ +// Created by TraceCompiler 2.2.3 +// DO NOT EDIT, CHANGES WILL BE LOST + +#ifndef __HARVESTERCLIENTTRACES_H__ +#define __HARVESTERCLIENTTRACES_H__ + +#define KOstTraceComponentID 0x200009f4 + +#define RHARVESTERCLIENT_RHARVESTERCLIENT 0x860001 +#define RHARVESTERCLIENT_CONNECT 0x860002 +#define RHARVESTERCLIENT_PAUSE 0x860003 +#define RHARVESTERCLIENT_RESUME 0x860004 +#define RHARVESTERCLIENT_CLOSE 0x860005 +#define RHARVESTERCLIENT_SETOBSERVER 0x860006 +#define RHARVESTERCLIENT_REMOVEOBSERVER 0x860007 +#define RHARVESTERCLIENT_HARVESTFILE 0x860008 +#define RHARVESTERCLIENT_HARVESTFILEWITHUID 0x860009 +#define RHARVESTERCLIENT_REGISTERHARVESTCOMPLETE 0x86000a +#define _STARTSERVER 0x86000b +#define _CREATESERVERPROCESS 0x86000c + + +#endif + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/client/traces/harvesterclientaoTraces.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/client/traces/harvesterclientaoTraces.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,22 @@ +// Created by TraceCompiler 2.2.3 +// DO NOT EDIT, CHANGES WILL BE LOST + +#ifndef __HARVESTERCLIENTAOTRACES_H__ +#define __HARVESTERCLIENTAOTRACES_H__ + +#define KOstTraceComponentID 0x200009f4 + +#define CHARVESTERCLIENTAO_NEWL 0x86000d +#define CHARVESTERCLIENTAO_CHARVESTERCLIENTAO 0x86000e +#define DUP1_CHARVESTERCLIENTAO_CHARVESTERCLIENTAO 0x86000f +#define CHARVESTERCLIENTAO_CONSTRUCTL 0x860010 +#define CHARVESTERCLIENTAO_SETOBSERVER 0x860011 +#define CHARVESTERCLIENTAO_REMOVEOBSERVER 0x860012 +#define CHARVESTERCLIENTAO_DOCANCEL 0x860013 +#define CHARVESTERCLIENTAO_RUNL 0x860014 + + +#endif + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/bwincw/harvesterplugininterfacewinscw.def --- a/harvester/common/bwincw/harvesterplugininterfacewinscw.def Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/common/bwincw/harvesterplugininterfacewinscw.def Thu Jul 22 16:38:01 2010 +0100 @@ -12,4 +12,5 @@ ?SetBlacklist@CHarvesterPlugin@@UAEXAAVCHarvesterBlacklist@@@Z @ 11 NONAME ; void CHarvesterPlugin::SetBlacklist(class CHarvesterBlacklist &) ?GetMimeType@CHarvesterPlugin@@UAEXABVTDesC16@@AAVTDes16@@@Z @ 12 NONAME ; void CHarvesterPlugin::GetMimeType(class TDesC16 const &, class TDes16 &) ?SetHarvesterPluginFactory@CHarvesterPlugin@@QAEXAAVCHarvesterPluginFactory@@@Z @ 13 NONAME ; void CHarvesterPlugin::SetHarvesterPluginFactory(class CHarvesterPluginFactory &) + ?PluginInIdleState@CHarvesterPlugin@@QAEHXZ @ 14 NONAME ; int CHarvesterPlugin::PluginInIdleState(void) diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/data/200009FE.txt Binary file harvester/common/data/200009FE.txt has changed diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/eabi/harvesterplugininterfacearm.def --- a/harvester/common/eabi/harvesterplugininterfacearm.def Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/common/eabi/harvesterplugininterfacearm.def Thu Jul 22 16:38:01 2010 +0100 @@ -16,4 +16,5 @@ _ZN16CHarvesterPlugin12SetBlacklistER19CHarvesterBlacklist @ 15 NONAME _ZN16CHarvesterPlugin11GetMimeTypeERK7TDesC16R6TDes16 @ 16 NONAME _ZN16CHarvesterPlugin25SetHarvesterPluginFactoryER23CHarvesterPluginFactory @ 17 NONAME + _ZN16CHarvesterPlugin17PluginInIdleStateEv @ 18 NONAME diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/group/harvestercommon.mmp --- a/harvester/common/group/harvestercommon.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/common/group/harvestercommon.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -40,6 +40,7 @@ USERINCLUDE ../../../inc USERINCLUDE ../inc USERINCLUDE ../../monitorplugins/inc +USERINCLUDE ../traces SOURCEPATH ../src SOURCE harvesterblacklist.cpp diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/inc/harvestercommon.h --- a/harvester/common/inc/harvestercommon.h Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/common/inc/harvestercommon.h Thu Jul 22 16:38:01 2010 +0100 @@ -93,6 +93,9 @@ const TInt KHarvesterGetRootDirFlags = EDirsFirst; const TInt KHarvesterGetDirFlags = ESortByDate | EAscending | EDirsFirst; +_LIT( KExludedThumbPath, "_PAlbTN"); +_LIT( KExludedMediaArtPath, ".mediaartlocal"); + const TInt KOriginIgnored = 255; const TInt KOriginFastHarvest = 254; diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/inc/harvestermediaidutil.h --- a/harvester/common/inc/harvestermediaidutil.h Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/common/inc/harvestermediaidutil.h Thu Jul 22 16:38:01 2010 +0100 @@ -19,6 +19,7 @@ #include #include +#include const TInt KHarvesterMediaIdTLSKey = 0x200009FE; diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/src/harvestereventmanager.cpp --- a/harvester/common/src/harvestereventmanager.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/common/src/harvestereventmanager.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -18,6 +18,11 @@ #include "harvestereventmanager.h" #include "harvesterlog.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "harvestereventmanagerTraces.h" +#endif + const TInt KHarvesterEventManagerTLSKey = 0x200104D9; @@ -47,6 +52,7 @@ EXPORT_C CHarvesterEventManager* CHarvesterEventManager::GetInstanceL() { WRITELOG( "CHarvesterEventManager::GetInstanceL" ); + OstTrace0( TRACE_NORMAL, CHARVESTEREVENTMANAGER_GETINSTANCEL, "CHarvesterEventManager::GetInstanceL" ); CHarvesterEventManagerStaticData* data = static_cast( @@ -75,6 +81,8 @@ EXPORT_C void CHarvesterEventManager::ReleaseInstance() { WRITELOG( "CHarvesterEventManager::ReleaseInstance" ); + OstTrace0( TRACE_NORMAL, CHARVESTEREVENTMANAGER_RELEASEINSTANCE, "CHarvesterEventManager::ReleaseInstance" ); + CHarvesterEventManagerStaticData* data = static_cast( UserSvr::DllTls( KHarvesterEventManagerTLSKey ) ); @@ -100,32 +108,52 @@ switch(aHEObserverType) { case EHEObserverTypePlaceholder: + { WRITELOG( "CHarvesterEventManager::IncreaseItemCount() EHEObserverTypePlaceholder"); + OstTrace0( TRACE_NORMAL, CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT, "CHarvesterEventManager::IncreaseItemCount EHEObserverTypePlaceholder" ); break; + } case EHEObserverTypeMMC: + { WRITELOG( "CHarvesterEventManager::IncreaseItemCount() EHEObserverTypeMMC"); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT, "CHarvesterEventManager::IncreaseItemCount EHEObserverTypeMMC" ); break; + } case EHEObserverTypeOverall: + { WRITELOG( "CHarvesterEventManager::IncreaseItemCount() EHEObserverTypeOverall"); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT, "CHarvesterEventManager::IncreaseItemCount EHEObserverTypeOverall" ); break; + } default: + { WRITELOG( "CHarvesterEventManager::IncreaseItemCount() Unknown type!"); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT, "CHarvesterEventManager::IncreaseItemCount Unknown type!" ); + } }; #endif if( eventStatus ) { WRITELOG1( "CHarvesterEventManager::IncreaseItemCount() itemsleft = %d old ", eventStatus->iItemsLeft); + OstTrace1( TRACE_NORMAL, DUP4_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT, "CHarvesterEventManager::IncreaseItemCount) itemsleft = %d old", eventStatus->iItemsLeft ); + eventStatus->iItemsLeft += aCount; WRITELOG1( "CHarvesterEventManager::IncreaseItemCount() itemsleft = %d ", eventStatus->iItemsLeft); + OstTrace1( TRACE_NORMAL, DUP5_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT, "CHarvesterEventManager::IncreaseItemCount itemsleft = %d", eventStatus->iItemsLeft ); + } else { TEventStatus eventStatus; eventStatus.iCurrentState = EHEStateStarted; WRITELOG1( "CHarvesterEventManager::IncreaseItemCount() itemsleft = %d old", aCount); + OstTrace1( TRACE_NORMAL, DUP6_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT, "CHarvesterEventManager::IncreaseItemCount itemsleft = %d old", aCount ); + eventStatus.iItemsLeft = aCount; WRITELOG1( "CHarvesterEventManager::IncreaseItemCount() itemsleft = %d ", aCount); + OstTrace1( TRACE_NORMAL, DUP7_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT, "CHarvesterEventManager::IncreaseItemCount itemsleft = %d", aCount ); + eventStatus.iObserverType = aHEObserverType; iEventStatuses.Append( eventStatus ); } @@ -141,22 +169,36 @@ switch(aHEObserverType) { case EHEObserverTypePlaceholder: + { WRITELOG( "CHarvesterEventManager::DecreaseItemCountL() EHEObserverTypePlaceholder"); + OstTrace0( TRACE_NORMAL, CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL, "CHarvesterEventManager::DecreaseItemCountL EHEObserverTypePlaceholder" ); break; + } case EHEObserverTypeMMC: + { WRITELOG( "CHarvesterEventManager::DecreaseItemCountL() EHEObserverTypeMMC"); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL, "CHarvesterEventManager::DecreaseItemCountL EHEObserverTypeMMC" ); break; + } case EHEObserverTypeOverall: + { WRITELOG( "CHarvesterEventManager::DecreaseItemCountL() EHEObserverTypeOverall"); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL, "CHarvesterEventManager::DecreaseItemCountL EHEObserverTypeOverall" ); break; + } default: + { WRITELOG( "CHarvesterEventManager::DecreaseItemCountL() Unknown type!"); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL, "CHarvesterEventManager::DecreaseItemCountL Unknown type!" ); + } }; #endif if( eventStatus ) { WRITELOG1( "CHarvesterEventManager::DecreaseItemCountL() iItemsLeft = %d old", eventStatus->iItemsLeft); + OstTrace1( TRACE_NORMAL, DUP4_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL, "CHarvesterEventManager::DecreaseItemCountL iItemsLeft = %d old", eventStatus->iItemsLeft ); + TUint newCount = eventStatus->iItemsLeft - aCount; // check for wrap @@ -179,6 +221,7 @@ } WRITELOG1( "CHarvesterEventManager::DecreaseItemCountL() iItemsLeft = %d", eventStatus->iItemsLeft ); + OstTrace1( TRACE_NORMAL, DUP5_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL, "CHarvesterEventManager::DecreaseItemCountL iItemsLeft = %d", eventStatus->iItemsLeft ); // send finished event to all matching observers if ( eventStatus->iItemsLeft <= 0 ) @@ -340,8 +383,6 @@ iRegisteredObservers.AppendL( observerInfo ); - CleanupStack::Pop( observerInfo ); - // send event if register is coming in the middle of harvesting for( TInt i = iEventStatuses.Count(); --i >= 0; ) { @@ -349,13 +390,31 @@ if( CheckObserverType( observerInfo->iObserverType, eventStatus.iObserverType) ) { - if( eventStatus.iItemsLeft > 0 ) - { - TRAP_IGNORE( SendEventL( eventStatus.iObserverType, - eventStatus.iCurrentState, eventStatus.iItemsLeft ) ); - } + TRAP_IGNORE( SendEventL( eventStatus.iObserverType, + eventStatus.iCurrentState, eventStatus.iItemsLeft ) ); } } + + //no events in queue, signal registered client anyways + if( !iEventStatuses.Count() ) + { + if(observerInfo->iObserverType & EHEObserverTypeOverall) + { + SendSingleEvent(*observerInfo, EHEObserverTypeOverall, EHEStateUninitialized, 0); + } + + if(observerInfo->iObserverType & EHEObserverTypeMMC) + { + SendSingleEvent(*observerInfo, EHEObserverTypeMMC, EHEStateUninitialized, 0); + } + + if(observerInfo->iObserverType & EHEObserverTypePlaceholder) + { + SendSingleEvent(*observerInfo, EHEObserverTypePlaceholder, EHEStateUninitialized, 0); + } + } + + CleanupStack::Pop( observerInfo ); } EXPORT_C TInt CHarvesterEventManager::UnregisterEventObserver( const RMessage2& aMessage ) diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/src/harvesterexifutil.cpp --- a/harvester/common/src/harvesterexifutil.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/common/src/harvesterexifutil.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -23,6 +23,11 @@ #include "mdeproperty.h" #include "tz.h" #include +#include "OstTraceDefinitions.h" + +#ifdef OST_TRACE_COMPILER_IN_USE +#include "harvesterexifutilTraces.h" +#endif @@ -137,6 +142,7 @@ EXPORT_C TBool CHarvesterExifUtil::IsValidExifData(TPtr8 aPtr) { WRITELOG( "CHarvesterExifUtil::IsValidExifData start" ); + OstTrace0( TRACE_NORMAL, CHARVESTEREXIFUTIL_ISVALIDEXIFDATA, "CHarvesterExifUtil::IsValidExifData start" ); CExifRead* reader = NULL; @@ -144,13 +150,15 @@ if (err != KErrNone || !reader ) { WRITELOG1( "CHarvesterExifUtil::IsValidExifData - error code: %d", err ); - + OstTrace1( TRACE_NORMAL, DUP1_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA, "CHarvesterExifUtil::IsValidExifData -error code:%d", err ); + return EFalse; } delete reader; WRITELOG( "CHarvesterExifUtil::IsValidExifData end" ); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA, "CHarvesterExifUtil::IsValidExifData end" ); return ETrue; } @@ -183,6 +191,8 @@ EXPORT_C TInt CHarvesterExifUtil::ReadExifDataL( CHarvestData& aHd, CFileData& aFileData ) { WRITELOG( "CHarvesterExifUtil::ReadExifDataL()" ); + OstTrace0( TRACE_NORMAL, CHARVESTEREXIFUTIL_READEXIFDATAL, "CHarvesterExifUtil::ReadExifDataL" ); + CExifRead* reader = CExifRead::NewL( aFileData.iImageData->Des(), CExifRead::ENoJpeg | CExifRead::ENoTagChecking); @@ -227,6 +237,8 @@ if ( reader->TagExists(KIdDateTime, EIfd0) ) { WRITELOG( "CHarvesterExifUtil::ReadExifDataL() - getting last aFileData.iModified date (exif)" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTEREXIFUTIL_READEXIFDATAL, "CHarvesterExifUtil::ReadExifDataL - getting last aFileData.iModified date (exif)" ); + aHd.iDateModified8 = reader->GetDateTimeL(); } @@ -234,6 +246,8 @@ if ( reader->TagExists(KIdDateTimeOriginal, EIfdExif) ) { WRITELOG( "CHarvesterExifUtil::ReadExifDataL() - getting original date (exif)" ); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTEREXIFUTIL_READEXIFDATAL, "CHarvesterExifUtil::ReadExifDataL - getting original date (exif)" ); + aHd.iDateOriginal8 = reader->GetDateTimeOriginalL(); } @@ -241,6 +255,8 @@ if ( reader->TagExists(KIdDateTimeDigitized, EIfdExif) ) { WRITELOG( "CHarvesterExifUtil::ReadExifDataL() - getting digitized date (exif)" ); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTEREXIFUTIL_READEXIFDATAL, "CHarvesterExifUtil::ReadExifDataL - getting digitized date (exif)" ); + aHd.iDateDigitized8 = reader->GetDateTimeDigitizedL(); } @@ -336,6 +352,8 @@ aHd.iStoreSamplesPerPixel = ETrue; WRITELOG1( "CHarvesterExifUtil::ReadExifDataL() - samples per pixel: %d", aHd.iSamplesPerPixel ); + OstTrace1( TRACE_NORMAL, DUP4_CHARVESTEREXIFUTIL_READEXIFDATAL, "CHarvesterExifUtil::ReadExifDataL - samples per pixel: %d", aHd.iSamplesPerPixel ); + } //Getting ISO speed rating. @@ -415,6 +433,7 @@ const TDesC8& aDateTime ) { WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL()" ); + OstTrace0( TRACE_NORMAL, CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL" ); TDateTime datetime( 0, EJanuary, 0, 0, 0, 0, 0 ); TBuf<4> text; @@ -427,6 +446,8 @@ if ( error != KErrNone ) { WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL() - couldn't get year" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL - couldn't get year" ); + User::Leave( error ); } datetime.SetYear( number ); @@ -438,6 +459,8 @@ if ( error != KErrNone ) { WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL() - couldn't get month" ); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL - couldn't get month" ); + User::Leave( error ); } number--; @@ -451,6 +474,8 @@ if ( error != KErrNone ) { WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL() - couldn't get date" ); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL - couldn't get date" ); + User::Leave( error ); } datetime.SetDay( number - 1 ); @@ -462,6 +487,8 @@ if ( error != KErrNone ) { WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL() - couldn't get hours" ); + OstTrace0( TRACE_NORMAL, DUP4_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL - couldn't get hours" ); + User::Leave( error ); } datetime.SetHour( number ); @@ -473,6 +500,8 @@ if ( error != KErrNone ) { WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL() - couldn't get minutes" ); + OstTrace0( TRACE_NORMAL, DUP5_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL - couldn't get minutes" ); + User::Leave( error ); } datetime.SetMinute( number ); @@ -484,6 +513,8 @@ if ( error != KErrNone ) { WRITELOG( "CHarvesterImagePluginAO::ConvertExifDateTimeToSymbianTimeL() - couldn't get seconds" ); + OstTrace0( TRACE_NORMAL, DUP6_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL, "CHarvesterExifUtil::ConvertExifDateTimeToSymbianTimeL - couldn't get seconds" ); + User::Leave( error ); } datetime.SetSecond( number ); @@ -1751,7 +1782,7 @@ TReal64 latitude = 0.0; const CExifTag* refTag = aReader->GetTagL( EIfdGps, KIdGpsLatitudeRef ); - TBuf8<2> latitudeRef = refTag->Data(); + TBuf8<3> latitudeRef = refTag->Data(); const CExifTag* latitudeTag = aReader->GetTagL( EIfdGps, KIdGpsLatitude ); TBuf8 latitudeBuf = latitudeTag->Data(); @@ -1784,7 +1815,7 @@ TReal64 longitude = 0.0; const CExifTag* refTag = aReader->GetTagL( EIfdGps, KIdGpsLongitudeRef ); - TBuf8<2> longitudeRef = refTag->Data(); + TBuf8<3> longitudeRef = refTag->Data(); const CExifTag* longitudeTag = aReader->GetTagL( EIfdGps, KIdGpsLongitude ); TBuf8 longitudeBuf = longitudeTag->Data(); diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/src/harvesterplugin.cpp --- a/harvester/common/src/harvesterplugin.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/common/src/harvesterplugin.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -65,7 +65,7 @@ iDtor_ID_Key( KNullUid ), iOriginPropertyDef( NULL ), iTitlePropertyDef( NULL ), - iHarvesting( NULL ) + iHarvesting( EFalse ) { } @@ -132,6 +132,11 @@ { case EHarvesterIdle: { + if( iHarvesting ) + { + TRAP_IGNORE( iFactory->SendHarvestingStatusEventL( EFalse ) ); + iHarvesting = EFalse; + } } break; @@ -332,6 +337,19 @@ } // --------------------------------------------------------------------------- +// PluginInIdleState +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CHarvesterPlugin::PluginInIdleState() + { + if( iState == EHarvesterIdle ) + { + return ETrue; + } + return EFalse; + } + +// --------------------------------------------------------------------------- // E32Dll // --------------------------------------------------------------------------- // diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/src/harvesterpluginfactory.cpp --- a/harvester/common/src/harvesterpluginfactory.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/common/src/harvesterpluginfactory.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -439,13 +439,22 @@ { const TInt pluginInfoCount = iHarvesterPluginInfoArray.Count(); TBool itemsLeft( EFalse ); + TBool allPluginsOnIdle( ETrue ); for ( TInt i = pluginInfoCount; --i >= 0; ) { CHarvesterPluginInfo* info = iHarvesterPluginInfoArray[i]; if( info && info->iQueue.Count() ) { itemsLeft = ETrue; - break; + if( aStarted ) + { + // Idle state is only checked if finished event is sent + break; + } + } + if( info && info->iPlugin && !(info->iPlugin->PluginInIdleState()) ) + { + allPluginsOnIdle = EFalse; } } @@ -458,7 +467,7 @@ iHarvesterEventManager->IncreaseItemCount( EHEObserverTypeOverall, KCacheItemCountForEventCaching ); return; } - else if( iHarvesting && !itemsLeft && !aStarted ) + else if( iHarvesting && (!itemsLeft || allPluginsOnIdle) && !aStarted ) { iHarvesting = EFalse; iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStateFinished ); diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/common/traces/OstTraceDefinitions.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,7 @@ +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler +// REMOVE BEFORE CHECK-IN TO VERSION CONTROL +#define OST_TRACE_COMPILER_IN_USE +#include +#endif diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/traces/fixed_id.definitions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/common/traces/fixed_id.definitions Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,33 @@ +#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. +[GROUP]TRACE_NORMAL=0x86 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xb +[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREVENTMANAGER_GETINSTANCEL=0x1 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x3 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREVENTMANAGER_RELEASEINSTANCE=0x2 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x19 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA=0x11 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTEREXIFUTIL_READEXIFDATAL=0x14 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xc +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x4 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1a +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA=0x12 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTEREXIFUTIL_READEXIFDATAL=0x15 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xd +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x5 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1b +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA=0x13 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTEREXIFUTIL_READEXIFDATAL=0x16 +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xe +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x6 +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1c +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTEREXIFUTIL_READEXIFDATAL=0x17 +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0xf +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x7 +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1d +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTEREXIFUTIL_READEXIFDATAL=0x18 +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL=0x10 +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x8 +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1e +[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0x9 +[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL=0x1f +[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT=0xa diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/traces/harvestereventmanagerTraces.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/common/traces/harvestereventmanagerTraces.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,30 @@ +// Created by TraceCompiler 2.2.3 +// DO NOT EDIT, CHANGES WILL BE LOST + +#ifndef __HARVESTEREVENTMANAGERTRACES_H__ +#define __HARVESTEREVENTMANAGERTRACES_H__ + +#define KOstTraceComponentID 0x200009fe + +#define CHARVESTEREVENTMANAGER_GETINSTANCEL 0x860001 +#define CHARVESTEREVENTMANAGER_RELEASEINSTANCE 0x860002 +#define CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860003 +#define DUP1_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860004 +#define DUP2_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860005 +#define DUP3_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860006 +#define DUP4_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860007 +#define DUP5_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860008 +#define DUP6_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x860009 +#define DUP7_CHARVESTEREVENTMANAGER_INCREASEITEMCOUNT 0x86000a +#define CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x86000b +#define DUP1_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x86000c +#define DUP2_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x86000d +#define DUP3_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x86000e +#define DUP4_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x86000f +#define DUP5_CHARVESTEREVENTMANAGER_DECREASEITEMCOUNTL 0x860010 + + +#endif + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/common/traces/harvesterexifutilTraces.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/common/traces/harvesterexifutilTraces.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,29 @@ +// Created by TraceCompiler 2.2.3 +// DO NOT EDIT, CHANGES WILL BE LOST + +#ifndef __HARVESTEREXIFUTILTRACES_H__ +#define __HARVESTEREXIFUTILTRACES_H__ + +#define KOstTraceComponentID 0x200009fe + +#define CHARVESTEREXIFUTIL_ISVALIDEXIFDATA 0x860011 +#define DUP1_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA 0x860012 +#define DUP2_CHARVESTEREXIFUTIL_ISVALIDEXIFDATA 0x860013 +#define CHARVESTEREXIFUTIL_READEXIFDATAL 0x860014 +#define DUP1_CHARVESTEREXIFUTIL_READEXIFDATAL 0x860015 +#define DUP2_CHARVESTEREXIFUTIL_READEXIFDATAL 0x860016 +#define DUP3_CHARVESTEREXIFUTIL_READEXIFDATAL 0x860017 +#define DUP4_CHARVESTEREXIFUTIL_READEXIFDATAL 0x860018 +#define CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x860019 +#define DUP1_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x86001a +#define DUP2_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x86001b +#define DUP3_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x86001c +#define DUP4_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x86001d +#define DUP5_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x86001e +#define DUP6_CHARVESTEREXIFUTIL_CONVERTEXIFDATETIMETOSYMBIANTIMEL 0x86001f + + +#endif + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/conf/harvester.confml Binary file harvester/conf/harvester.confml has changed diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/conf/harvester_200009FE.crml Binary file harvester/conf/harvester_200009FE.crml has changed diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/AudioPlugin/group/harvesteraudioplugin.mmp --- a/harvester/harvesterplugins/AudioPlugin/group/harvesteraudioplugin.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/AudioPlugin/group/harvesteraudioplugin.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -60,6 +60,7 @@ LIBRARY centralrepository.lib LIBRARY caf.lib LIBRARY cafutils.lib +LIBRARY platformenv.lib PAGED BYTEPAIRCOMPRESSTARGET diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h --- a/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudioplugin.h Thu Jul 22 16:38:01 2010 +0100 @@ -55,6 +55,7 @@ CMdEPropertyDef* iThumbnailPropertyDef; CMdEPropertyDef* iDatePropertyDef; CMdEPropertyDef* iDrmPropertyDef; + CMdEPropertyDef* iDefaultFolderPropertyDef; // Audio property definitions CMdEPropertyDef* iAlbumPropertyDef; @@ -145,7 +146,7 @@ * Get song name, artist, album, genre and composer from normal music * file (eg. mp3). */ - void GetMusicPropertiesL( CHarvesterData* aHD, TBool aIsAdd ); + void GetMusicPropertiesL( CHarvesterData* aHD, TBool aIsAdd, TPtrC aMimeType ); private: CAudioMDParser* iAudioParser; @@ -156,6 +157,9 @@ TBool iHarvestAlbumArt; TInt iMaxTextLength; + + HBufC* iPhoneSoundsPath; + HBufC* iMmcSoundsPath; }; diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/AudioPlugin/inc/harvesteraudiopluginutils.h --- a/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudiopluginutils.h Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/AudioPlugin/inc/harvesteraudiopluginutils.h Thu Jul 22 16:38:01 2010 +0100 @@ -24,6 +24,10 @@ #include "mimetypemapping.h" +// Wma extension and mime type are shared with actual audio plugin +_LIT( KExtensionWma, "wma" ); +_LIT( KMimeTypeWma, "audio/x-ms-wma"); + enum TAudioMetadataHandling { EMetaDataUtilityHandling, diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp --- a/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/AudioPlugin/src/harvesteraudioplugin.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -23,6 +23,7 @@ #include #include #include +#include #include "harvesteraudioplugin.h" #include "harvesteraudiopluginutils.h" @@ -35,8 +36,6 @@ const TUid KHarvesterRepoUid = { 0x200009FE }; const TUint32 KEnableAlbumArtHarvest = 0x00090001; -_LIT( KExtensionWma, "wma" ); - CHarvesterAudioPluginPropertyDefs::CHarvesterAudioPluginPropertyDefs() : CBase() { } @@ -53,6 +52,7 @@ iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty ); iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty ); iTimeOffsetPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTimeOffsetProperty ); + iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KInDefaultFolder ); // Media property definitions CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject ); @@ -120,6 +120,9 @@ delete iAudioParser; delete iPropDefs; delete iTNM; + + delete iPhoneSoundsPath; + delete iMmcSoundsPath; } // --------------------------------------------------------------------------- @@ -141,6 +144,17 @@ { TRAP_IGNORE( iTNM = CThumbnailManager::NewL( *this ) ); } + + + TFileName sounds = PathInfo::SoundsPath(); + + TFileName phonePath = PathInfo::PhoneMemoryRootPath(); + phonePath.Append( sounds ); + iPhoneSoundsPath = phonePath.AllocL(); + + TFileName mmcPath = PathInfo::MemoryCardRootPath(); + mmcPath.Append( sounds ); + iMmcSoundsPath = mmcPath.Right( mmcPath.Length() - 1 ).AllocL(); } // --------------------------------------------------------------------------- @@ -245,7 +259,7 @@ // get properties for file types supported by CMetaDataUtility. if( mapping->iHandler == EMetaDataUtilityHandling ) { - GetMusicPropertiesL( aHD, aIsAdd ); + GetMusicPropertiesL( aHD, aIsAdd, mapping->iMimeType ); } } } @@ -328,7 +342,7 @@ // --------------------------------------------------------------------------- // void CHarvesterAudioPlugin::GetMusicPropertiesL( CHarvesterData* aHD, - TBool aIsAdd ) + TBool aIsAdd, TPtrC aMimeType ) { #ifdef _DEBUG TTime dStart, dStop; @@ -347,12 +361,17 @@ // Prefetch max text lengt for validity checking iMaxTextLength = iPropDefs->iCopyrightPropertyDef->MaxTextLengthL(); } - - TPtrC ext; - MdsUtils::GetExt( uri, ext ); - - // Check for possibly protected content - if( ext.CompareF( KExtensionWma ) == 0 ) + + TBool possiblyProtectedContent( EFalse ); + if( aMimeType.Length() > 0 ) + { + if( aMimeType == KMimeTypeWma ) + { + possiblyProtectedContent = ETrue; + } + } + + if( possiblyProtectedContent ) { ContentAccess::CContent* content = ContentAccess::CContent::NewLC( uri ); ContentAccess::CData* data = content->OpenContentLC( ContentAccess::EPeek ); @@ -366,7 +385,7 @@ } CleanupStack::PopAndDestroy( 2 ); // content, data } - + TBool parsed( EFalse ); TRAPD( parseError, parsed = iAudioParser->ParseL( uri ) ); @@ -395,7 +414,22 @@ TTimeIntervalSeconds timeOffsetSeconds = User::UTCOffset(); TInt16 timeOffsetMinutes = timeOffsetSeconds.Int() / 60; CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iTimeOffsetPropertyDef, &timeOffsetMinutes, aIsAdd ); - + + if( !mdeObject.Placeholder() ) + { + if( uri.FindF( iMmcSoundsPath->Des()) != KErrNotFound || + uri.FindF( iPhoneSoundsPath->Des()) != KErrNotFound ) + { + TBool inDefaultFolder( ETrue ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } + else + { + TBool inDefaultFolder( EFalse ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } + } + if ( song.Length() > 0 && song.Length() < KMaxTitleFieldLength ) { diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/AudioPlugin/src/harvesteraudiopluginutils.cpp --- a/harvester/harvesterplugins/AudioPlugin/src/harvesteraudiopluginutils.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/AudioPlugin/src/harvesteraudiopluginutils.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -34,7 +34,6 @@ _LIT( KMimeTypeMxmf, "audio/vnd.nokia.mobile-xmf" ); _LIT( KMimeTypeWav, "audio/wav" ); _LIT( KMimeTypeAu, "audio/au" ); -_LIT( KMimeTypeWma, "audio/x-ms-wma"); _LIT( KMimeTypeAudioMatroska, "audio/x-matroska"); _LIT( KExtensionMp3, "mp3" ); @@ -48,7 +47,6 @@ _LIT( KExtensionMxmf, "mxmf" ); _LIT( KExtensionWav, "wav" ); _LIT( KExtensionAu, "au" ); -_LIT( KExtensionWma, "wma" ); _LIT( KExtensionNrt, "nrt" ); _LIT( KExtensionMka, "mka" ); diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/ImagePlugin/group/harvesterimageplugin.mmp --- a/harvester/harvesterplugins/ImagePlugin/group/harvesterimageplugin.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/ImagePlugin/group/harvesterimageplugin.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -48,12 +48,13 @@ LIBRARY efsrv.lib LIBRARY imageconversion.lib LIBRARY fbscli.lib -LIBRARY lbs.lib -LIBRARY etel3rdparty.lib +LIBRARY lbs.lib +LIBRARY etel3rdparty.lib LIBRARY harvesterplugininterface.lib LIBRARY mdeclient.lib -LIBRARY harvesterdata.lib -LIBRARY harvestercommon.lib +LIBRARY harvesterdata.lib +LIBRARY harvestercommon.lib +LIBRARY platformenv.lib PAGED BYTEPAIRCOMPRESSTARGET diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/ImagePlugin/inc/harvesterimageplugin.h --- a/harvester/harvesterplugins/ImagePlugin/inc/harvesterimageplugin.h Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/ImagePlugin/inc/harvesterimageplugin.h Thu Jul 22 16:38:01 2010 +0100 @@ -56,6 +56,7 @@ CMdEPropertyDef* iCaptureDatePropertyDef; CMdEPropertyDef* iResolutionUnitPropertyDef; CMdEPropertyDef* iArtistPropertyDef; + CMdEPropertyDef* iDefaultFolderPropertyDef; // Image property definitions CMdEPropertyDef* iPixelYDimensionPropertyDef; @@ -199,6 +200,9 @@ CHarvesterImagePluginPropertyDefs* iPropDefs; TInt iMaxTextLength; + + HBufC* iPhoneImagesPath; + HBufC* iMmcImagesPath; }; #endif diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp --- a/harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/ImagePlugin/src/harvesterimageplugin.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -20,12 +20,14 @@ #include #include #include +#include #include "harvesterlog.h" #include "mdsutils.h" #include "harvesterexifutil.h" #include "harvesterimageplugin.h" #include "mdeobjectwrapper.h" +#include "mdscommoninternal.h" using namespace MdeConstants; @@ -82,6 +84,7 @@ iSizePropertyDef = &objectDef.GetPropertyDefL( Object::KSizeProperty ); iTimeOffsetPropertyDef = &objectDef.GetPropertyDefL( Object::KTimeOffsetProperty ); iItemTypePropertyDef = &objectDef.GetPropertyDefL( Object::KItemTypeProperty ); + iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( Object::KInDefaultFolder ); // Media property definitions CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MediaObject::KMediaObject ); @@ -191,6 +194,9 @@ delete iPropDefs; + delete iPhoneImagesPath; + delete iMmcImagesPath; + iMimeTypeMappings.Close(); iFbs.Disconnect(); } @@ -255,7 +261,16 @@ User::LeaveIfError( iMimeTypeMappings.InsertInOrder( TMimeTypeMapping( KExtOtb(), KOtbMime(), EOtherHandling ), cmp ) ); + + TFileName images = PathInfo::ImagesPath(); + TFileName phonePath = PathInfo::PhoneMemoryRootPath(); + phonePath.Append( images ); + iPhoneImagesPath = phonePath.AllocL(); + + TFileName mmcPath = PathInfo::MemoryCardRootPath(); + mmcPath.Append( images ); + iMmcImagesPath = mmcPath.Right( mmcPath.Length() - 1 ).AllocL(); } void CHarvesterImagePlugin::HarvestL( CHarvesterData* aHD ) @@ -711,8 +726,22 @@ // Item Type CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iItemTypePropertyDef, &aFileData.iMime16, aIsAdd ); + + const TDesC& uri = mdeObject.Uri(); + if( uri.FindF( iMmcImagesPath->Des()) != KErrNotFound || + uri.FindF( iPhoneImagesPath->Des()) != KErrNotFound || + uri.FindF( KDCIMFolder ) != KErrNotFound ) + { + TBool inDefaultFolder( ETrue ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } + else + { + TBool inDefaultFolder( EFalse ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } } - + if( aFileData.iJpeg ) { // Time offset diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/OMADRMPlugin/group/harvesteromadrmplugin.mmp --- a/harvester/harvesterplugins/OMADRMPlugin/group/harvesteromadrmplugin.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/OMADRMPlugin/group/harvesteromadrmplugin.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -53,6 +53,7 @@ LIBRARY mdeclient.lib LIBRARY harvesterdata.lib LIBRARY harvestercommon.lib +LIBRARY platformenv.lib PAGED BYTEPAIRCOMPRESSTARGET diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/OMADRMPlugin/inc/harvesteromadrmplugin.h --- a/harvester/harvesterplugins/OMADRMPlugin/inc/harvesteromadrmplugin.h Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/OMADRMPlugin/inc/harvesteromadrmplugin.h Thu Jul 22 16:38:01 2010 +0100 @@ -83,6 +83,7 @@ CMdEPropertyDef* iDescriptionPropertyDef; CMdEPropertyDef* iAuthorPropertyDef; CMdEPropertyDef* iGenrePropertyDef; + CMdEPropertyDef* iDefaultFolderPropertyDef; private: CHarvesterOmaDrmPluginPropertyDefs(); @@ -157,6 +158,15 @@ CHarvesterOmaDrmPluginPropertyDefs* iPropDefs; TInt iMaxTextLength; + + HBufC* iPhoneImagesPath; + HBufC* iMmcImagesPath; + + HBufC* iPhoneVideosPath; + HBufC* iMmcVideosPath; + + HBufC* iPhoneSoundsPath; + HBufC* iMmcSoundsPath; }; #endif // __CHarvesterOMADRMPlugin_H__ diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp --- a/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/OMADRMPlugin/src/harvesteromadrmplugin.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -17,10 +17,12 @@ #include #include +#include #include "mdsutils.h" #include "harvesteromadrmplugin.h" #include "harvesterlog.h" +#include "harvestercommon.h" #include "mdeobjectwrapper.h" #include "mdscommoninternal.h" #include @@ -38,6 +40,7 @@ _LIT(KRmMimetype, "realmedia"); _LIT( KSvgMime, "image/svg+xml" ); +_LIT( KRingingToneMime, "application/vnd.nokia.ringing-tone" ); _LIT(KInUse, "InUse"); @@ -56,6 +59,7 @@ iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty ); iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty ); iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty ); + iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KInDefaultFolder ); CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject ); iDrmPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDRMProperty ); @@ -104,6 +108,15 @@ { WRITELOG("CHarvesterOMADRMPlugin::~CHarvesterOMADRMPlugin()"); + delete iPhoneImagesPath; + delete iMmcImagesPath; + + delete iPhoneVideosPath; + delete iMmcVideosPath; + + delete iPhoneSoundsPath; + delete iMmcSoundsPath; + delete iPropDefs; } @@ -113,6 +126,39 @@ void CHarvesterOMADRMPlugin::ConstructL() { WRITELOG( "CHarvesterOMADRMPlugin::ConstructL()" ); + + TFileName phoneRoot = PathInfo::PhoneMemoryRootPath(); + TFileName mmcRoot = PathInfo::MemoryCardRootPath(); + + TFileName images = PathInfo::ImagesPath(); + + TFileName phoneImagePath( phoneRoot ); + phoneImagePath.Append( images ); + iPhoneImagesPath = phoneImagePath.AllocL(); + + TFileName mmcImagePath( mmcRoot ); + mmcImagePath.Append( images ); + iMmcImagesPath = mmcImagePath.Right( mmcImagePath.Length() - 1 ).AllocL(); + + TFileName videos = PathInfo::VideosPath(); + + TFileName phoneVideoPath( phoneRoot ); + phoneVideoPath.Append( videos ); + iPhoneVideosPath = phoneVideoPath.AllocL(); + + TFileName mmcVideoPath( mmcRoot ); + mmcVideoPath.Append( videos ); + iMmcVideosPath = mmcVideoPath.Right( mmcVideoPath.Length() - 1 ).AllocL(); + + TFileName sounds = PathInfo::SoundsPath(); + + TFileName phoneSoundPath( phoneRoot ); + phoneSoundPath.Append( sounds ); + iPhoneSoundsPath = phoneSoundPath.AllocL(); + + TFileName mmcSoundPath( mmcRoot ); + mmcSoundPath.Append( sounds ); + iMmcSoundsPath = mmcSoundPath.Right( mmcSoundPath.Length() - 1 ).AllocL(); } void CHarvesterOMADRMPlugin::HarvestL( CHarvesterData* aHD ) @@ -250,7 +296,7 @@ } // --------------------------------------------------------------------------- -// HandleNewObjectL +// HandleObjectPropertiesL // --------------------------------------------------------------------------- // void CHarvesterOMADRMPlugin::HandleObjectPropertiesL( @@ -283,8 +329,57 @@ // File size CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iSizePropertyDef, &aVHD.iFileSize, aIsAdd ); + + TPtrC objectDefName( mdeObject.Def().Name() ); + if( objectDefName == MdeConstants::Image::KImageObject ) + { + const TDesC& uri = mdeObject.Uri(); + if( uri.FindF( iMmcImagesPath->Des()) != KErrNotFound || + uri.FindF( iPhoneImagesPath->Des()) != KErrNotFound || + uri.FindF( KDCIMFolder ) != KErrNotFound ) + { + TBool inDefaultFolder( ETrue ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } + else + { + TBool inDefaultFolder( EFalse ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } + } + else if( objectDefName == MdeConstants::Video::KVideoObject ) + { + const TDesC& uri = mdeObject.Uri(); + if( uri.FindF( iMmcVideosPath->Des()) != KErrNotFound || + uri.FindF( iPhoneVideosPath->Des()) != KErrNotFound || + uri.FindF( KDCIMFolder ) != KErrNotFound ) + { + TBool inDefaultFolder( ETrue ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } + else + { + TBool inDefaultFolder( EFalse ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } + } + else if( objectDefName == MdeConstants::Audio::KAudioObject ) + { + const TDesC& uri = mdeObject.Uri(); + if( uri.FindF( iMmcSoundsPath->Des()) != KErrNotFound || + uri.FindF( iPhoneSoundsPath->Des()) != KErrNotFound ) + { + TBool inDefaultFolder( ETrue ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } + else + { + TBool inDefaultFolder( EFalse ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } + } } - + // Item Type if(aVHD.iMimetype.Length() > 0) { @@ -344,6 +439,50 @@ err = content->GetStringAttribute( ContentAccess::EMimeType, mime ); delete content; } + +#ifdef _DEBUG + if( err == KErrInUse || err == KErrLocked ) + { + TPtrC fileName( aUri.Mid(2) ); + WRITELOG1( "CHarvesterOMADRMPlugin :: Checking open file handles to %S", &fileName ); + + CFileList* fileList = 0; + TOpenFileScan fileScan( iFs ); + + TRAP_IGNORE( fileScan.NextL( fileList ) ); + + while ( fileList ) + { + const TInt count( fileList->Count() ); + for (TInt i = 0; i < count; i++ ) + { + if ( (*fileList)[i].iName == aUri.Mid(2) ) + { + TFullName processName; + TFindThread find(_L("*")); + while( find.Next( processName ) == KErrNone ) + { + RThread thread; + TInt error = thread.Open( processName ); + + if ( error == KErrNone ) + { + if ( thread.Id().Id() == fileScan.ThreadId() ) + { + processName = thread.Name(); + thread.Close(); + WRITELOG1( "CHarvesterOMADRMPlugin :: %S has a file handle open", &processName ); + break; + } + thread.Close(); + } + } + } + } + TRAP_IGNORE( fileScan.NextL( fileList ) ); + } + } +#endif if( err == KErrInUse || err == KErrLocked ) { @@ -391,6 +530,13 @@ aObjectType.Copy( KVideo ); return; } + + if( mime == KRingingToneMime ) + { + WRITELOG1( "CHarvesterOMADRMPlugin::GetObjectType - mimetype %S. Object type changed to Audio", &mime ); + aObjectType.Copy( KAudio ); + return; + } } WRITELOG1( "CHarvesterOMADRMPlugin::GetObjectType - ERROR: mimetype %S. No object type found", &mime ); diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/RTPPlugin/inc/harvesterrtpplugin.h --- a/harvester/harvesterplugins/RTPPlugin/inc/harvesterrtpplugin.h Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/RTPPlugin/inc/harvesterrtpplugin.h Thu Jul 22 16:38:01 2010 +0100 @@ -43,6 +43,7 @@ CMdEPropertyDef* iSizePropertyDef; CMdEPropertyDef* iItemTypePropertyDef; CMdEPropertyDef* iTitlePropertyDef; + CMdEPropertyDef* iDefaultFolderPropertyDef; // Media property definitions CMdEPropertyDef* iCaptureDatePropertyDef; diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp --- a/harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/RTPPlugin/src/harvesterrtpplugin.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -50,6 +50,7 @@ iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty ); iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty ); iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty ); + iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KInDefaultFolder ); CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject ); iCaptureDatePropertyDef =& mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KCaptureDateProperty ); @@ -285,6 +286,10 @@ // Mime Type CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iItemTypePropertyDef, &aClipDetails.iMimeType, aIsAdd ); + // Default folder + TBool inDefaultFolder( ETrue ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, + *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); } // Title (is set from URI by default) diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/VideoPlugin/data/200009f9.rss --- a/harvester/harvesterplugins/VideoPlugin/data/200009f9.rss Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/VideoPlugin/data/200009f9.rss Thu Jul 22 16:38:01 2010 +0100 @@ -42,7 +42,7 @@ version_no = 1; display_name = "Harvester video plugin"; default_data = "Video Audio"; - opaque_data = "mp4 mpg4 mpeg4 m4v m4a 3gp 3gpp rm rv rmvb 3g2 avi mkv ra wmv divx"; + opaque_data = "mp4 mpg4 mpeg4 m4v m4a 3gp 3gpp rm rv rmvb 3g2 avi mkv ra wmv divx asf"; rom_only = 0; } }; diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/VideoPlugin/group/harvestervideoplugin.mmp --- a/harvester/harvesterplugins/VideoPlugin/group/harvestervideoplugin.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/VideoPlugin/group/harvestervideoplugin.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -54,6 +54,7 @@ LIBRARY harvestercommon.lib LIBRARY caf.lib LIBRARY cafutils.lib +LIBRARY platformenv.lib STATICLIBRARY hxmetadatautil.lib diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/VideoPlugin/inc/harvestervideoplugin.h --- a/harvester/harvesterplugins/VideoPlugin/inc/harvestervideoplugin.h Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/VideoPlugin/inc/harvestervideoplugin.h Thu Jul 22 16:38:01 2010 +0100 @@ -139,6 +139,7 @@ CMdEPropertyDef* iArtistPropertyDef; CMdEPropertyDef* iDescriptionPropertyDef; CMdEPropertyDef* iDrmPropertyDef; + CMdEPropertyDef* iDefaultFolderPropertyDef; CMdEPropertyDef* iAudioFourCCDef; @@ -220,6 +221,12 @@ void GetMp4Type( RFile64& aFile, TDes& aType ); void GetRmTypeL( RFile64& aFile, TDes& aType ); + + TInt AddFileToBlackList( const TFileName& aFullName, const TUint32& aMediaId ); + + TInt RemoveFileFromBlackList( const TFileName& aFullName, const TUint32& aMediaId ); + + TInt GetFileFullNameAndMediaId( const RFile64& aFile, TFileName& aFullName, TUint32& mediaId); const THarvestingHandling* FindHandler( const TDesC& aUri ); @@ -234,6 +241,9 @@ // not own CHarvesterMediaIdUtil* iMediaIdUtil; + + HBufC* iPhoneVideosPath; + HBufC* iMmcVideosPath; }; #endif // __CHARVESTERVIDEOPLUGIN_H__ diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp --- a/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -21,6 +21,7 @@ #include #include #include +#include #include "mdsutils.h" #include "harvestervideoplugin.h" @@ -51,6 +52,7 @@ _LIT( KMimeTypeAudioMatroska, "audio/x-matroska"); _LIT( KMimeTypeWmv, "video/x-ms-wmv"); _LIT( KMimeTypeDivx, "video/x-hx-divx"); +_LIT( KMimeTypeAsf, "video/x-ms-asf"); _LIT( KExtensionMp4, "mp4" ); _LIT( KExtensionMpg4, "mpg4" ); @@ -68,6 +70,7 @@ _LIT( KExtensionRa, "ra" ); _LIT( KExtensionWmv, "wmv" ); _LIT( KExtensionDivx, "divx" ); +_LIT( KExtensionAsf, "asf" ); _LIT(KVideo, "Video"); _LIT(KAudio, "Audio"); @@ -98,6 +101,7 @@ iTimeOffsetPropertyDef = &objectDef.GetPropertyDefL( Object::KTimeOffsetProperty ); iItemTypePropertyDef = &objectDef.GetPropertyDefL( Object::KItemTypeProperty ); iTitlePropertyDef = &objectDef.GetPropertyDefL( Object::KTitleProperty ); + iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( Object::KInDefaultFolder ); CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MediaObject::KMediaObject ); iReleaseDatePropertyDef = &mediaDef.GetPropertyDefL( MediaObject::KReleaseDateProperty ); @@ -164,6 +168,9 @@ iMimeTypeMappings.Close(); RMediaIdUtil::ReleaseInstance(); + delete iPhoneVideosPath; + delete iMmcVideosPath; + WRITELOG("CHarvesterVideoPlugin::CHarvesterVideoPlugin()"); } @@ -269,6 +276,23 @@ TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KVideo(), KMimeTypeWmv(), KMimeTypeWmv() ) ), cmp ) ); + + // Asf + User::LeaveIfError( iMimeTypeMappings.InsertInOrder( THarvestingHandling( + KExtensionAsf(), KMimeTypeAsf(), + TVideoMetadataHandling( TVideoMetadataHandling::EHexilMetadataHandling, KVideo(), + KMimeTypeAsf(), KMimeTypeAsf() ) ), + cmp ) ); + + TFileName videos = PathInfo::VideosPath(); + + TFileName phonePath = PathInfo::PhoneMemoryRootPath(); + phonePath.Append( videos ); + iPhoneVideosPath = phonePath.AllocL(); + + TFileName mmcPath = PathInfo::MemoryCardRootPath(); + mmcPath.Append( videos ); + iMmcVideosPath = mmcPath.Right( mmcPath.Length() - 1 ).AllocL(); iMediaIdUtil = &RMediaIdUtil::GetInstanceL(); } @@ -399,7 +423,7 @@ } else { - WRITELOG1( "CHarvesterVideoPlugin::HarvestSingleFileL() - TRAP error: %d", error ); + WRITELOG1( "CHarvesterVideoPlugin::HarvestL() - TRAP error: %d", error ); TInt convertedError = KErrNone; MdsUtils::ConvertTrapError( error, convertedError ); aHD->SetErrorCode( convertedError ); @@ -434,6 +458,12 @@ void CHarvesterVideoPlugin::GatherDataL( CMdEObject& aMetadataObject, CVideoHarvestData& aVHD ) { +#ifdef _DEBUG + TTime dStart, dStop; + dStart.UniversalTime(); + dStop.UniversalTime(); + WRITELOG1( "CHarvesterVideoPlugin::GatherDataL start %d us", (TInt)dStop.MicroSecondsFrom(dStart).Int64() ); +#endif const TDesC& uri = aMetadataObject.Uri(); WRITELOG1( "CHarvesterVideoPlugin - Gather data from file %S", &uri ); @@ -759,7 +789,6 @@ aVHD.iMimeBuf = mime.Alloc(); } - helixMetadata->ResetL(); CleanupStack::PopAndDestroy( helixMetadata ); // don't destory mime type pointers just clean array @@ -933,6 +962,11 @@ WRITELOG( "CHarvesterVideoPlugin - Closing file" ); CleanupStack::PopAndDestroy( &file ); +#ifdef _DEBUG + dStop.UniversalTime(); + WRITELOG1( "CHarvesterVideoPlugin::GatherDataL start %d us", (TInt)dStop.MicroSecondsFrom(dStart).Int64() ); +#endif + WRITELOG( "CHarvesterVideoPlugin - Start adding data to object" ); } @@ -970,6 +1004,21 @@ // File size CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iSizePropertyDef, &aVHD.iFileSize, aIsAdd ); + + // Default folder + const TDesC& uri = mdeObject.Uri(); + if( uri.FindF( iMmcVideosPath->Des()) != KErrNotFound || + uri.FindF( iPhoneVideosPath->Des()) != KErrNotFound || + uri.FindF( KDCIMFolder ) != KErrNotFound ) + { + TBool inDefaultFolder( ETrue ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } + else + { + TBool inDefaultFolder( EFalse ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } } // Item Type @@ -1106,6 +1155,16 @@ void CHarvesterVideoPlugin::GetMp4Type( RFile64& aFile, TDes& aType ) { WRITELOG( "CHarvesterVideoPlugin::GetMp4Mime - MP4ParseOpenFileHandle - start" ); + TFileName tempName; + TUint32 mediaId( 0 ); + TInt blackListError( KErrNone ); + + blackListError = GetFileFullNameAndMediaId( aFile, tempName, mediaId ); + if( blackListError == KErrNone ) + { + blackListError == AddFileToBlackList( tempName, mediaId ); + } + MP4Handle handle; MP4Err mp4err = MP4ParseOpenFileHandle64( &handle, &aFile ); @@ -1141,6 +1200,11 @@ aType.Copy( KVideo() ); } + if( blackListError == KErrNone ) + { + RemoveFileFromBlackList( tempName, mediaId ); + } + MP4ParseClose( handle ); } #else @@ -1156,27 +1220,14 @@ CHXMetaDataUtility* helixMetadata = CHXMetaDataUtility::NewL(); CleanupStack::PushL( helixMetadata ); - TFileName tempName; - TUint32 mediaId( 0 ); - TInt blackListError( KErrNone ); - - if( iBlacklist ) + TFileName tempName; + TUint32 mediaId( 0 ); + TInt blackListError( KErrNone ); + + blackListError = GetFileFullNameAndMediaId( aFile, tempName, mediaId ); + if( blackListError == KErrNone ) { - WRITELOG( "CHarvesterVideoPlugin::GetRmTypeL - Adding URI to blacklist" ); - blackListError = aFile.FullName( tempName ); - if( blackListError == KErrNone ) - { - blackListError = iMediaIdUtil->GetMediaId( tempName, mediaId ); - if( blackListError == KErrNone ) - { - TTime modified ( 0 ); - blackListError = iFs.Modified( tempName, modified ); - if( blackListError == KErrNone ) - { - iBlacklist->AddFile( tempName, mediaId, modified ); - } - } - } + AddFileToBlackList( tempName, mediaId ); } TRAPD( err, helixMetadata->OpenFileL( aFile ) ); @@ -1219,7 +1270,7 @@ // "application/vnd.rn-realmedia" or "application/vnd.rn-realmedia-vbr" if( MdsUtils::Find( *mime, KMimeTypeRm() ) != KErrNotFound ) { - WRITELOG1( "CHarvesterVideoPlugin::GetObjectType - mimetype %S. Object type Rm", mime ); + WRITELOG1( "CHarvesterVideoPlugin::GetRmTypeL - mimetype %S. Object type Rm", mime ); if( possibleVideo ) { aType.Copy( KVideo ); @@ -1233,7 +1284,7 @@ } else if( MdsUtils::Find( *mime, KVideo() ) != KErrNotFound ) { - WRITELOG1( "CHarvesterVideoPlugin::GetObjectType - mimetype %S. Object type Video", mime ); + WRITELOG1( "CHarvesterVideoPlugin::GetRmTypeL - mimetype %S. Object type Video", mime ); aType.Copy( KVideo ); // use MIME with "video" substring, if file might be video @@ -1244,7 +1295,7 @@ } else if( MdsUtils::Find( *mime, KAudio() ) != KErrNotFound ) { - WRITELOG1( "CHarvesterVideoPlugin::GetObjectType - mimetype %S. Object type Audio", mime ); + WRITELOG1( "CHarvesterVideoPlugin::GetRmTypeL - mimetype %S. Object type Audio", mime ); aType.Copy( KAudio ); } // Set to Video, regardless how badly file is corrupted @@ -1263,16 +1314,63 @@ aType.Copy( KVideo ); } - if ( iBlacklist && blackListError == KErrNone ) + if( blackListError == KErrNone ) { - WRITELOG( "CHarvesterVideoPlugin::GetRmTypeL - Removing URI from blacklist" ); - iBlacklist->RemoveFile( tempName, mediaId ); + RemoveFileFromBlackList( tempName, mediaId ); } - helixMetadata->ResetL(); CleanupStack::PopAndDestroy( helixMetadata ); } +TInt CHarvesterVideoPlugin::AddFileToBlackList( const TFileName& aFullName, const TUint32& aMediaId ) + { + TInt blackListError( KErrNone ); + + TTime modified ( 0 ); + blackListError = iFs.Modified( aFullName, modified ); + if( blackListError == KErrNone ) + { + WRITELOG( "CHarvesterVideoPlugin::AddFileToBlackList - Adding URI to blacklist" ); + iBlacklist->AddFile( aFullName, aMediaId, modified ); + } + + return blackListError; + } + +TInt CHarvesterVideoPlugin::RemoveFileFromBlackList( const TFileName& aFullName, const TUint32& aMediaId ) + { + TInt blackListError( KErrNone ); + + if( iBlacklist ) + { + WRITELOG( "CHarvesterVideoPlugin::RemoveFileFromBlackList - Removing URI from blacklist" ); + blackListError = iBlacklist->RemoveFile( aFullName, aMediaId ); + } + + return blackListError; + } + +TInt CHarvesterVideoPlugin::GetFileFullNameAndMediaId( const RFile64& aFile, TFileName& aFullName, TUint32& aMediaId) + { + TInt blackListError( KErrNone ); + + if( iBlacklist ) + { + WRITELOG( "CHarvesterVideoPlugin::GetFileFullNameAndMediaId" ); + blackListError = aFile.FullName( aFullName ); + if( blackListError == KErrNone ) + { + blackListError = iMediaIdUtil->GetMediaId( aFullName, aMediaId ); + } + } + else + { + blackListError = KErrNotReady; + } + + return blackListError; + } + const THarvestingHandling* CHarvesterVideoPlugin::FindHandler( const TDesC& aUri ) { TParsePtrC parse( aUri ); diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/WMVPlugin/data/2000B431.rss --- a/harvester/harvesterplugins/WMVPlugin/data/2000B431.rss Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/WMVPlugin/data/2000B431.rss Thu Jul 22 16:38:01 2010 +0100 @@ -44,7 +44,7 @@ version_no = 1; display_name = "Harvester WMV Plugin"; default_data = "Video"; - opaque_data = "wm asf"; + opaque_data = "wm"; rom_only = 0; } }; diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/WMVPlugin/group/harvesterwmvplugin.mmp --- a/harvester/harvesterplugins/WMVPlugin/group/harvesterwmvplugin.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/WMVPlugin/group/harvesterwmvplugin.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -52,6 +52,7 @@ LIBRARY harvesterplugininterface.lib LIBRARY mdeclient.lib LIBRARY harvesterdata.lib +LIBRARY platformenv.lib PAGED BYTEPAIRCOMPRESSTARGET diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/WMVPlugin/inc/harvesterwmvplugin.h --- a/harvester/harvesterplugins/WMVPlugin/inc/harvesterwmvplugin.h Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/WMVPlugin/inc/harvesterwmvplugin.h Thu Jul 22 16:38:01 2010 +0100 @@ -47,6 +47,7 @@ CMdEPropertyDef* iDescriptionPropertyDef; CMdEPropertyDef* iAuthorPropertyDef; CMdEPropertyDef* iGenrePropertyDef; + CMdEPropertyDef* iDefaultFolderPropertyDef; private: CHarvesterWmvPluginPropertyDefs(); @@ -184,6 +185,9 @@ CHarvesterWmvPluginPropertyDefs* iPropDefs; TInt iMaxTextLength; + + HBufC* iPhoneVideosPath; + HBufC* iMmcVideosPath; }; #endif // C_HARVESTERWMVPLUGIN_H diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp --- a/harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/harvesterplugins/WMVPlugin/src/harvesterwmvplugin.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -17,6 +17,7 @@ #include #include +#include #include "mdsutils.h" #include "harvesterdata.h" @@ -45,6 +46,7 @@ iSizePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty ); iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty ); iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty ); + iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KInDefaultFolder ); CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject ); iDrmPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KDRMProperty ); @@ -87,6 +89,9 @@ { WRITELOG( "CHarvesterWMVPlugin::~CHarvesterWMVPlugin()" ); delete iPropDefs; + + delete iPhoneVideosPath; + delete iMmcVideosPath; } // --------------------------------------------------------------------------- @@ -164,6 +169,17 @@ void CHarvesterWMVPlugin::ConstructL() { WRITELOG( "CHarvesterWMVPlugin::ConstructL()" ); + + TFileName videos = PathInfo::VideosPath(); + + TFileName phonePath = PathInfo::PhoneMemoryRootPath(); + phonePath.Append( videos ); + iPhoneVideosPath = phonePath.AllocL(); + + TFileName mmcPath = PathInfo::MemoryCardRootPath(); + mmcPath.Append( videos ); + iMmcVideosPath = mmcPath.Right( mmcPath.Length() - 1 ).AllocL(); + SetPriority( KHarvesterPriorityHarvestingPlugin - 1 ); } @@ -302,6 +318,20 @@ // Mime Type CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iItemTypePropertyDef, &aClipDetails.iMimeType, aIsAdd ); + + const TDesC& uri = mdeObject.Uri(); + if( uri.FindF( iMmcVideosPath->Des()) != KErrNotFound || + uri.FindF( iPhoneVideosPath->Des()) != KErrNotFound || + uri.FindF( KDCIMFolder ) != KErrNotFound ) + { + TBool inDefaultFolder( ETrue ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } + else + { + TBool inDefaultFolder( EFalse ); + CMdeObjectWrapper::HandleObjectPropertyL(mdeObject, *iPropDefs->iDefaultFolderPropertyDef, &inDefaultFolder, aIsAdd ); + } } // DRM protection diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/monitorplugins/mdsfileserverplugin/inc/mdsfileserverplugin.h --- a/harvester/monitorplugins/mdsfileserverplugin/inc/mdsfileserverplugin.h Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/monitorplugins/mdsfileserverplugin/inc/mdsfileserverplugin.h Thu Jul 22 16:38:01 2010 +0100 @@ -111,10 +111,15 @@ * * @param aFilename Filename to check. * @param aIsDirectory ETrue if filename points to directory. + * @param aFsPlugin Reference to Fileserver Plugin. + * @param aDelete Indicates if file deletion is in question. * * @return EFalse, if path or file has a hidden or system attribute set. */ - TBool CheckAttribs( const TDesC& aFilename, TBool& aIsDirectory ) const; + TBool CheckAttribs( const TDesC& aFilename, + TBool& aIsDirectory, + RFsPlugin& aFsPlugin, + TBool aDelete) const; /** * Check if directory is named correctly and ends with backslash. @@ -127,6 +132,19 @@ * Check if harvester (main observer) is alive */ TBool CheckHarvesterStatus(); + + /** + * Checks file entry path and attributes for validity + * + * @param aFilename Filename to check. + * @param aIsDirectory ETrue if filename points to directory. + * @param aRequest Reference to request from file server. + * @param aDelete Indicates if file deletion is in question. + * + * @return EFalse if file is not to be handled + */ + TBool CheckIfValidFile( const TDesC& aFilename, + TBool& aIsDirectory, TFsPluginRequest& aRequest, TBool aDelete ); #ifdef _DEBUG_EVENTS void RegisterDebugEventsL(); @@ -151,12 +169,7 @@ RPointerArray iQueue; RPointerArray iIgnorePaths; - - /** - * File system client session. - */ - RFs iFsSession; - + RPointerArray iCreatedFiles; RPointerArray iModifiedFiles; diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/monitorplugins/mdsfileserverplugin/src/mdsfileserverplugin.cpp --- a/harvester/monitorplugins/mdsfileserverplugin/src/mdsfileserverplugin.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/monitorplugins/mdsfileserverplugin/src/mdsfileserverplugin.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -21,6 +21,8 @@ #include "mdsutils.h" _LIT( KMdsFileServerPlugin, "MdsFileServerPlugin" ); +_LIT( KExludedThumbPath, "\\_PAlbTN\\"); +_LIT( KExludedMediaArtPath, "\\.mediaartlocal\\"); /* Server name */ _LIT( KHarvesterServerName, "HarvesterServer" ); @@ -45,8 +47,13 @@ { WRITELOG( "CMdsFileServerPlugin::~CMdsFileServerPlugin()" ); - TRAP_IGNORE( DisableL() ); - iFsSession.Close(); +#ifdef _DEBUG + TRAPD( error, DisableL() ); + _LIT( KPanicCategory,"CMdsFileServerPlugin" ); + __ASSERT_DEBUG( error == KErrNone, User::Panic( KPanicCategory, error ) ); +#else + TRAP_IGNORE( DisableL() ); +#endif iCreatedFiles.ResetAndDestroy(); iCreatedFiles.Close(); @@ -81,7 +88,6 @@ void CMdsFileServerPlugin::InitialiseL() { WRITELOG( "CMdsFileServerPlugin::InitializeL()" ); - User::LeaveIfError( iFsSession.Connect() ); } //----------------------------------------------------------------------------- @@ -174,7 +180,7 @@ // TInt CMdsFileServerPlugin::DoRequestL( TFsPluginRequest& aRequest ) { - // ignore event if there is no any client listening + // ignore event if there are not any clients listening if( iConnectionCount <= 0 ) { WRITELOG( "CMdsFileServerPlugin::DoRequestL() - no clients -> ignore event" ); @@ -201,7 +207,7 @@ return KErrNone; } - const TBool formatFunction = function == EFsFormatOpen || function == EFsFormatSubClose; + const TBool formatFunction( function == EFsFormatOpen || function == EFsFormatSubClose ); WRITELOG1( "----- CMdsFileServerPlugin::DoRequestL() - plugin function: %d -----", function ); @@ -218,9 +224,7 @@ } // get process id - TUid processId = { 0 }; - - processId = aRequest.Message().SecureId(); + TUid processId = aRequest.Message().SecureId(); TBool isDirectory = EFalse; @@ -235,6 +239,7 @@ return KErrNone; } WRITELOG2( "CMdsFileServerPlugin::DoRequestL() - newFileName: '%S' %d", &iNewFileName, newNameErr ); + TBool setToBeDeleted( EFalse ); if ( newNameErr == KErrNone ) { if ( !CheckPath(iNewFileName) ) @@ -248,47 +253,43 @@ } // file moved to ignored path, delete from db function = EFsDelete; + setToBeDeleted = ETrue; } - if ( !CheckAttribs( iNewFileName, isDirectory ) ) + if( !setToBeDeleted ) { - WRITELOG( "CMdsFileServerPlugin::DoRequestL() - new path attribute check failed" ); - if( !CheckAttribs(iFileName, isDirectory) ) + RFsPlugin fsPlugin( aRequest ); + const TInt rfsPluginErr = fsPlugin.Connect(); + + if ( ( rfsPluginErr == KErrNone ) && !CheckAttribs( iNewFileName, isDirectory, fsPlugin, EFalse ) ) { - WRITELOG( "CMdsFileServerPlugin::DoRequestL() - old path attribute check failed" ); - WRITELOG( "CMdsFileServerPlugin::DoRequestL() - ignore file" ); - return KErrNone; + WRITELOG( "CMdsFileServerPlugin::DoRequestL() - new path attribute check failed" ); + if( !CheckAttribs(iFileName, isDirectory, fsPlugin, EFalse) ) + { + WRITELOG( "CMdsFileServerPlugin::DoRequestL() - old path attribute check failed" ); + WRITELOG( "CMdsFileServerPlugin::DoRequestL() - ignore file" ); + fsPlugin.Close(); + return KErrNone; + } + // file set to hidden, delete from db + function = EFsDelete; } - // file set to hidden, delete from db - function = EFsDelete; + fsPlugin.Close(); } } else { - if ( !CheckPath(iFileName) ) + if( !CheckIfValidFile(iFileName, isDirectory, aRequest, EFalse) ) { - WRITELOG( "CMdsFileServerPlugin::DoRequestL() - path not supported" ); - return KErrNone; - } - - if ( !CheckAttribs(iFileName, isDirectory) ) - { - WRITELOG( "CMdsFileServerPlugin::DoRequestL() - attribute check failed" ); return KErrNone; } } } else if ( !formatFunction ) { - if ( !CheckPath(iFileName) ) + const TBool deleteFunction( function == EFsDelete ); + if( !CheckIfValidFile(iFileName, isDirectory, aRequest, deleteFunction) ) { - WRITELOG( "CMdsFileServerPlugin::DoRequestL() - path not supported" ); - return KErrNone; - } - - if ( !CheckAttribs( iFileName, isDirectory ) ) - { - WRITELOG( "CMdsFileServerPlugin::DoRequestL() - attribute check failed" ); return KErrNone; } } @@ -306,14 +307,23 @@ case EFsFileCreate: { #ifdef _DEBUG - if (function == EFsFileCreate) + if (function == EFsFileCreate) + { WRITELOG( "CMdsFileServerPlugin::DoRequestL() - EFsFileCreate" ); - if (function == EFsFileReplace) - WRITELOG( "CMdsFileServerPlugin::DoRequestL() - EFsFileReplace" ); + } #endif - iCreatedFiles.Append( iFileName.AllocL() ); - User::LeaveIfError( UnregisterIntercept(EFsFileSetModified, EPostIntercept) ); + HBufC* createdFileName = iFileName.Alloc(); + if( createdFileName ) + { + // Ownership transferred if succeeded + const TInt appendError( iCreatedFiles.Append( createdFileName ) ); + if( appendError != KErrNone ) + { + delete createdFileName; + createdFileName = NULL; + } + } return KErrNone; } @@ -331,13 +341,18 @@ delete iCreatedFiles[i]; iCreatedFiles.Remove( i ); - //Have to check whether file has been hidden - if ( CheckAttribs( iFileName, isDirectory ) ) - { - found = ETrue; - } - - User::LeaveIfError( RegisterIntercept(EFsFileSetModified, EPostIntercept) ); + //Have to check whether file has been hidden + RFsPlugin fsPlugin( aRequest ); + const TInt rfsPluginError( fsPlugin.Connect() ); + if( (rfsPluginError == KErrNone) && CheckAttribs( iFileName, isDirectory, fsPlugin, EFalse ) ) + { + found = ETrue; + } + else if( rfsPluginError != KErrNone ) + { + found = ETrue; + } + fsPlugin.Close(); } } @@ -377,10 +392,34 @@ break; case EFsFileSetModified: - + { WRITELOG( "CMdsFileServerPlugin::DoRequestL() - EFsFileSetModified" ); - iModifiedFiles.Append( iFileName.AllocL() ); + + for ( TInt i = iCreatedFiles.Count(); --i >= 0; ) + { + // If file has been created but not closed, do not handle modified events + // for that file before the application that has created the file is done with writing + // it to the disk. + if ( MdsUtils::Compare( iFileName, *(iCreatedFiles[i]) ) == 0 ) + { + return KErrNone; + } + } + + HBufC* modifiedFileName = iFileName.Alloc(); + if( modifiedFileName ) + { + // Ownership transferred if succeeded + const TInt appendError( iModifiedFiles.Append( modifiedFileName ) ); + if( appendError != KErrNone ) + { + delete modifiedFileName; + modifiedFileName = NULL; + } + } + fileEventType = EMdsFileModified; + } break; case EFsSetEntry: @@ -428,17 +467,13 @@ { WRITELOG( "CMdsFileServerPlugin::DoRequestL() - EFsFormatOpen" ); // get the drive letter - RFsPlugin fsplugin( aRequest ); - const TInt rfsPluginError( fsplugin.Connect() ); - if( rfsPluginError == KErrNone ) + RFsPlugin fsPlugin( aRequest ); + err = fsPlugin.Connect(); + if( err == KErrNone ) { - err = fsplugin.Volume( volInfo, drvNumber ); + err = fsPlugin.Volume( volInfo, drvNumber ); } - else - { - err = iFsSession.Volume( volInfo, drvNumber ); - } - fsplugin.Close(); + fsPlugin.Close(); if( KErrNone == err ) { @@ -780,7 +815,12 @@ HBufC* fn = status.iFileName.Alloc(); if ( fn ) { - iPaths.InsertInOrder(fn, TLinearOrder(CMdsFileServerPlugin::Compare)); + const TInt insertError( iPaths.InsertInOrder(fn, TLinearOrder(CMdsFileServerPlugin::Compare))); + if( insertError != KErrNone ) + { + delete fn; + fn = NULL; + } } else { @@ -870,7 +910,12 @@ HBufC* fn = status.iFileName.Alloc(); if ( fn ) { - iIgnorePaths.InsertInOrder(fn, TLinearOrder(CMdsFileServerPlugin::Compare)); + const TInt insertError( iIgnorePaths.InsertInOrder(fn, TLinearOrder(CMdsFileServerPlugin::Compare))); + if( insertError != KErrNone ) + { + delete fn; + fn = NULL; + } } else { @@ -947,6 +992,14 @@ { return EFalse; } + else if( MdsUtils::Find( aFilename, KExludedThumbPath ) != KErrNotFound ) + { + return EFalse; + } + else if( MdsUtils::Find( aFilename, KExludedMediaArtPath ) != KErrNotFound ) + { + return EFalse; + } } // check if notification path @@ -981,7 +1034,7 @@ //----------------------------------------------------------------------------- // TBool CMdsFileServerPlugin::CheckAttribs( const TDesC& aFilename, - TBool& aIsDirectory ) const + TBool& aIsDirectory, RFsPlugin& aFsPlugin, TBool aDelete ) const { // find last backslash from filename and // take drive and path from filename including last backslash @@ -993,29 +1046,31 @@ } TPtrC path( aFilename.Left( pos + 1 ) ); - TUint att = 0; + TEntry entry; - // check if path is hidden or system path - TInt err = iFsSession.Att( path, att ); + // check if path is hidden + TInt err = aFsPlugin.Entry( path, entry ); if ( err == KErrNone ) - { - if ( att & KEntryAttHidden || att & KEntryAttSystem ) + { + if ( entry.iAtt & KEntryAttHidden ) { return EFalse; } } - // or is the file hidden or system file - att = 0; - err = iFsSession.Att( aFilename, att ); - if ( err == KErrNone ) + if( !aDelete ) { - if ( att & KEntryAttHidden || att & KEntryAttSystem ) + // check if the file hidden or system file + err = aFsPlugin.Entry( aFilename, entry ); + if ( err == KErrNone ) { - return EFalse; - } + if ( entry.iAtt & KEntryAttHidden || entry.iAtt & KEntryAttSystem ) + { + return EFalse; + } - aIsDirectory = att & KEntryAttDir ? ETrue : EFalse; + aIsDirectory = entry.iAtt & KEntryAttDir ? ETrue : EFalse; + } } return ETrue; @@ -1074,6 +1129,35 @@ } //----------------------------------------------------------------------------- +// CheckIfValidFile +//----------------------------------------------------------------------------- +// +TBool CMdsFileServerPlugin::CheckIfValidFile( const TDesC& aFilename, + TBool& aIsDirectory, TFsPluginRequest& aRequest, TBool aDelete ) + { + if ( !CheckPath(aFilename) ) + { + WRITELOG( "CMdsFileServerPlugin::CheckIfValidFile() - path not supported" ); + return EFalse; + } + + RFsPlugin fsPlugin( aRequest ); + const TInt rfsPluginErr = fsPlugin.Connect(); + + if( rfsPluginErr == KErrNone ) + { + if ( !CheckAttribs(aFilename, aIsDirectory, fsPlugin, aDelete) ) + { + WRITELOG( "CMdsFileServerPlugin::CheckIfValidFile() - attribute check failed" ); + return EFalse; + } + } + fsPlugin.Close(); + + return ETrue; + } + +//----------------------------------------------------------------------------- // CMdsFileServerPluginFactory implementation //----------------------------------------------------------------------------- // diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/monitorplugins/mdsoomplugin/inc/mdsoomplugin.h --- a/harvester/monitorplugins/mdsoomplugin/inc/mdsoomplugin.h Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/monitorplugins/mdsoomplugin/inc/mdsoomplugin.h Thu Jul 22 16:38:01 2010 +0100 @@ -32,7 +32,7 @@ * CMdSOomPlugin * */ -class CMdSOomPlugin : public COomMonitorPlugin +class CMdSOomPlugin : public COomMonitorPluginV2 { public: // Constructors and destructor @@ -48,9 +48,8 @@ * From COomMonitorPlugin v2 * FreeRam is called when the system RAM level becomes * low. This plugin is requested to help free some RAM. - * Paramater reserved for v2 plugin */ - void FreeRam( /*TInt aBytesToFree*/ ); + void FreeRam( TInt aBytesToFree ); /** * From COomMonitorPlugin v2 diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/monitorplugins/mdsoomplugin/src/mdsoomplugin.cpp --- a/harvester/monitorplugins/mdsoomplugin/src/mdsoomplugin.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/monitorplugins/mdsoomplugin/src/mdsoomplugin.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -49,7 +49,7 @@ } -void CMdSOomPlugin::FreeRam( /*TInt aBytesToFree*/ ) +void CMdSOomPlugin::FreeRam( TInt /*aBytesToFree*/ ) { WRITELOG("CMdSOomPlugin::FreeRam() - start"); diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp --- a/harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/monitorplugins/mmcplugin/src/mmcfilelist.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -27,6 +27,7 @@ #include "fsutil.h" #include "harvestercenreputil.h" #include "harvestereventmanager.h" +#include "harvestercommon.h" #include #include #include "harvesterpluginfactory.h" @@ -135,7 +136,16 @@ } else { - name.Append( entry.iName ); + // If thumbnail folder is detected, skip it + if( entry.iName.Compare( KExludedThumbPath ) != 0 && + entry.iName.Compare( KExludedMediaArtPath ) != 0 ) + { + name.Append( entry.iName ); + } + else + { + continue; + } } if ( entry.IsDir() ) @@ -157,33 +167,11 @@ { continue; } - - // check if folder is hidden or system folder - TUint att = 0; - TInt attErr = aFs.Att( name, att ); - if ( attErr == KErrNone ) - { - if ( att & KEntryAttHidden || att & KEntryAttSystem ) - { - continue; - } - } path->AppendL( name ); } else - { - // check if file is hidden or system file - TUint att = 0; - TInt attErr = aFs.Att( name, att ); - if ( attErr == KErrNone ) - { - if ( att & KEntryAttHidden || att & KEntryAttSystem ) - { - continue; - } - } - + { CPlaceholderData* phData = CPlaceholderData::NewL(); CleanupStack::PushL( phData ); phData->SetUri( name ); diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp --- a/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/monitorplugins/mmcplugin/src/mmcmonitorplugin.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -113,8 +113,7 @@ TUint32 hdMediaId( 0 ); hdMediaId = iMountTask->GetInternalDriveMediaId(); - const TInt count( medias.Count() ); - for ( TInt i = 0; i < count; i++ ) + for( TInt i = medias.Count() - 1; i >=0; i-- ) { TRAP_IGNORE( iMdEClient->GetMediaL( medias[i].iMediaId, driveLetter, presentState ) ); @@ -349,9 +348,11 @@ } iFs.Drive( driveInfo, i ); - if ( ((driveInfo.iDriveAtt & KDriveAttRemovable) || (driveInfo.iDriveAtt & KDriveAttLogicallyRemovable) || - (driveInfo.iType == EMediaHardDisk && driveStatus & DriveInfo::EDriveInternal) ) && - (driveInfo.iType != EMediaNotPresent) ) + if( ( (driveStatus & DriveInfo::EDriveRemovable) || + (driveInfo.iType == EMediaHardDisk && driveStatus & DriveInfo::EDriveInternal) || + (driveInfo.iDriveAtt & KDriveAttLogicallyRemovable) || + (driveInfo.iDriveAtt & KDriveAttRemovable) ) && + (driveInfo.iType != EMediaNotPresent) ) { count++; // DEBUG INFO diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/server/group/harvesterserver.mmp --- a/harvester/server/group/harvesterserver.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/server/group/harvesterserver.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -41,6 +41,7 @@ USERINCLUDE ../../common/inc USERINCLUDE ../inc USERINCLUDE ../../monitorplugins/inc +USERINCLUDE ../traces SOURCEPATH ../src SOURCE harvesterserver.cpp diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/server/inc/harvesterao.h --- a/harvester/server/inc/harvesterao.h Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/server/inc/harvesterao.h Thu Jul 22 16:38:01 2010 +0100 @@ -63,6 +63,7 @@ CMdEPropertyDef* iOriginPropertyDef; CMdEPropertyDef* iItemTypePropertyDef; CMdEPropertyDef* iTitlePropertyDef; + CMdEPropertyDef* iDefaultFolderPropertyDef; // Media property definitions CMdEPropertyDef* iPreinstalledPropertyDef; @@ -114,8 +115,6 @@ ERequestContainerPlaceholder }; - - /** * Constructs a new harvesting thread * @@ -301,11 +300,15 @@ void MemoryGood(); void RemoveBlacklistedFile( CHarvesterData* aItem ); + + CHarvesterAO::TRequest GetHarvesterAORunState(); private: TBool CheckForCameraItem( CHarvesterData* aHd, TDes& aObjectDef ); + void AddDefaultFolderDataL( CMdEObject* aObject ); + private: struct THarvestFileRequest @@ -519,6 +522,9 @@ /** */ RPointerArray iContainerPHArray; + + /** */ + RPointerArray iTempReadyPHArray; /** * Pointer to process origin mapper for registering mappings. @@ -568,6 +574,18 @@ TBool iFastHarvestNeeded; TBool iHarvestingPlaceholders; + + HBufC* iPhoneImagesPath; + HBufC* iMmcImagesPath; + + HBufC* iPhoneVideosPath; + HBufC* iMmcVideosPath; + + HBufC* iPhoneSoundsPath; + HBufC* iMmcSoundsPath; + + TBool iUnmountDetected; + TBool iPriorityInterruptDetected; }; #endif //__CHARVESTERAO_H__ diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/server/src/harvesterao.cpp --- a/harvester/server/src/harvesterao.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/server/src/harvesterao.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -22,6 +22,7 @@ #include #include #include +#include using namespace ContentAccess; @@ -34,12 +35,18 @@ #include "harvesterdata.h" #include "ondemandao.h" #include "harvestercommon.h" +#include "mdscommoninternal.h" #include "processoriginmapperinterface.h" #include "mdeobjecthandler.h" #include "harvestereventmanager.h" #include "harvestercenreputil.h" #include "restorewatcher.h" #include "backupsubscriber.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "harvesteraoTraces.h" +#endif + // constants const TInt32 KFileMonitorPluginUid = 0x20007186; // file monitor plugin implementation uid @@ -79,6 +86,7 @@ iOriginPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KOriginProperty ); iItemTypePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty ); iTitlePropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty ); + iDefaultFolderPropertyDef = &objectDef.GetPropertyDefL( MdeConstants::Object::KInDefaultFolder ); CMdEObjectDef& mediaDef = nsDef.GetObjectDefL( MdeConstants::MediaObject::KMediaObject ); iPreinstalledPropertyDef = &mediaDef.GetPropertyDefL( MdeConstants::MediaObject::KPreinstalledProperty ); @@ -101,6 +109,7 @@ CHarvesterAO* CHarvesterAO::NewLC() { WRITELOG( "CHarvesterAO::NewLC() - begin" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_NEWLC, "CHarvesterAO::NewLC" ); CHarvesterAO* self = new (ELeave) CHarvesterAO(); CleanupStack::PushL( self ); @@ -115,6 +124,7 @@ CHarvesterAO* CHarvesterAO::NewL() { WRITELOG( "CHarvesterAO::NewL() - begin" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_NEWL, "CHarvesterAO::NewL" ); CHarvesterAO* self = CHarvesterAO::NewLC(); CleanupStack::Pop( self ); @@ -128,6 +138,7 @@ CHarvesterAO::CHarvesterAO() : CActive( KHarvesterPriorityHarvestingPlugin ) { WRITELOG( "CHarvesterAO::CHarvesterAO() - begin" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_CHARVESTERAO, "CHarvesterAO::CHarvesterAO" ); iServerPaused = ETrue; iNextRequest = ERequestIdle; @@ -140,6 +151,9 @@ iManualPauseEnabled = EFalse; iFastHarvestNeeded = EFalse; iHarvestingPlaceholders = EFalse; + + iUnmountDetected = EFalse; + iPriorityInterruptDetected = EFalse; } // --------------------------------------------------------------------------- @@ -149,6 +163,7 @@ CHarvesterAO::~CHarvesterAO() { WRITELOG( "CHarvesterAO::~CHarvesterAO()" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_CHARVESTERAO, "CHarvesterAO::~CHarvesterAO" ); Cancel(); @@ -203,6 +218,9 @@ iContainerPHArray.ResetAndDestroy(); iContainerPHArray.Close(); + iTempReadyPHArray.ResetAndDestroy(); + iTempReadyPHArray.Close(); + delete iHarvesterOomAO; delete iRestoreWatcher; delete iOnDemandAO; @@ -216,6 +234,15 @@ delete iPropDefs; delete iCameraExtensionArray; + delete iPhoneImagesPath; + delete iMmcImagesPath; + + delete iPhoneVideosPath; + delete iMmcVideosPath; + + delete iPhoneSoundsPath; + delete iMmcSoundsPath; + RMediaIdUtil::ReleaseInstance(); REComSession::FinalClose(); @@ -228,7 +255,8 @@ void CHarvesterAO::ConstructL() { WRITELOG( "CHarvesterAO::ConstructL() - begin" ); - + OstTrace0( TRACE_NORMAL, CHARVESTERAO_CONSTRUCTL, "CHarvesterAO::ConstructL - begin" ); + CActiveScheduler::Add( this ); User::LeaveIfError( iFs.Connect() ); @@ -272,6 +300,41 @@ iCameraExtensionArray->InsertIsqL( KExtension3gp ); iCameraExtensionArray->InsertIsqL( KExtension3gpp ); iCameraExtensionArray->InsertIsqL( KExtension3g2 ); + + TFileName phoneRoot = PathInfo::PhoneMemoryRootPath(); + TFileName mmcRoot = PathInfo::MemoryCardRootPath(); + + TFileName images = PathInfo::ImagesPath(); + + TFileName phoneImagePath( phoneRoot ); + phoneImagePath.Append( images ); + iPhoneImagesPath = phoneImagePath.AllocL(); + + TFileName mmcImagePath( mmcRoot ); + mmcImagePath.Append( images ); + iMmcImagesPath = mmcImagePath.Right( mmcImagePath.Length() - 1 ).AllocL(); + + TFileName videos = PathInfo::VideosPath(); + + TFileName phoneVideoPath( phoneRoot ); + phoneVideoPath.Append( videos ); + iPhoneVideosPath = phoneVideoPath.AllocL(); + + TFileName mmcVideoPath( mmcRoot ); + mmcVideoPath.Append( videos ); + iMmcVideosPath = mmcVideoPath.Right( mmcVideoPath.Length() - 1 ).AllocL(); + + TFileName sounds = PathInfo::SoundsPath(); + + TFileName phoneSoundPath( phoneRoot ); + phoneSoundPath.Append( sounds ); + iPhoneSoundsPath = phoneSoundPath.AllocL(); + + TFileName mmcSoundPath( mmcRoot ); + mmcSoundPath.Append( sounds ); + iMmcSoundsPath = mmcSoundPath.Right( mmcSoundPath.Length() - 1 ).AllocL(); + + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_CONSTRUCTL, "CHarvesterAO::ConstructL - end" ); WRITELOG( "CHarvesterAO::ConstructL() - end" ); } @@ -283,6 +346,7 @@ void CHarvesterAO::LoadMonitorPluginsL() { WRITELOG( "CHarvesterAO::LoadMonitorPluginsL()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_LOADMONITORPLUGINSL, "CHarvesterAO::LoadMonitorPluginsL" ); RImplInfoPtrArray infoArray; @@ -313,6 +377,8 @@ else { WRITELOG( "CHarvesterAO::LoadMonitorPlugins() - Failed to load a monitor plugin!" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_LOADMONITORPLUGINSL, "CHarvesterAO::LoadMonitorPluginsL - Failed to load a monitor plugin!" ); + delete plugin; plugin = NULL; } @@ -328,9 +394,11 @@ void CHarvesterAO::DeleteMonitorPlugins() { WRITELOG( "CHarvesterAO::DeleteMonitorPlugins()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_DELETEMONITORPLUGINS, "CHarvesterAO::DeleteMonitorPlugins" ); iMonitorPluginArray.ResetAndDestroy(); iMonitorPluginArray.Close(); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_DELETEMONITORPLUGINS, "CHarvesterAO::DeleteMonitorPlugins - end" ); WRITELOG( "CHarvesterAO::DeleteMonitorPlugins() - end" ); } @@ -341,7 +409,8 @@ void CHarvesterAO::StartMonitoring() { WRITELOG( "CHarvesterAO::StartMonitoring()" ); - + OstTrace0( TRACE_NORMAL, CHARVESTERAO_STARTMONITORING, "CHarvesterAO::StartMonitoring" ); + const TInt count( iMonitorPluginArray.Count() ); for ( TInt i = 0; i < count; i++ ) @@ -358,6 +427,8 @@ void CHarvesterAO::StopMonitoring() { WRITELOG( "CHarvesterAO::StopMonitoring()" ); + + OstTrace0( TRACE_NORMAL, CHARVESTERAO_STOPMONITORING, "CHarvesterAO::StopMonitoring" ); const TInt count( iMonitorPluginArray.Count() ); @@ -374,12 +445,15 @@ void CHarvesterAO::PauseMonitoring() { WRITELOG( "CHarvesterAO::PauseMonitoring()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_PAUSEMONITORING, "CHarvesterAO::PauseMonitoring" ); + const TInt count( iMonitorPluginArray.Count() ); for ( TInt i = 0; iPauseMonitoring(); } + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_PAUSEMONITORING, "CHarvesterAO::PauseMonitoring - end" ); WRITELOG( "CHarvesterAO::PauseMonitoring() - end" ); } @@ -390,6 +464,7 @@ void CHarvesterAO::ResumeMonitoring() { WRITELOG( "CHarvesterAO::ResumeMonitoring()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_RESUMEMONITORING, "CHarvesterAO::ResumeMonitoring" ); const TInt count( iMonitorPluginArray.Count() ); @@ -408,6 +483,9 @@ void CHarvesterAO::HandleUnmount( TUint32 aMediaId ) { WRITELOG1( "CHarvesterAO::HandleUnmount(%d)", aMediaId ); + OstTrace1( TRACE_NORMAL, CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount;aMediaId=%d", aMediaId ); + + iUnmountDetected = ETrue; if( !iServerPaused ) { @@ -424,6 +502,8 @@ #ifdef _DEBUG WRITELOG1( "CHarvesterAO::HandleUnmount() iReadyPHArray.Count() = %d", iReadyPHArray.Count() ); + OstTrace1( TRACE_NORMAL, DUP1_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount;iReadyPHArray.Count()=%d", iReadyPHArray.Count() ); + #endif TInt arrayCount( iReadyPHArray.Count() ); if( arrayCount > 0 ) @@ -436,6 +516,8 @@ if( err == KErrNone && mediaId == aMediaId ) { WRITELOG1( "CHarvesterAO::HandleUnmount() remove iReadyPHArray %d", i); + OstTrace1( TRACE_NORMAL, DUP2_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount remove iReadyPHArray %d", i ); + delete hd; hd = NULL; iReadyPHArray.Remove( i ); @@ -448,6 +530,8 @@ iReadyPHArray.Compress(); } WRITELOG1( "CHarvesterAO::HandleUnmount() DecreaseItemCountL iReadyPHArray %d", removed); + OstTrace1( TRACE_NORMAL, DUP3_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount DecreaseItemCountL iReadyPHArray %d", removed ); + TRAP_IGNORE( iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypePlaceholder, removed) ); } @@ -455,6 +539,8 @@ #ifdef _DEBUG WRITELOG1( "CHarvesterAO::HandleUnmount() iPHArray.Count() = %d", iPHArray.Count() ); + OstTrace1( TRACE_NORMAL, DUP4_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount iPHArray.Count()=%d", iPHArray.Count() ); + #endif arrayCount = iPHArray.Count(); if( arrayCount > 0 ) @@ -467,6 +553,8 @@ if( err == KErrNone && mediaId == aMediaId ) { WRITELOG1( "CHarvesterAO::HandleUnmount() remove iPHArray %d", i); + OstTrace1( TRACE_NORMAL, DUP5_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount remove iPHArray %d", i ); + delete hd; hd = NULL; iPHArray.Remove( i ); @@ -479,6 +567,7 @@ iPHArray.Compress(); } WRITELOG1( "CHarvesterAO::HandleUnmount() DecreaseItemCountL iPHArray %d", removed); + OstTrace1( TRACE_NORMAL, DUP6_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount DecreaseItemCountL iPHArray %d", removed ); TRAP_IGNORE( iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypePlaceholder, removed) ); } @@ -486,6 +575,8 @@ #ifdef _DEBUG WRITELOG1( "CHarvesterAO::HandleUnmount() iContainerPHArray.Count() = %d", iContainerPHArray.Count() ); + OstTrace1( TRACE_NORMAL, DUP7_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount iContainerPHArray.Count()=%d", iContainerPHArray.Count() ); + #endif arrayCount = iContainerPHArray.Count(); if( arrayCount > 0 ) @@ -498,6 +589,8 @@ if( err == KErrNone && mediaId == aMediaId ) { WRITELOG1( "CHarvesterAO::HandleUnmount() remove iContainerPHArray %d", i); + OstTrace1( TRACE_NORMAL, DUP8_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount remove iContainerPHArray %d", i ); + delete hd; hd = NULL; iContainerPHArray.Remove( i ); @@ -515,13 +608,49 @@ removed = 0; +#ifdef _DEBUG + WRITELOG1( "CHarvesterAO::HandleUnmount() iTempReadyPHArray.Count() = %d", iTempReadyPHArray.Count() ); +#endif + arrayCount = iTempReadyPHArray.Count(); + if( arrayCount > 0 ) + { + for( TInt i=arrayCount-1; i>= 0; i--) + { + hd = iTempReadyPHArray[i]; + err = iMediaIdUtil->GetMediaId( hd->Uri(), mediaId ); + + if( err == KErrNone && mediaId == aMediaId ) + { + WRITELOG1( "CHarvesterAO::HandleUnmount() remove iTempReadyPHArray %d", i); + delete hd; + hd = NULL; + iTempReadyPHArray.Remove( i ); + removed++; + arrayCount--; + } + } + if( iTempReadyPHArray.Count() == 0 ) + { + iTempReadyPHArray.Compress(); + } + WRITELOG1( "CHarvesterAO::HandleUnmount() DecreaseItemCountL iTempReadyPHArray %d", removed); + TRAP_IGNORE( iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypePlaceholder, removed) ); + } + + removed = 0; + const TUint count = iQueue->ItemsInQueue(); WRITELOG1( "CHarvesterAO::HandleUnmount() iQueue.Count() = %d", count ); + OstTrace1( TRACE_NORMAL, DUP10_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount iQueue.Count() = %d", count ); + if( count > 0 ) { WRITELOG( "CHarvesterAO::HandleUnmount() remove iQueue" ); + OstTrace0( TRACE_NORMAL, DUP11_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount remove iQueue" ); removed = iQueue->RemoveItems( aMediaId ); WRITELOG1( "CHarvesterAO::HandleUnmount() removed iQueue = %d", removed ); + OstTrace1( TRACE_NORMAL, DUP12_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount removed iQueue = %d", removed ); + TRAP_IGNORE( iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypePlaceholder, removed ) ); TRAP_IGNORE( iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, removed ) ); } @@ -566,6 +695,8 @@ if( removed ) { WRITELOG1( "CHarvesterAO::HandleUnmount() remove from plugins = %d", removed); + OstTrace1( TRACE_NORMAL, DUP13_CHARVESTERAO_HANDLEUNMOUNT, "CHarvesterAO::HandleUnmount remove from plugins = %d", removed ); + TRAP_IGNORE( iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypePlaceholder, removed ) ); TRAP_IGNORE( iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, removed ) ); } @@ -589,7 +720,8 @@ void CHarvesterAO::StartComposersL() { WRITELOG( "CHarvesterAO::StartComposersL()" ); - + OstTrace0( TRACE_NORMAL, CHARVESTERAO_STARTCOMPOSERSL, "CHarvesterAO::StartComposersL" ); + RImplInfoPtrArray infoArray; TCleanupItem cleanupItem( MdsUtils::CleanupEComArray, &infoArray ); CleanupStack::PushL( cleanupItem ); @@ -623,6 +755,7 @@ void CHarvesterAO::StopComposers() { WRITELOG( "CHarvesterAO::StopComposers()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_STOPCOMPOSERS, "CHarvesterAO::StopComposers" ); const TInt count( iComposerPluginArray.Count() ); for ( TInt i = count; --i >= 0; ) @@ -640,6 +773,7 @@ void CHarvesterAO::DeleteComposers() { WRITELOG( "CHarvesterAO::DeleteComposers()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_DELETECOMPOSERS, "CHarvesterAO::DeleteComposers" ); iComposerPluginArray.ResetAndDestroy(); iComposerPluginArray.Close(); @@ -654,6 +788,7 @@ TBool CHarvesterAO::IsComposingReady() { WRITELOG( "CHarvesterAO::IsComposingReady()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_ISCOMPOSINGREADY, "CHarvesterAO::IsComposingReady" ); const TInt count( iComposerPluginArray.Count() ); for ( TInt i = count; --i >= 0; ) @@ -675,6 +810,7 @@ void CHarvesterAO::ReadItemFromQueueL() { WRITELOG( "CHarvesterAO::ReadItemFromQueueL()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_READITEMFROMQUEUEL, "CHarvesterAO::ReadItemFromQueueL" ); CHarvesterData* hd = iQueue->GetNextItem(); @@ -717,6 +853,7 @@ if ( err != KErrNone ) { iPHArray.ResetAndDestroy(); + iTempReadyPHArray.ResetAndDestroy(); User::Leave( err ); } @@ -724,6 +861,10 @@ for( TInt i = 0; i < count; i++ ) { CheckFileExtensionAndHarvestL( iReadyPHArray[i] ); + if( iUnmountDetected ) + { + break; + } iReadyPHArray.Remove( i ); // correct the index so harvesting order remains ok i--; @@ -741,6 +882,11 @@ else { CheckFileExtensionAndHarvestL( hd ); + if( iUnmountDetected ) + { + iQueue->Append( hd ); + return; + } } } @@ -752,6 +898,7 @@ if ( err != KErrNone ) { iPHArray.ResetAndDestroy(); + iTempReadyPHArray.ResetAndDestroy(); User::Leave( err ); } } @@ -764,6 +911,10 @@ } iHarvestingPlaceholders = EFalse; CheckFileExtensionAndHarvestL( hd ); + if( iUnmountDetected ) + { + iQueue->Append( hd ); + } } } @@ -774,6 +925,7 @@ void CHarvesterAO::HandlePlaceholdersL( TBool aCheck ) { WRITELOG( "CHarvesterAO::HandlePlaceholdersL()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_HANDLEPLACEHOLDERSL, "CHarvesterAO::HandlePlaceholdersL" ); RPointerArray mdeObjectArray; CleanupClosePushL( mdeObjectArray ); @@ -800,9 +952,50 @@ iHarvesterPluginFactory->GetObjectDefL( *hd, objDefStr ); } + // GetObjectDef can cause context switch, and if unmount happens when this execution is + // interrupted, the ph arrays can be invalid. Thus, abort whole run, and start over to make sure + // the arrays are valid. + if( iUnmountDetected ) + { + WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - Unmount detected during execution!" ); + for( TInt y( iTempReadyPHArray.Count() -1 ); y >=0; y-- ) + { + CHarvesterData* hd = iTempReadyPHArray[y]; + iPHArray.Insert( hd, 0 ); + } + iTempReadyPHArray.Reset(); + CleanupStack::PopAndDestroy( &mdeObjectArray ); + return; + } + // Check for priority interrupt + // If priority interrupt occures, drop current operation to handle the priority item first, + // and continue from current situation after that + else if( iPriorityInterruptDetected ) + { + WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - Priority interrupt during execution!" ); + const TInt currentPHArrayCount( iPHArray.Count() ); + for( TInt y( iTempReadyPHArray.Count() -1 ); y >=0; y-- ) + { + CHarvesterData* hd = iTempReadyPHArray[y]; + if( currentPHArrayCount ) + { + // Leave the first item in the array as it is the priority item + iPHArray.Insert( hd, 1 ); + } + else + { + iPHArray.Insert( hd, 0 ); + } + } + iTempReadyPHArray.Reset(); + CleanupStack::PopAndDestroy( &mdeObjectArray ); + return; + } + if( objDefStr.Length() == 0 || ( objDefStr == KInUse ) ) { + WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - no objectDef or in use, failing harvesting" ); const TInt error( KErrUnknown ); // notify observer, notification is needed even if file is not supported HarvestCompleted( hd->ClientId(), hd->Uri(), error ); @@ -834,6 +1027,8 @@ if ( err != KErrNone ) { WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - cannot create placeholder data object for camera. file does not exists" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_HANDLEPLACEHOLDERSL, "CHarvesterAO::HandlePlaceholdersL- cannot create placeholder data object for camera. file does not exists" ); + // notify observer HarvestCompleted( hd->ClientId(), hd->Uri(), err ); delete hd; @@ -862,6 +1057,8 @@ if( !phData ) { WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - Placeholder data object NULL - abort" ); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTERAO_HANDLEPLACEHOLDERSL, "CHarvesterAO::HandlePlaceholdersL - Placeholder data object NULL - abort" ); + const TInt error( KErrUnknown ); // notify observer HarvestCompleted( hd->ClientId(), hd->Uri(), error ); @@ -912,6 +1109,16 @@ mdeObject->AddTextPropertyL( *iPropDefs->iItemTypePropertyDef, KUndefinedMime ); } + if( hd->Origin() == MdeConstants::Object::ECamera ) + { + TBool inDefaultFolder( ETrue ); + mdeObject->AddBoolPropertyL( *iPropDefs->iDefaultFolderPropertyDef, inDefaultFolder ); + } + else + { + AddDefaultFolderDataL( mdeObject ); + } + TPtrC name; TBool nameFound = MdsUtils::GetName( hd->Uri(), name ); @@ -938,6 +1145,8 @@ if( isPreinstalled == MdeConstants::MediaObject::EPreinstalled ) { WRITELOG("CHarvesterAO::HandlePlaceholdersL() - preinstalled"); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTERAO_HANDLEPLACEHOLDERSL, "CHarvesterAO::HandlePlaceholdersL - preinstalled" ); + mdeObject->AddInt32PropertyL( *iPropDefs->iPreinstalledPropertyDef, isPreinstalled ); } @@ -963,12 +1172,20 @@ CleanupStack::Pop( mdeObject ); - iReadyPHArray.Append( hd ); + iTempReadyPHArray.Append( hd ); iPHArray.Remove( i ); i--; endindex--; } + const TInt tempArrayCount( iTempReadyPHArray.Count() ); + for( TInt i( 0 ); i < tempArrayCount; i++ ) + { + CHarvesterData* hd = iTempReadyPHArray[i]; + iReadyPHArray.Append( hd ); + } + iTempReadyPHArray.Reset(); + const TInt objectCount = mdeObjectArray.Count(); if( objectCount > 0 ) @@ -1002,6 +1219,8 @@ iPHArray.ResetAndDestroy(); CleanupStack::PopAndDestroy( &mdeObjectArray ); + + WRITELOG( "CHarvesterAO::HandlePlaceholdersL() - end" ); } // --------------------------------------------------------------------------- @@ -1021,10 +1240,20 @@ WRITELOG1( "CHarvesterAO::CheckFileExtensionAndHarvestL() - no mdeobject. URI: %S", &uri ); TBuf objDefStr; iHarvesterPluginFactory->GetObjectDefL( *aHD, objDefStr ); + + // GetObjectDef can cause context switch, and if unmount happens when this execution is + // interrupted, the ph data can be invalid. Thus, abort whole run, and start over to make sure + // the data is valid. + if( iUnmountDetected ) + { + return; + } if( objDefStr.Length() == 0 ) { WRITELOG( "CHarvesterAO::CheckFileExtensionAndHarvestL() - cannot get object definition" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL, "CHarvesterAO::CheckFileExtensionAndHarvestL - cannot get object definition" ); + isError = ETrue; } else if( objDefStr == KInUse ) @@ -1053,21 +1282,29 @@ else { WRITELOG( "CHarvesterAO::CheckFileExtensionAndHarvestL() - getting mdeobject" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL, "CHarvesterAO::CheckFileExtensionAndHarvestL - getting mdeobject" ); + TRAP( mdeError, mdeObject = iMdeObjectHandler->GetMetadataObjectL( *aHD, objDefStr ) ); } TInt harvesterError = KErrNone; if( mdeError != KErrNone) { WRITELOG1( "CHarvesterAO::CheckFileExtensionAndHarvestL() - cannot get mde object. error: %d", mdeError ); + OstTrace1( TRACE_NORMAL, DUP2_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL, "CHarvesterAO::CheckFileExtensionAndHarvestL - cannot get mde object. error: %d", mdeError ); + MdsUtils::ConvertTrapError( mdeError, harvesterError ); if( harvesterError == KMdEErrHarvestingFailedPermanent ) { WRITELOG( "CHarvesterAO::CheckFileExtensionAndHarvestL() - permanent fail" ); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL, "CHarvesterAO::CheckFileExtensionAndHarvestL - permanent fail" ); + isError = ETrue; } else if ( harvesterError == KMdEErrHarvestingFailed ) { WRITELOG( "CHarvesterAO::CheckFileExtensionAndHarvestL() - KMdEErrHarvestingFailed"); + OstTrace0( TRACE_NORMAL, DUP4_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL, "CHarvesterAO::CheckFileExtensionAndHarvestL - KMdEErrHarvestingFailed" ); + aHD->SetErrorCode( KMdEErrHarvestingFailed ); HarvestingCompleted( aHD ); return; @@ -1077,6 +1314,8 @@ if( !mdeObject ) { WRITELOG( "CHarvesterAO::CheckFileExtensionAndHarvestL() - mde object is null. stop harvesting" ); + OstTrace0( TRACE_NORMAL, DUP5_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL, "CHarvesterAO::CheckFileExtensionAndHarvestL - mde object is null. stop harvesting" ); + isError = ETrue; } } @@ -1116,9 +1355,13 @@ if ( err != KErrNone ) { WRITELOG1( "CHarvesterAO::CheckFileExtensionAndHarvestL() - plugin error: %d", err ); + OstTrace1( TRACE_NORMAL, DUP6_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL, "CHarvesterAO::CheckFileExtensionAndHarvestL - plugin error: %d", err ); + if ( err == KErrInUse ) { WRITELOG( "CHarvesterAO::CheckFileExtensionAndHarvestL() - item in use" ); + OstTrace0( TRACE_NORMAL, DUP7_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL, "CHarvesterAO::CheckFileExtensionAndHarvestL - item in use" ); + aHD->SetErrorCode( KMdEErrHarvestingFailed ); HarvestingCompleted( aHD ); return; @@ -1137,6 +1380,8 @@ } WRITELOG1("CHarvesterAO::CheckFileExtensionAndHarvestL() - ends with error %d", pluginErr ); + OstTrace1( TRACE_NORMAL, DUP8_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL, "CHarvesterAO::CheckFileExtensionAndHarvestL) - ends with error %d", pluginErr ); + SetNextRequest( ERequestHarvest ); } @@ -1147,7 +1392,8 @@ void CHarvesterAO::HarvestingCompleted( CHarvesterData* aHD ) { WRITELOG( "CHarvesterAO::HarvestingCompleted()" ); - + OstTrace0( TRACE_NORMAL, CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted" ); + if ( aHD->ErrorCode() == KErrNone ) { iReHarvester->CheckItem( *aHD ); @@ -1156,6 +1402,8 @@ if( !aHD->TakeSnapshot() ) { WRITELOG( "CHarvesterAO::HarvestingCompleted() origin is not camera or clf" ); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted origin is not camera or clf" ); + aHD->MdeObject().SetPlaceholder( EFalse ); TRAP_IGNORE( iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypePlaceholder ) ); TRAP( mdeError, iMdeObjectHandler->SetMetadataObjectL( *aHD ) ); @@ -1166,6 +1414,8 @@ WRITELOG( "==============================ERROR===============================" ); WRITELOG( "CHarvesterAO::HarvestingCompleted() - cannot set metadata object" ); WRITELOG( "==============================ERROR done =========================" ); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted - cannot set metadata object" ); + delete aHD; aHD = NULL; @@ -1174,9 +1424,13 @@ else { WRITELOG( "CHarvesterAO::HarvestingCompleted() mdeError == KErrNone" ); + OstTrace0( TRACE_NORMAL, DUP4_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted mdeError == KErrNone" ); + if ( aHD->TakeSnapshot() && iCtxEngine ) { WRITELOG( "CHarvesterAO::HarvestingCompleted() - Taking a context snapshot." ); + OstTrace0( TRACE_NORMAL, DUP5_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted - Taking a context snapshot." ); + iCtxEngine->ContextSnapshot( *this, *aHD ); } else @@ -1185,6 +1439,8 @@ if( locData ) { WRITELOG( "CHarvesterAO::HarvestingCompleted() - Creating location object. " ); + OstTrace0( TRACE_NORMAL, DUP6_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted - Creating location object." ); + RLocationObjectManipulator lo; const TInt loError = lo.Connect(); @@ -1195,11 +1451,14 @@ if( err != KErrNone ) { WRITELOG( "CHarvesterAO::HarvestingCompleted() - Location object creation failed!!!" ); + OstTrace0( TRACE_NORMAL, DUP7_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted - Location object creation failed!!!" ); + } } else { WRITELOG( "CHarvesterAO::HarvestingCompleted() - LocationObjectManipulator connect failed!!!" ); + OstTrace0( TRACE_NORMAL, DUP8_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted - LocationObjectManipulator connect failed!!" ); } lo.Close(); @@ -1217,6 +1476,8 @@ #ifdef _DEBUG WRITELOG( "==============================ERROR===============================" ); WRITELOG1( "CHarvesterAO::HarvestingCompleted() - not OK! Error: %d", aHD->ErrorCode() ); + OstTrace1( TRACE_NORMAL, DUP9_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted - not OK! Error: %d", aHD->ErrorCode() ); + #endif const TInt errorCode( aHD->ErrorCode() ); @@ -1224,6 +1485,7 @@ { #ifdef _DEBUG WRITELOG1("CHarvesterAO::HarvestingCompleted() - KMdEErrHarvestingFailed - %S - reharvesting", &aHD->Uri() ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted - KMdEErrHarvestingFailed - reharvesting" ); #endif iReHarvester->AddItem( aHD ); } @@ -1231,7 +1493,7 @@ errorCode == KMdEErrHarvestingFailedUnknown ) { WRITELOG( "CHarvesterAO::HarvestingCompleted() - KMdEErrHarvestingFailedPermanent - no need to re-harvest!" ); - + OstTrace0( TRACE_NORMAL, DUP10_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted - KMdEErrHarvestingFailedPermanent - no need to re-harvest!" ); TRAP_IGNORE( iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypeMMC, 1 ) ); delete aHD; @@ -1240,11 +1502,15 @@ else { WRITELOG1( "CHarvesterAO::HarvestingCompleted() - unknown error: %d", errorCode ); + OstTrace1( TRACE_NORMAL, DUP11_CHARVESTERAO_HARVESTINGCOMPLETED, "CHarvesterAO::HarvestingCompleted - unknown error: %d", errorCode ); + delete aHD; aHD = NULL; } WRITELOG( "==============================ERROR done =========================" ); + OstTrace0( TRACE_NORMAL, DUP12_CHARVESTERAO_HARVESTINGCOMPLETED, "==============================ERROR done =========================" ); + } SetNextRequest( ERequestHarvest ); @@ -1257,7 +1523,8 @@ void CHarvesterAO::HandleSessionOpened( CMdESession& aSession, TInt aError ) { WRITELOG( "HarvesterThread::HandleSessionOpened()" ); - + OstTrace0( TRACE_NORMAL, CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened" ); + if ( KErrNone == aError ) { TBool isTNMDaemonEnabled( EFalse ); @@ -1276,6 +1543,7 @@ else { WRITELOG( "CHarvesterAO::HandleSessionOpened() - error creating mde harvester session" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened) - error creating mde harvester session" ); } // Setting up context Engine (initialization is ready when ContextInitializationStatus -callback is called) @@ -1283,6 +1551,7 @@ if ( errorTrap != KErrNone ) { WRITELOG( "CHarvesterAO::HandleSessionOpened() - Context Engine creation failed" ); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened - Context Engine creation failed" ); } #ifdef _DEBUG @@ -1290,6 +1559,7 @@ if ( errorTrap != KErrNone ) { WRITELOG( "CHarvesterAO::HandleSessionOpened() - ObjectHandler creation failed" ); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened - ObjectHandler creation failed" ); } // Setting up monitor plugins @@ -1297,6 +1567,7 @@ if ( errorTrap != KErrNone ) { WRITELOG( "CHarvesterAO::HandleSessionOpened() - error loading monitor plugins" ); + OstTrace0( TRACE_NORMAL, DUP4_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened - error loading monitor plugins" ); } // To check if the default namespace structure is in order @@ -1304,12 +1575,15 @@ if ( errorTrap != KErrNone ) { WRITELOG( "CHarvesterAO::HandleSessionOpened() - error loading default schema" ); + OstTrace0( TRACE_NORMAL, DUP5_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened - error loading default schema" ); } TRAP( errorTrap, StartComposersL() ); if ( errorTrap != KErrNone ) { WRITELOG( "CHarvesterAO::HandleSessionOpened() - couldn't start composer plugins" ); + OstTrace0( TRACE_NORMAL, DUP6_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened - couldn't start composer plugins" ); + } #else // The idea here is that all of these methods needs to be called, @@ -1327,6 +1601,7 @@ if ( errorTrap != KErrNone ) { WRITELOG( "CHarvesterAO::HandleSessionOpened() - couldn't start diskspace observer" ); + OstTrace0( TRACE_NORMAL, DUP7_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened - couldn't start diskspace observer" ); } TRAP( errorTrap, iOnDemandAO = COnDemandAO::NewL( *iMdESession, *iQueue, @@ -1337,11 +1612,13 @@ if ( errorTrap != KErrNone ) { WRITELOG( "CHarvesterAO::HandleSessionOpened() - couldn't start on demand observer" ); + OstTrace0( TRACE_NORMAL, DUP8_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened - couldn't start on demand observer" ); } } else { WRITELOG( "CHarvesterAO::HandleSessionOpened() - couldn't create on demand observer" ); + OstTrace0( TRACE_NORMAL, DUP9_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened - couldn't create on demand observer" ); } // Initializing pause indicator @@ -1349,7 +1626,8 @@ #ifdef _DEBUG WRITELOG( "HarvesterThread::HandleSessionOpened() - Succeeded!" ); - + OstTrace0( TRACE_NORMAL, DUP10_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened - Succeeded!" ); + TBool isRomScanEnabled( EFalse ); TRAP_IGNORE( CHarvesterCenRepUtil::IsRomScanEnabledL( isRomScanEnabled ) ); @@ -1359,6 +1637,7 @@ if( errorTrap != KErrNone ) { WRITELOG1( "CHarvesterAO::HandleSessionOpened() - BootRomScanL() returned error: %d", errorTrap ); + OstTrace1( TRACE_NORMAL, DUP11_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened - BootRomScanL() returned error: %d", errorTrap ); } } @@ -1366,6 +1645,7 @@ if( errorTrap != KErrNone ) { WRITELOG1( "CHarvesterAO::HandleSessionOpened() - BootPartialRestoreScanL() returned error: %d", errorTrap ); + OstTrace1( TRACE_NORMAL, DUP12_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened - BootPartialRestoreScanL() returned error: %d", errorTrap ); } #else // The idea here is that all of these three methods needs to be called, @@ -1406,6 +1686,7 @@ { iServerPaused = ETrue; WRITELOG1( "HarvesterThread::HandleSessionOpened() - Failed: %d!", aError ); + OstTrace1( TRACE_NORMAL, DUP13_CHARVESTERAO_HANDLESESSIONOPENED, "CHarvesterAO::HandleSessionOpened - Failed: %d!", aError ); } } @@ -1417,7 +1698,8 @@ { if ( KErrNone != aError ) { - WRITELOG1( "HarvesterThread::HandleSessionError() - Error: %d!", aError ); + WRITELOG1( "HarvesterThread::HandleSessionError() - Error: %d!", aError ); + OstTrace1( TRACE_NORMAL, CHARVESTERAO_HANDLESESSIONERROR, "CHarvesterAO::HandleSessionError - Error: %d!", aError ); } } @@ -1428,10 +1710,13 @@ void CHarvesterAO::ContextInitializationStatus( TInt aErrorCode ) { WRITELOG( "CHarvesterAO::ContextInitializationStatus()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS, "CHarvesterAO::ContextInitializationStatus" ); if ( KErrNone == aErrorCode ) { WRITELOG( "HarvesterThread::ContextInitializationStatus() - Succeeded!" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS, "CHarvesterAO::ContextInitializationStatus - Succeeded!" ); + iContextEngineInitialized = ETrue; if ( iMdeSessionInitialized ) { @@ -1441,6 +1726,8 @@ else { WRITELOG1( "HarvesterThread::ContextInitializationStatus() - Failed: %d!", aErrorCode ); + OstTrace1( TRACE_NORMAL, DUP2_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS, "CHarvesterAO::ContextInitializationStatus - Failed: %d!", aErrorCode ); + } } @@ -1451,20 +1738,20 @@ TInt CHarvesterAO::PauseHarvester() { WRITELOG( "CHarvesterAO::PauseHarvester()" ); - - Cancel(); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_PAUSEHARVESTER, "CHarvesterAO::PauseHarvester" ); iHarvesterPluginFactory->PauseHarvester( ETrue ); iServerPaused = ETrue; - if( !iRamFull && !iDiskFull ) + if( !iRamFull && !iDiskFull && !iUnmountDetected ) { iManualPauseEnabled = ETrue; } // Everything is paused WRITELOG( "CHarvesterAO::PauseHarvester() - Moving paused state paused" ); - + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_PAUSEHARVESTER, "CHarvesterAO::PauseHarvester - Moving paused state paused" ); + return KErrNone; } @@ -1475,12 +1762,18 @@ void CHarvesterAO::ResumeHarvesterL() { WRITELOG( "CHarvesterAO::ResumeHarvesterL()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_RESUMEHARVESTERL, "CHarvesterAO::ResumeHarvesterL" ); iHarvesterPluginFactory->PauseHarvester( EFalse ); iServerPaused = EFalse; - iManualPauseEnabled = EFalse; - SetNextRequest( ERequestHarvest ); + if( !iManualPauseEnabled && + iNextRequest == ERequestIdle ) + { + SetNextRequest( ERequestHarvest ); + } + + iManualPauseEnabled = EFalse; } // --------------------------------------------------------------------------- @@ -1490,11 +1783,19 @@ void CHarvesterAO::RunL() { WRITELOG( "CHarvesterAO::RunL" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_RUNL, "CHarvesterAO::RunL" ); + // check if pause is requested if ( this->iServerPaused && iNextRequest != ERequestPause && iNextRequest != ERequestResume) { iNextRequest = ERequestIdle; } + + // Reset unmount flag, as unmount is handled before RunL is called again after aborted harvesting run + iUnmountDetected = EFalse; + // Reset priority flag, as interrupt is handled automatically first when RunL is called again + iPriorityInterruptDetected = EFalse; + User::LeaveIfError( iStatus.Int() ); switch( iNextRequest ) { @@ -1502,9 +1803,12 @@ case ERequestIdle: { WRITELOG( "CHarvesterAO::RunL - ERequestIdle" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_RUNL, "CHarvesterAO::RunL - ERequestIdle" ); + iReadyPHArray.Compress(); iContainerPHArray.Compress(); iPHArray.Compress(); + iTempReadyPHArray.Compress(); } break; @@ -1512,10 +1816,12 @@ case ERequestHarvest: { WRITELOG( "CHarvesterAO::RunL - ERequestHarvest" ); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTERAO_RUNL, "CHarvesterAO::RunL - ERequestHarvest" ); // harvest new items first... if ( iQueue->ItemsInQueue() > 0 ) { + WRITELOG( "CHarvesterAO::RunL - Items in queue - calling ReadItemFromQueueL()" ); ReadItemFromQueueL(); SetNextRequest( ERequestHarvest ); break; @@ -1524,10 +1830,12 @@ // no more items to handle from main queue else { + WRITELOG( "CHarvesterAO::RunL - No items in main queue" ); // All registered fast harvested items or placeholders handled at this point // if container files to harvest, handle those next if( iContainerPHArray.Count() > 0 ) { + WRITELOG( "CHarvesterAO::RunL - Items in iContainterPHArray - requesting ERequestContainerPlaceholder handling" ); iFastHarvestNeeded = EFalse; iHarvestingPlaceholders = EFalse; SetPriority( KHarvesterPriorityHarvestingPlugin ); @@ -1536,6 +1844,9 @@ } else if( iHarvestingPlaceholders || iFastHarvestNeeded ) { + WRITELOG( "CHarvesterAO::RunL - No items in iContainerPHArray" ); + WRITELOG( "CHarvesterAO::RunL - PlaceholderHarvesting or FastHarvesting were enabled -> reset" ); + WRITELOG( "CHarvesterAO::RunL - next request for ERequestHarvest handling" ); // reset to default priority iFastHarvestNeeded = EFalse; iHarvestingPlaceholders = EFalse; @@ -1544,11 +1855,14 @@ break; } + WRITELOG( "CHarvesterAO::RunL - starting handling of iReadyPHArray items" ); + const TInt arrayCount( iReadyPHArray.Count() ); if( arrayCount > 0 ) { #ifdef _DEBUG WRITELOG1("CHarvesterAO::RunL - items in ready pharray: %d", arrayCount ); + OstTrace1( TRACE_NORMAL, DUP3_CHARVESTERAO_RUNL, "CHarvesterAO::RunL - items in ready pharray: %d", arrayCount ); #endif TInt endIndex( KPlaceholderQueueSize ); if( arrayCount < KPlaceholderQueueSize ) @@ -1558,6 +1872,10 @@ for( TInt i = 0; i < endIndex; i++ ) { CheckFileExtensionAndHarvestL( iReadyPHArray[i] ); + if( iUnmountDetected ) + { + break; + } iReadyPHArray.Remove( i ); // correct the index so harvesting order remains ok i--; @@ -1580,7 +1898,9 @@ { #ifdef _DEBUG WRITELOG( "CHarvesterAO::RunL - ERequestContainerPlaceholder" ); + OstTrace0( TRACE_NORMAL, DUP4_CHARVESTERAO_RUNL, "CHarvesterAO::RunL - ERequestContainerPlaceholder" ); WRITELOG1( "CHarvesterAO::RunL - Items in container pharray: %d", iContainerPHArray.Count() ); + OstTrace1( TRACE_NORMAL, DUP5_CHARVESTERAO_RUNL, "CHarvesterAO::RunL - Items in container pharray: %d", iContainerPHArray.Count() ); #endif TInt count = iContainerPHArray.Count() > KContainerPlaceholderQueueSize ? KContainerPlaceholderQueueSize : iContainerPHArray.Count(); TInt i = 0; @@ -1598,6 +1918,7 @@ { iContainerPHArray.ResetAndDestroy(); iPHArray.ResetAndDestroy(); + iTempReadyPHArray.ResetAndDestroy(); User::Leave( err ); } SetNextRequest( ERequestHarvest ); @@ -1608,6 +1929,7 @@ case ERequestPause: { WRITELOG( "CHarvesterAO::RunL - ERequestPause" ); + OstTrace0( TRACE_NORMAL, DUP6_CHARVESTERAO_RUNL, "CHarvesterAO::RunL - ERequestPause" ); User::LeaveIfError( PauseHarvester() ); iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStatePaused ); if( iHarvesterStatusObserver ) @@ -1621,6 +1943,7 @@ case ERequestResume: { WRITELOG( "CHarvesterAO::RunL - ERequestResume" ); + OstTrace0( TRACE_NORMAL, DUP7_CHARVESTERAO_RUNL, "CHarvesterAO::RunL - ERequestResume" ); ResumeHarvesterL(); iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStateResumed ); if( iHarvesterStatusObserver ) @@ -1634,6 +1957,7 @@ default: { WRITELOG( "CHarvesterAO::RunL - Not supported request" ); + OstTrace0( TRACE_NORMAL, DUP8_CHARVESTERAO_RUNL, "CHarvesterAO::RunL - Not supported request" ); User::Leave( KErrNotSupported ); } break; @@ -1647,6 +1971,7 @@ void CHarvesterAO::DoCancel() { WRITELOG( "CHarvesterAO::DoCancel()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_DOCANCEL, "CHarvesterAO::DoCancel" ); } // --------------------------------------------------------------------------- @@ -1656,17 +1981,22 @@ TInt CHarvesterAO::RunError( TInt aError ) { WRITELOG( "CHarvesterAO::RunError" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_RUNERROR, "CHarvesterAO::RunError" ); + switch( iNextRequest ) { case ERequestHarvest: { WRITELOG( "CHarvesterAO::RunError - state ERequestHarvest" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_RUNERROR, "CHarvesterAO::RunError - state ERequestHarvest" ); } break; case ERequestPause: { WRITELOG( "CHarvesterAO::RunError - state ERequestPause" ); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTERAO_RUNERROR, "CHarvesterAO::RunError - state ERequestPause" ); + if ( aError == KErrNotReady ) { SetNextRequest( ERequestPause ); @@ -1681,6 +2011,8 @@ case ERequestResume: { WRITELOG( "CHarvesterAO::RunError - state ERequestResume" ); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTERAO_RUNERROR, "CHarvesterAO::RunError - state ERequestResume" ); + if( iHarvesterStatusObserver ) { iHarvesterStatusObserver->ResumeReady( aError ); @@ -1691,6 +2023,7 @@ default: { WRITELOG( "CHarvesterAO::RunError - unknown state" ); + OstTrace0( TRACE_NORMAL, DUP4_CHARVESTERAO_RUNERROR, "CHarvesterAO::RunError - unknown state" ); } break; } @@ -1705,6 +2038,8 @@ void CHarvesterAO::SetNextRequest( TRequest aRequest ) { WRITELOG( "CHarvesterAO::SetNextRequest" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_SETNEXTREQUEST, "CHarvesterAO::SetNextRequest" ); + iNextRequest = aRequest; if ( !IsActive() ) @@ -1723,6 +2058,8 @@ TBool CHarvesterAO::IsServerPaused() { WRITELOG( "CHarvesterAO::IsServerPaused" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_ISSERVERPAUSED, "CHarvesterAO::IsServerPaused" ); + return iServerPaused; } @@ -1736,6 +2073,8 @@ { // close blacklist database connection WRITELOG( "CHarvesterAO::BackupRestoreStart" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_BACKUPRESTORESTART, "CHarvesterAO::BackupRestoreStart" ); + iBlacklist->CloseDatabase(); } @@ -1749,6 +2088,8 @@ { // restart blacklist database connection WRITELOG( "CHarvesterAO::BackupRestoreReady" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_BACKUPRESTOREREADY, "CHarvesterAO::BackupRestoreReady" ); + iBlacklist->OpenDatabase(); } @@ -1760,14 +2101,18 @@ void CHarvesterAO::HandleDiskSpaceNotificationL( TDiskSpaceDirection aDiskSpaceDirection ) { WRITELOG("CHarvesterAO::HandleDiskSpaceNotificationL()"); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL, "CHarvesterAO::HandleDiskSpaceNotificationL" ); + if( MMdSHarvesterDiskSpaceObserver::EMore == aDiskSpaceDirection ) { WRITELOG("CHarvesterAO::HandleDiskSpaceNotificationL() - disk full"); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL, "CHarvesterAO::HandleDiskSpaceNotificationL - disk full" ); iDiskFull = EFalse; } else { WRITELOG("CHarvesterAO::HandleDiskSpaceNotificationL() - disk space available"); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL, "CHarvesterAO::HandleDiskSpaceNotificationL - disk space available" ); iDiskFull = ETrue; if( iServerPaused ) { @@ -1796,6 +2141,8 @@ void CHarvesterAO::HarvestFile( const RMessage2& aMessage ) { WRITELOG( "CHarvesterAO::HarvestFile" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_HARVESTFILE, "CHarvesterAO::HarvestFile" ); + const TInt KParamUri = 0; const TInt KParamAlbumIds = 1; const TInt KParamAddLocation = 2; @@ -1806,6 +2153,8 @@ if ( ! uri ) { WRITELOG( "CHarvesterAO::HarvestFile - out of memory creating uri container" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_HARVESTFILE, "CHarvesterAO::HarvestFile - out of memory creating uri container" ); + if (!aMessage.IsNull()) { aMessage.Complete( KErrNoMemory ); @@ -1818,6 +2167,8 @@ if ( err != KErrNone ) { WRITELOG1( "CHarvesterAO::HarvestFile - error in reading aMessage (uri): %d", err ); + OstTrace1( TRACE_NORMAL, DUP2_CHARVESTERAO_HARVESTFILE, "CHarvesterAO::HarvestFile - error in reading aMessage (uri): %d", err ); + if (!aMessage.IsNull()) { aMessage.Complete( err ); @@ -1837,6 +2188,8 @@ if ( !albumIdBuf ) { WRITELOG( "CHarvesterAO::HarvestFile - error creating album id buffer." ); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTERAO_HARVESTFILE, "CHarvesterAO::HarvestFile - error creating album id buffer." ); + if (!aMessage.IsNull()) { aMessage.Complete( KErrNoMemory ); @@ -1850,6 +2203,7 @@ if ( err != KErrNone ) { WRITELOG1( "CHarvesterAO::HarvestFile - error in reading aMessage (albumIds): %d", err ); + OstTrace1( TRACE_NORMAL, DUP4_CHARVESTERAO_HARVESTFILE, "CHarvesterAO::HarvestFile - error in reading aMessage (albumIds): %d", err ); delete albumIdBuf; albumIdBuf = NULL; delete uri; @@ -1865,6 +2219,8 @@ if ( err != KErrNone ) { WRITELOG1( "CHarvesterAO::HarvestFile - error in reading album id array: %d", err ); + OstTrace1( TRACE_NORMAL, DUP5_CHARVESTERAO_HARVESTFILE, "CHarvesterAO::HarvestFile - error in reading album id array: %d", err ); + delete albumIdBuf; albumIdBuf = NULL; delete uri; @@ -1888,6 +2244,8 @@ albumIdBuf = NULL; WRITELOG1( "CHarvesterAO::HarvestFile - album id count: %d", albumIds.Count() ); + OstTrace1( TRACE_NORMAL, DUP6_CHARVESTERAO_HARVESTFILE, "CHarvesterAO::HarvestFile - album id count: %d", albumIds.Count() ); + } TBool addLocation; @@ -1896,6 +2254,8 @@ if ( err != KErrNone ) { WRITELOG1( "CHarvesterAO::HarvestFile - error in reading aMessage (addLocation): %d", err ); + OstTrace1( TRACE_NORMAL, DUP7_CHARVESTERAO_HARVESTFILE, "CHarvesterAO::HarvestFile - error in reading aMessage (addLocation): %d", err ); + delete uri; uri = NULL; if (!aMessage.IsNull()) @@ -1906,12 +2266,16 @@ } WRITELOG1( "RHarvesterClient::HarvestFile - add location: %d", addLocation ); + OstTrace1( TRACE_NORMAL, DUP8_CHARVESTERAO_HARVESTFILE, "CHarvesterAO::HarvestFile - add location: %d", addLocation ); + CHarvesterData* hd = NULL; TRAP( err, hd = CHarvesterData::NewL( uri ) ); if ( err != KErrNone || !hd ) { WRITELOG( "CHarvesterAO::HarvestFile - creating harvUri failed" ); + OstTrace0( TRACE_NORMAL, DUP9_CHARVESTERAO_HARVESTFILE, "CHarvesterAO::HarvestFile - creating harvUri failed" ); + albumIds.Close(); delete uri; uri = NULL; @@ -1938,14 +2302,17 @@ else { WRITELOG( "CHarvesterAO::HarvestFile - creating clientData failed" ); + OstTrace0( TRACE_NORMAL, DUP10_CHARVESTERAO_HARVESTFILE, "CHarvesterAO::HarvestFile - creating clientData failed" ); } if( iQueue ) { iQueue->Append( hd ); + iPriorityInterruptDetected = ETrue; + // signal to start harvest if harvester idles - if ( !IsServerPaused() ) + if ( !IsServerPaused() && iNextRequest == ERequestIdle ) { SetNextRequest( CHarvesterAO::ERequestHarvest ); } @@ -1971,6 +2338,8 @@ void CHarvesterAO::HarvestFileWithUID( const RMessage2& aMessage ) { WRITELOG( "CHarvesterAO::HarvestFileWithUID" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_HARVESTFILEWITHUID, "CHarvesterAO::HarvestFileWithUID" ); + const TInt KParamUri = 0; const TInt KParamAlbumIds = 1; const TInt KParamAddLocation = 2; @@ -1981,6 +2350,8 @@ if ( ! uri ) { WRITELOG( "CHarvesterAO::HarvestFileWithUID - out of memory creating uri container" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_HARVESTFILEWITHUID, "CHarvesterAO::HarvestFileWithUID - out of memory creating uri container" ); + if (!aMessage.IsNull()) { aMessage.Complete( KErrNoMemory ); @@ -1993,6 +2364,8 @@ if ( err != KErrNone ) { WRITELOG1( "CHarvesterAO::HarvestFileWithUID - error in reading aMessage (uri): %d", err ); + OstTrace1( TRACE_NORMAL, DUP2_CHARVESTERAO_HARVESTFILEWITHUID, "CHarvesterAO::HarvestFileWithUID - error in reading aMessage (uri): %d", err ); + if (!aMessage.IsNull()) { aMessage.Complete( err ); @@ -2012,6 +2385,8 @@ if ( !albumIdBuf ) { WRITELOG( "CHarvesterAO::HarvestFileWithUID - error creating album id buffer." ); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTERAO_HARVESTFILEWITHUID, "CHarvesterAO::HarvestFileWithUID - error creating album id buffer." ); + if (!aMessage.IsNull()) { aMessage.Complete( KErrNoMemory ); @@ -2025,6 +2400,8 @@ if ( err != KErrNone ) { WRITELOG1( "CHarvesterAO::HarvestFileWithUID - error in reading aMessage (albumIds): %d", err ); + OstTrace1( TRACE_NORMAL, DUP4_CHARVESTERAO_HARVESTFILEWITHUID, "CHarvesterAO::HarvestFileWithUID - error in reading aMessage (albumIds): %d", err ); + delete albumIdBuf; albumIdBuf = NULL; delete uri; @@ -2040,6 +2417,8 @@ if ( err != KErrNone ) { WRITELOG1( "CHarvesterAO::HarvestFileWithUID - error in reading album id array: %d", err ); + OstTrace1( TRACE_NORMAL, DUP5_CHARVESTERAO_HARVESTFILEWITHUID, "CHarvesterAO::HarvestFileWithUID - error in reading album id array: %d", err ); + delete albumIdBuf; albumIdBuf = NULL; delete uri; @@ -2064,6 +2443,7 @@ #ifdef _DEBUG WRITELOG1( "CHarvesterAO::HarvestFileWithUID - album id count: %d", albumIds.Count() ); + OstTrace1( TRACE_NORMAL, DUP6_CHARVESTERAO_HARVESTFILEWITHUID, "CHarvesterAO::HarvestFileWithUID - album id count: %d", albumIds.Count() ); #endif } @@ -2073,6 +2453,8 @@ if ( err != KErrNone ) { WRITELOG1( "CHarvesterAO::HarvestFileWithUID - error in reading aMessage (addLocation): %d", err ); + OstTrace1( TRACE_NORMAL, DUP7_CHARVESTERAO_HARVESTFILEWITHUID, "CHarvesterAO::HarvestFileWithUID - error in reading aMessage (addLocation): %d", err ); + delete uri; uri = NULL; if (!aMessage.IsNull()) @@ -2083,12 +2465,16 @@ } WRITELOG1( "RHarvesterClient::HarvestFileWithUID - add location: %d", addLocation ); + OstTrace1( TRACE_NORMAL, DUP8_CHARVESTERAO_HARVESTFILEWITHUID, "CHarvesterAO::HarvestFileWithUID - add location: %d", addLocation ); + CHarvesterData* hd = NULL; TRAP( err, hd = CHarvesterData::NewL( uri ) ); if ( err != KErrNone || !hd ) { WRITELOG( "CHarvesterAO::HarvestFileWithUID - creating harvUri failed" ); + OstTrace0( TRACE_NORMAL, DUP9_CHARVESTERAO_HARVESTFILEWITHUID, "CHarvesterAO::HarvestFileWithUID - creating harvUri failed" ); + albumIds.Close(); delete uri; uri = NULL; @@ -2115,6 +2501,7 @@ else { WRITELOG( "CHarvesterAO::HarvestFileWithUID - creating clientData failed" ); + OstTrace0( TRACE_NORMAL, DUP10_CHARVESTERAO_HARVESTFILEWITHUID, "CHarvesterAO::HarvestFileWithUID - creating clientData failed" ); } if( iQueue ) @@ -2122,7 +2509,7 @@ iQueue->Append( hd ); // signal to start harvest if harvester idles - if ( !IsServerPaused() ) + if ( !IsServerPaused() && iNextRequest == ERequestIdle ) { SetNextRequest( CHarvesterAO::ERequestHarvest ); } @@ -2148,10 +2535,13 @@ void CHarvesterAO::RegisterProcessOrigin( const RMessage2& aMessage ) { WRITELOG( "CHarvesterAO::RegisterProcessOrigin" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_REGISTERPROCESSORIGIN, "CHarvesterAO::RegisterProcessOrigin" ); if ( !iProcessOriginMapper ) { WRITELOG( "CHarvesterAO::RegisterProcessOrigin - mapper not available." ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_REGISTERPROCESSORIGIN, "CHarvesterAO::RegisterProcessOrigin - mapper not available." ); + if (!aMessage.IsNull()) { aMessage.Complete( KErrNotSupported ); @@ -2164,6 +2554,8 @@ if ( MdsUtils::IsValidProcessId( processId ) ) { WRITELOG1( "CHarvesterAO::RegisterProcessOrigin - error reading processId. Read: %d", processId.iUid ); + OstTrace1( TRACE_NORMAL, DUP2_CHARVESTERAO_REGISTERPROCESSORIGIN, "CHarvesterAO::RegisterProcessOrigin - error reading processId. Read: %d", processId.iUid ); + if (!aMessage.IsNull()) { aMessage.Complete( KErrCorrupt ); @@ -2175,9 +2567,13 @@ TOrigin origin = STATIC_CAST( TOrigin, aMessage.Int1() ); WRITELOG1( "CHarvesterAO::RegisterProcessOrigin - origin: %d", origin ); + OstTrace1( TRACE_NORMAL, DUP3_CHARVESTERAO_REGISTERPROCESSORIGIN, "CHarvesterAO::RegisterProcessOrigin - origin: %d", origin ); + if ( origin < 0 ) { WRITELOG( "CHarvesterAO::RegisterProcessOrigin - error reading origin from aMessage (negative)." ); + OstTrace0( TRACE_NORMAL, DUP4_CHARVESTERAO_REGISTERPROCESSORIGIN, "CHarvesterAO::RegisterProcessOrigin - error reading origin from aMessage (negative)." ); + if (!aMessage.IsNull()) { aMessage.Complete( KErrCorrupt ); @@ -2189,6 +2585,8 @@ if ( err != KErrNone ) { WRITELOG1( "CHarvesterAO::RegisterProcessOrigin - error registering mapping: %d", err ); + OstTrace1( TRACE_NORMAL, DUP5_CHARVESTERAO_REGISTERPROCESSORIGIN, "CHarvesterAO::RegisterProcessOrigin - error registering mapping: %d", err ); + if (!aMessage.IsNull()) { aMessage.Complete( err ); @@ -2208,10 +2606,13 @@ void CHarvesterAO::UnregisterProcessOrigin( const RMessage2& aMessage ) { WRITELOG( "CHarvesterAO::UnregisterProcessOrigin" ); - + OstTrace0( TRACE_NORMAL, CHARVESTERAO_UNREGISTERPROCESSORIGIN, "CHarvesterAO::UnregisterProcessOrigin" ); + if ( !iProcessOriginMapper ) { WRITELOG( "CHarvesterAO::RegisterProcessOrigin - mapper not available." ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_UNREGISTERPROCESSORIGIN, "CHarvesterAO::UnregisterProcessOrigin - mapper not available." ); + if (!aMessage.IsNull()) { aMessage.Complete( KErrNotSupported ); @@ -2224,6 +2625,8 @@ if ( MdsUtils::IsValidProcessId( processId ) ) { WRITELOG1( "CHarvesterAO::UnregisterProcessOrigin - error reading processId. Read: %d", processId.iUid ); + OstTrace1( TRACE_NORMAL, DUP2_CHARVESTERAO_UNREGISTERPROCESSORIGIN, "CHarvesterAO::UnregisterProcessOrigin - error reading processId. Read: %d", processId.iUid ); + if (!aMessage.IsNull()) { aMessage.Complete( KErrCorrupt ); @@ -2235,6 +2638,8 @@ if ( err != KErrNone ) { WRITELOG1( "CHarvesterAO::UnregisterProcessOrigin - error unregistering mapping: %d", err ); + OstTrace1( TRACE_NORMAL, DUP3_CHARVESTERAO_UNREGISTERPROCESSORIGIN, "CHarvesterAO::UnregisterProcessOrigin - error unregistering mapping: %d", err ); + if (!aMessage.IsNull()) { aMessage.Complete( err ); @@ -2254,7 +2659,8 @@ TInt CHarvesterAO::RegisterHarvestComplete( const CHarvesterServerSession& aSession, const RMessage2& aMessage ) { WRITELOG( "CHarvesterAO::RegisterHarvestComplete" ); - + OstTrace0( TRACE_NORMAL, CHARVESTERAO_REGISTERHARVESTCOMPLETE, "CHarvesterAO::RegisterHarvestComplete" ); + return iHarvestFileMessages.Append( THarvestFileRequest( aSession, aMessage ) ); } @@ -2266,6 +2672,7 @@ TInt CHarvesterAO::UnregisterHarvestComplete( const CHarvesterServerSession& aSession ) { WRITELOG( "CHarvesterAO::UnregisterHarvestComplete" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_UNREGISTERHARVESTCOMPLETE, "CHarvesterAO::UnregisterHarvestComplete" ); TInt err( KErrNotFound ); if ( iHarvestFileMessages.Count() > 0 ) @@ -2309,6 +2716,7 @@ void CHarvesterAO::RegisterHarvesterEvent( const RMessage2& aMessage ) { WRITELOG( "CHarvesterAO::RegisterHarvesterEvent" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_REGISTERHARVESTEREVENT, "CHarvesterAO::RegisterHarvesterEvent" ); TRAPD( err, iHarvesterEventManager->RegisterEventObserverL( aMessage ) ); aMessage.Complete( err ); @@ -2321,6 +2729,7 @@ void CHarvesterAO::UnregisterHarvesterEvent( const RMessage2& aMessage ) { WRITELOG( "CHarvesterAO::UnregisterHarvesterEvent" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_UNREGISTERHARVESTEREVENT, "CHarvesterAO::UnregisterHarvesterEvent" ); const TInt err = iHarvesterEventManager->UnregisterEventObserver( aMessage ); aMessage.Complete( err ); @@ -2329,6 +2738,7 @@ void CHarvesterAO::GetLastObserverId( const RMessage2& aMessage ) { WRITELOG( "CHarvesterAO::GetLastObserverId" ); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_GETLASTOBSERVERID, "CHarvesterAO::GetLastObserverId" ); TUint observerId = iHarvesterEventManager->GetLastClientId(); @@ -2344,34 +2754,41 @@ void CHarvesterAO::ContextSnapshotStatus( CHarvesterData* aHD ) { WRITELOG( "CHarvesterAO::ContextSnapshotStatus()" ); - + OstTrace0( TRACE_NORMAL, CHARVESTERAO_CONTEXTSNAPSHOTSTATUS, "CHarvesterAO::ContextSnapshotStatus" ); + HarvestCompleted( aHD->ClientId(), aHD->Uri(), aHD->ErrorCode() ); const TInt errorCode = aHD->ErrorCode(); if( errorCode != KErrNone && errorCode != KErrCompletion ) { - WRITELOG1( "CHarvesterAO::ContextSnapshotStatus() - error occurred: %d", errorCode ); + WRITELOG1( "CHarvesterAO::ContextSnapshotStatus() - error occurred: %d", errorCode ); + OstTrace1( TRACE_NORMAL, DUP1_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS, "CHarvesterAO::ContextSnapshotStatus - error occurred: %d", errorCode ); } else { if( errorCode == KErrCompletion ) { WRITELOG( "CHarvesterAO::ContextSnapshotStatus() - snapshot could not be completed" ); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS, "CHarvesterAO::ContextSnapshotStatus - snapshot could not be completed" ); WRITELOG( "CHarvesterAO::ContextSnapshotStatus() - processing non-context data anyway" ); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS, "CHarvesterAO::ContextSnapshotStatus - processing non-context data anyway" ); } else { WRITELOG( "CHarvesterAO::ContextSnapshotStatus() - successfully completed" ); + OstTrace0( TRACE_NORMAL, DUP4_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS, "CHarvesterAO::ContextSnapshotStatus - successfully completed" ); } if( aHD->Origin() == MdeConstants::Object::ECamera ) { aHD->MdeObject().SetPlaceholder( EFalse ); + TRAP_IGNORE( iHarvesterEventManager->DecreaseItemCountL( EHEObserverTypePlaceholder ) ); TRAPD(mdeError, iMdeObjectHandler->SetMetadataObjectL( *aHD ) ); if(mdeError != KErrNone) { WRITELOG( "==============================ERROR===============================" ); WRITELOG( "CHarvesterAO::HarvestingCompleted() - cannot set metadata object" ); WRITELOG( "==============================ERROR done =========================" ); + OstTrace0( TRACE_NORMAL, DUP5_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS, "CHarvesterAO::ContextSnapshotStatus - cannot set metadata object" ); } } } @@ -2404,6 +2821,8 @@ if ( aClientId == msg.Identity() ) { WRITELOG1( "CHarvesterAO::HarvestingCompleted() - Completing Fast Harvest request! Error code: %d", aErr ); + OstTrace1( TRACE_NORMAL, CHARVESTERAO_HARVESTCOMPLETED, "CHarvesterAO::HarvestCompleted - Completing Fast Harvest request! Error code: %d", aErr ); + if (!msg.IsNull()) { msg.Write( KParamUri, aUri ); @@ -2412,8 +2831,13 @@ else { WRITELOG("CHarvesterAO::HarvestingCompleted() NOT COMPLETING AS msg->iMessage->IsNull returns ETrue"); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_HARVESTCOMPLETED, "CHarvesterAO::HarvestCompleted NOT COMPLETING AS msg->iMessage->IsNull returns ETrue" ); } iHarvestFileMessages.Remove( i ); + if( iHarvestFileMessages.Count() == 0 ) + { + iHarvestFileMessages.Compress(); + } } } } @@ -2422,6 +2846,7 @@ void CHarvesterAO::BootRomScanL() { WRITELOG("CHarvesterAO::BootRomScanL()"); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_BOOTROMSCANL, "CHarvesterAO::BootRomScanL" ); if( !iMdeSessionInitialized ) { @@ -2468,7 +2893,8 @@ iMdEHarvesterSession->ChangeCDriveMediaId(); WRITELOG("CHarvesterAO::BootPartialRestoreScanL() - partial restore"); - + OstTrace0( TRACE_NORMAL, CHARVESTERAO_BOOTPARTIALRESTORESCANL, "CHarvesterAO::BootPartialRestoreScanL - partial restore" ); + RPointerArray scanItems; TCleanupItem cleanupItem( MdsUtils::CleanupPtrArray, &scanItems ); CleanupStack::PushL( cleanupItem ); @@ -2484,6 +2910,8 @@ BootScanL( scanItems, ignorePaths, EFalse ); WRITELOG("CHarvesterAO::BootPartialRestoreScanL() - iRestoreWatcher->UnregisterL()"); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERAO_BOOTPARTIALRESTORESCANL, "CHarvesterAO::BootPartialRestoreScanL - iRestoreWatcher->UnregisterL()" ); + iRestoreWatcher->UnregisterL(); CleanupStack::PopAndDestroy( &ignorePaths ); @@ -2512,8 +2940,8 @@ TBool aCheckDrive ) { WRITELOG("CHarvesterAO::BootScanL() - begin"); - - + OstTrace0( TRACE_NORMAL, CHARVESTERAO_BOOTSCANL, "CHarvesterAO::BootScanL - begin" ); + TInt drive( -1 ); TInt massStorageError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultMassStorage, drive ) ); if( massStorageError == KErrNone ) @@ -2542,6 +2970,7 @@ #ifdef _DEBUG WRITELOG1("CHarvesterAO::BootScanL() - item count: %d", aScanItems.Count() ); + OstTrace1( TRACE_NORMAL, DUP1_CHARVESTERAO_BOOTSCANL, "CHarvesterAO::BootScanL - item count: %d", aScanItems.Count() ); #endif RPointerArray hdArray; @@ -2610,6 +3039,7 @@ if( !IsDescInArray( path, aIgnorePaths ) ) { WRITELOG("CHarvesterAO::BootScanL() - scanFolders.AppendL"); + OstTrace0( TRACE_NORMAL, DUP2_CHARVESTERAO_BOOTSCANL, "CHarvesterAO::BootScanL - scanFolders.AppendL" ); TScanItem* item = new (ELeave) TScanItem(); item->iPath = name->AllocL(); item->iPreinstalled = MdeConstants::MediaObject::ENotPreinstalled; @@ -2626,6 +3056,7 @@ if( !IsDescInArray( filename, aIgnorePaths ) ) { WRITELOG("CHarvesterAO::BootScanL() - check files"); + OstTrace0( TRACE_NORMAL, DUP3_CHARVESTERAO_BOOTSCANL, "CHarvesterAO::BootScanL - check files" ); RArray uris; RArray fileInfos; @@ -2690,6 +3121,8 @@ } WRITELOG("CHarvesterAO::BootScanL() - iQueue->Append"); + OstTrace0( TRACE_NORMAL, DUP4_CHARVESTERAO_BOOTSCANL, "CHarvesterAO::BootScanL - iQueue->Append" ); + iQueue->MonitorEvent( hdArray ); CleanupStack::PopAndDestroy( &hdArray ); @@ -2698,6 +3131,7 @@ iMassMemoryIdChecked = ETrue; WRITELOG("CHarvesterAO::BootScanL() - end"); + OstTrace0( TRACE_NORMAL, DUP5_CHARVESTERAO_BOOTSCANL, "CHarvesterAO::BootScanL - end" ); } void CHarvesterAO::SetHarvesterStatusObserver( MHarvesterStatusObserver* aObserver ) @@ -2775,6 +3209,8 @@ void CHarvesterAO::MemoryLow() { WRITELOG("CHarvesterAO::MemoryLow()"); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_MEMORYLOW, "CHarvesterAO::MemoryLow" ); + iRamFull = ETrue; if( iServerPaused ) @@ -2794,6 +3230,8 @@ void CHarvesterAO::MemoryGood() { WRITELOG("CHarvesterAO::MemoryGood()"); + OstTrace0( TRACE_NORMAL, CHARVESTERAO_MEMORYGOOD, "CHarvesterAO::MemoryGood" ); + iRamFull = EFalse; if( !iDiskFull && !iManualPauseEnabled && iServerPaused ) @@ -2832,3 +3270,66 @@ } } +void CHarvesterAO::AddDefaultFolderDataL( CMdEObject* aObject ) + { + TPtrC objectDefName( aObject->Def().Name() ); + if( objectDefName == MdeConstants::Image::KImageObject ) + { + const TDesC& uri = aObject->Uri(); + if( uri.FindF( iMmcImagesPath->Des()) != KErrNotFound || + uri.FindF( iPhoneImagesPath->Des()) != KErrNotFound || + uri.FindF( KDCIMFolder ) != KErrNotFound ) + { + TBool inDefaultFolder( ETrue ); + aObject->AddBoolPropertyL( *iPropDefs->iDefaultFolderPropertyDef, inDefaultFolder ); + } + else + { + TBool inDefaultFolder( EFalse ); + aObject->AddBoolPropertyL( *iPropDefs->iDefaultFolderPropertyDef, inDefaultFolder ); + } + } + else if( objectDefName == MdeConstants::Video::KVideoObject ) + { + const TDesC& uri = aObject->Uri(); + if( uri.FindF( iMmcVideosPath->Des()) != KErrNotFound || + uri.FindF( iPhoneVideosPath->Des()) != KErrNotFound || + uri.FindF( KDCIMFolder ) != KErrNotFound ) + { + TBool inDefaultFolder( ETrue ); + aObject->AddBoolPropertyL( *iPropDefs->iDefaultFolderPropertyDef, inDefaultFolder ); + } + else + { + TBool inDefaultFolder( EFalse ); + aObject->AddBoolPropertyL( *iPropDefs->iDefaultFolderPropertyDef, inDefaultFolder ); + } + } + else if( objectDefName == MdeConstants::Audio::KAudioObject ) + { + const TDesC& uri = aObject->Uri(); + if( uri.FindF( iMmcSoundsPath->Des()) != KErrNotFound || + uri.FindF( iPhoneSoundsPath->Des()) != KErrNotFound ) + { + TBool inDefaultFolder( ETrue ); + aObject->AddBoolPropertyL( *iPropDefs->iDefaultFolderPropertyDef, inDefaultFolder ); + } + else + { + TBool inDefaultFolder( EFalse ); + aObject->AddBoolPropertyL( *iPropDefs->iDefaultFolderPropertyDef, inDefaultFolder ); + } + } + else + { + // Other objects are set to be in default location by default + TBool inDefaultFolder( ETrue ); + aObject->AddBoolPropertyL( *iPropDefs->iDefaultFolderPropertyDef, inDefaultFolder ); + } + } + +CHarvesterAO::TRequest CHarvesterAO::GetHarvesterAORunState() + { + return iNextRequest; + } + diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/server/src/harvesterqueue.cpp --- a/harvester/server/src/harvesterqueue.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/server/src/harvesterqueue.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -252,7 +252,7 @@ Append( aHarvesterData ); // signal to start harvest if harvester idles - if ( !iHarvesterAO->IsServerPaused() ) + if ( !iHarvesterAO->IsServerPaused() && iHarvesterAO->GetHarvesterAORunState() == CHarvesterAO::ERequestIdle ) { iHarvesterAO->SetNextRequest( CHarvesterAO::ERequestHarvest ); } diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/server/src/harvesterserver.cpp --- a/harvester/server/src/harvesterserver.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/server/src/harvesterserver.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -25,6 +25,11 @@ #include "harvesterao.h" #include "harvesterblacklist.h" #include "mdsactivescheduler.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "harvesterserverTraces.h" +#endif + // ---------------------------------------------------------------------------------------- // Server's policy here @@ -194,6 +199,8 @@ void CHarvesterServer::ConstructL() { WRITELOG( "CHarvesterServer::ConstructL() - begin" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_CONSTRUCTL, "CHarvesterServer::ConstructL - begin" ); + StartL( KHarvesterServerName ); iHarvesterAO = CHarvesterAO::NewL(); @@ -207,6 +214,7 @@ // create shutdown observer iShutdownObserver = CHarvesterShutdownObserver::NewL( *this ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERSERVER_CONSTRUCTL, "CHarvesterServer::ConstructL - end" ); WRITELOG( "CHarvesterServer::ConstructL() - end" ); } @@ -217,6 +225,7 @@ void CHarvesterServer::Pause( const RMessage2& aMessage ) { WRITELOG( "CHarvesterServer::Pause() - begin" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_PAUSE, "CHarvesterServer::Pause" ); if ( !iHarvesterAO->IsServerPaused() ) { @@ -237,6 +246,7 @@ void CHarvesterServer::Resume( const RMessage2& aMessage ) { WRITELOG( "CHarvesterServer::Resume()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_RESUME, "CHarvesterServer::Resume" ); if ( iHarvesterAO->IsServerPaused() ) { @@ -256,7 +266,8 @@ void CHarvesterServer::Pause() { WRITELOG( "CHarvesterServer::Pause()" ); - + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERSERVER_PAUSE, "CHarvesterServer::Pause" ); + if ( !iHarvesterAO->IsServerPaused() ) { iHarvesterAO->SetNextRequest( CHarvesterAO::ERequestPause ); @@ -270,7 +281,8 @@ void CHarvesterServer::Resume() { WRITELOG( "CHarvesterServer::Resume()" ); - + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERSERVER_RESUME, "CHarvesterServer::Resume" ); + if ( iHarvesterAO->IsServerPaused() ) { iHarvesterAO->SetNextRequest( CHarvesterAO::ERequestResume ); @@ -281,6 +293,8 @@ void CHarvesterServer::PauseReady( TInt aError ) { WRITELOG1( "CHarvesterServer::PauseReady( %d )", aError ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_PAUSEREADY, "CHarvesterServer::PauseReady" ); + if( iMessage ) { iMessage->Complete( aError ); @@ -291,6 +305,8 @@ void CHarvesterServer::ResumeReady( TInt aError ) { WRITELOG1( "CHarvesterServer::ResumeReady( %d )", aError ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_RESUMEREADY, "CHarvesterServer::ResumeReady" ); + if( iMessage ) { iMessage->Complete( aError ); @@ -305,6 +321,8 @@ void CHarvesterServer::ShutdownNotification() { WRITELOG( "CHarvesterServer::ShutdownNotification" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_SHUTDOWNNOTIFICATION, "CHarvesterServer::ShutdownNotification" ); + CActiveScheduler::Stop(); } @@ -315,6 +333,8 @@ void CHarvesterServer::RestartNotification() { WRITELOG( "CHarvesterServer::RestartNotification" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_RESTARTNOTIFICATION, "CHarvesterServer::RestartNotification" ); + } @@ -325,6 +345,7 @@ void CHarvesterServer::HarvestFile( const RMessage2& aMessage ) { WRITELOG( "CHarvesterServer::HarvestFile()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_HARVESTFILE, "CHarvesterServer::HarvestFile" ); iHarvesterAO->HarvestFile( aMessage ); } @@ -336,6 +357,7 @@ void CHarvesterServer::HarvestFileWithUID( const RMessage2& aMessage ) { WRITELOG( "CHarvesterServer::HarvestFile()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_HARVESTFILEWITHUID, "CHarvesterServer::HarvestFileWithUID" ); iHarvesterAO->HarvestFileWithUID( aMessage ); } @@ -347,6 +369,7 @@ void CHarvesterServer::RegisterProcessOrigin( const RMessage2& aMessage ) { WRITELOG( "CHarvesterServer::RegisterProcessOrigin()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_REGISTERPROCESSORIGIN, "CHarvesterServer::RegisterProcessOrigin" ); iHarvesterAO->RegisterProcessOrigin( aMessage ); } @@ -358,6 +381,7 @@ void CHarvesterServer::UnregisterProcessOrigin( const RMessage2& aMessage ) { WRITELOG( "CHarvesterServer::UnregisterProcessOrigin()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_UNREGISTERPROCESSORIGIN, "CHarvesterServer::UnregisterProcessOrigin" ); iHarvesterAO->UnregisterProcessOrigin( aMessage ); } @@ -369,6 +393,7 @@ TInt CHarvesterServer::RegisterHarvestComplete( const CHarvesterServerSession& aSession, const RMessage2& aMessage ) { WRITELOG( "CHarvesterServer::RegisterHarvestComplete()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_REGISTERHARVESTCOMPLETE, "CHarvesterServer::RegisterHarvestComplete" ); return iHarvesterAO->RegisterHarvestComplete( aSession, aMessage ); } @@ -380,6 +405,7 @@ TInt CHarvesterServer::UnregisterHarvestComplete( const CHarvesterServerSession& aSession ) { WRITELOG( "CHarvesterServer::UnregisterHarvestComplete()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_UNREGISTERHARVESTCOMPLETE, "CHarvesterServer::UnregisterHarvestComplete" ); return iHarvesterAO->UnregisterHarvestComplete( aSession ); } @@ -391,6 +417,7 @@ void CHarvesterServer::RegisterHarvesterEvent( const RMessage2& aMessage ) { WRITELOG( "CHarvesterServer::RegisterHarvesterEvent()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_REGISTERHARVESTEREVENT, "CHarvesterServer::RegisterHarvesterEvent" ); iHarvesterAO->RegisterHarvesterEvent( aMessage ); } @@ -402,6 +429,7 @@ void CHarvesterServer::UnregisterHarvesterEvent( const RMessage2& aMessage ) { WRITELOG( "CHarvesterServer::UnregisterHarvesterEvent()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_UNREGISTERHARVESTEREVENT, "CHarvesterServer::UnregisterHarvesterEvent" ); iHarvesterAO->UnregisterHarvesterEvent( aMessage ); } @@ -413,9 +441,13 @@ CHarvesterServer::~CHarvesterServer() { WRITELOG( "CHarvesterServer::~CHarvesterServer()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_CHARVESTERSERVER, "CHarvesterServer::~CHarvesterServer" ); + delete iHarvesterAO; delete iPauseObserverAO; delete iShutdownObserver; + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERSERVER_CHARVESTERSERVER, "CHarvesterServer::~CHarvesterServer end" ); + WRITELOG( "CHarvesterServer::~CHarvesterServer() end" ); } @@ -427,6 +459,7 @@ const TDesC& aPanicDescription ) { WRITELOG( "CHarvesterServer::PanicClient()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_PANICCLIENT, "CHarvesterServer::PanicClient" ); aMessage.Panic( aPanicDescription, aPanic ); } @@ -438,6 +471,7 @@ void CHarvesterServer::PanicServer( TInt aPanic, const TDesC& aPanicDescription ) { WRITELOG( "CHarvesterServer::PanicServer() - begin" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_PANICSERVER, "CHarvesterServer::PanicServer" ); User::Panic( aPanicDescription, aPanic ); } @@ -450,7 +484,8 @@ const TVersion& aVersion, const RMessage2& ) const { WRITELOG( "CHarvesterServer::NewSessionL() - begin" ); - + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_NEWSESSIONL, "CHarvesterServer::NewSessionL" ); + //If there isn't connection to mde, we can't do much. Inform client about situation. //This doesn't leave on first client because Process::Rendezcvouz is called when mde:s //HandleSessionOpened is called. @@ -462,6 +497,8 @@ if ( iShutdownObserver->UpdateInProgress() ) { WRITELOG( "CHarvesterServer::NewSessionL - iad update in progress: KErrLocked"); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERSERVER_NEWSESSIONL, "CHarvesterServer::NewSessionL- iad update in progress: KErrLocked" ); + User::Leave(KErrLocked); } @@ -485,7 +522,8 @@ TInt CHarvesterServer::RunError( TInt aError ) { WRITELOG1( "CHarvesterServer::RunError - %d()", aError ); - + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_RUNERROR, "CHarvesterServer::RunError" ); + if ( aError == KErrBadDescriptor ) { // A bad descriptor error implies a badly programmed client, @@ -512,6 +550,7 @@ void CHarvesterServer::ThreadFunctionL() { WRITELOG( "CHarvesterServer::ThreadFunctionL() - begin" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_THREADFUNCTIONL, "CHarvesterServer::ThreadFunctionL - begin" ); User::LeaveIfError( User::RenameThread( KHarvesterServerName ) ); // Construct active scheduler @@ -532,6 +571,8 @@ CleanupStack::PopAndDestroy( 2, activeScheduler ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERSERVER_THREADFUNCTIONL, "CHarvesterServer::ThreadFunctionL - end" ); + WRITELOG( "CHarvesterServer::ThreadFunctionL() - end" ); } @@ -542,6 +583,7 @@ TInt CHarvesterServer::ThreadFunction( TAny* /*aNone*/ ) { WRITELOG( "CHarvesterServer::ThreadFunction() - TAny - begin" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVER_THREADFUNCTION, "CHarvesterServer::ThreadFunction - TAny - begin" ); CTrapCleanup* cleanupStack = CTrapCleanup::New(); if ( !cleanupStack ) @@ -556,6 +598,8 @@ delete cleanupStack; cleanupStack = NULL; } + + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERSERVER_THREADFUNCTION, "CHarvesterServer::ThreadFunction - TAny - end" ); WRITELOG( "CHarvesterServer::ThreadFunction() - TAny - end" ); return err; @@ -568,7 +612,8 @@ TInt E32Main() { WRITELOG( "CHarvesterServer::E32Main() - begin" ); - + OstTrace0( TRACE_NORMAL, _E32MAIN, "CHarvesterServer::E32Main() - begin" ); + __UHEAP_MARK; const TInt result = CHarvesterServer::ThreadFunction( NULL ); diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/server/src/harvesterserversession.cpp --- a/harvester/server/src/harvesterserversession.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/harvester/server/src/harvesterserversession.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -18,6 +18,10 @@ #include "harvesterserversession.h" #include "harvestercommon.h" #include "harvesterlog.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "harvesterserversessionTraces.h" +#endif // ========================= MEMBER FUNCTIONS ================================== @@ -28,6 +32,7 @@ CHarvesterServerSession* CHarvesterServerSession::NewL( CHarvesterServer& aServer ) { WRITELOG( "CHarvesterServerSession::NewL()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVERSESSION_NEWL, "CHarvesterServerSession::NewL" ); CHarvesterServerSession* self = CHarvesterServerSession::NewLC( aServer ); CleanupStack::Pop( self ); @@ -41,6 +46,7 @@ CHarvesterServerSession* CHarvesterServerSession::NewLC( CHarvesterServer& aServer ) { WRITELOG( "CHarvesterServerSession::NewLC()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVERSESSION_NEWLC, "CHarvesterServerSession::NewLC" ); CHarvesterServerSession* self = new ( ELeave ) CHarvesterServerSession( aServer ); CleanupStack::PushL( self ); @@ -55,6 +61,8 @@ void CHarvesterServerSession::ConstructL() { WRITELOG( "CHarvesterServerSession::ConstructL()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVERSESSION_CONSTRUCTL, "CHarvesterServerSession::ConstructL" ); + } // --------------------------------------------------------------------------- @@ -65,6 +73,8 @@ : iServer( aServer ) { WRITELOG( "CHarvesterServerSession::CHarvesterServerSession()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION, "CHarvesterServerSession::CHarvesterServerSession" ); + } // --------------------------------------------------------------------------- @@ -74,6 +84,8 @@ CHarvesterServerSession::~CHarvesterServerSession() { WRITELOG( "CHarvesterServerSession::~CHarvesterServerSession()" ); + OstTrace0( TRACE_NORMAL, DUP1_CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION, "CHarvesterServerSession::~CHarvesterServerSession" ); + } // --------------------------------------------------------------------------- @@ -83,6 +95,7 @@ void CHarvesterServerSession::ServiceL( const RMessage2& aMessage ) { WRITELOG( "CHarvesterServerSession::ServiceL()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVERSESSION_SERVICEL, "CHarvesterServerSession::ServiceL" ); /* Command can't be negative */ if ( aMessage.Function() < 0 ) @@ -204,6 +217,7 @@ { //just make sure the server is cleaned after client crash WRITELOG( "CHarvesterServerSession::Disconnect()" ); + OstTrace0( TRACE_NORMAL, CHARVESTERSERVERSESSION_DISCONNECT, "CHarvesterServerSession::Disconnect" ); iServer.UnregisterHarvestComplete( *this ); diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/server/traces/OstTraceDefinitions.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/server/traces/OstTraceDefinitions.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,7 @@ +#ifndef __OSTTRACEDEFINITIONS_H__ +#define __OSTTRACEDEFINITIONS_H__ +// OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler +// REMOVE BEFORE CHECK-IN TO VERSION CONTROL +#define OST_TRACE_COMPILER_IN_USE +#include +#endif diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/server/traces/fixed_id.definitions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/server/traces/fixed_id.definitions Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,197 @@ +#Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. +[GROUP]TRACE_NORMAL=0x86 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_BACKUPRESTOREREADY=0x63 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_BACKUPRESTORESTART=0x62 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_BOOTPARTIALRESTORESCANL=0x95 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_BOOTROMSCANL=0x94 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_BOOTSCANL=0x97 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_CHARVESTERAO=0x3 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x26 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_CONSTRUCTL=0x5 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS=0x4b +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x8c +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_DELETECOMPOSERS=0x1f +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_DELETEMONITORPLUGINS=0x9 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_DOCANCEL=0x5a +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_GETLASTOBSERVERID=0x8b +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL=0x64 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HANDLEPLACEHOLDERSL=0x22 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HANDLESESSIONERROR=0x4a +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HANDLESESSIONOPENED=0x3c +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HANDLEUNMOUNT=0x10 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HARVESTCOMPLETED=0x92 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HARVESTFILE=0x67 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HARVESTFILEWITHUID=0x72 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_HARVESTINGCOMPLETED=0x2f +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_ISCOMPOSINGREADY=0x20 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_ISSERVERPAUSED=0x61 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_LOADMONITORPLUGINSL=0x7 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_MEMORYGOOD=0x9e +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_MEMORYLOW=0x9d +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_NEWL=0x2 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_NEWLC=0x1 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_PAUSEHARVESTER=0x4e +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_PAUSEMONITORING=0xd +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_READITEMFROMQUEUEL=0x21 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_REGISTERHARVESTCOMPLETE=0x87 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_REGISTERHARVESTEREVENT=0x89 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_REGISTERPROCESSORIGIN=0x7d +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_RESUMEHARVESTERL=0x50 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_RESUMEMONITORING=0xf +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_RUNERROR=0x5b +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_RUNL=0x51 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_SETNEXTREQUEST=0x60 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_STARTCOMPOSERSL=0x1d +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_STARTMONITORING=0xb +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_STOPCOMPOSERS=0x1e +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_STOPMONITORING=0xc +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_UNREGISTERHARVESTCOMPLETE=0x88 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_UNREGISTERHARVESTEREVENT=0x8a +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERAO_UNREGISTERPROCESSORIGIN=0x83 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION=0xc0 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVERSESSION_CONSTRUCTL=0xbf +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVERSESSION_DISCONNECT=0xc3 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVERSESSION_NEWL=0xbd +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVERSESSION_NEWLC=0xbe +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVERSESSION_SERVICEL=0xc2 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_CHARVESTERSERVER=0xb1 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_CONSTRUCTL=0x9f +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_HARVESTFILE=0xa9 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_HARVESTFILEWITHUID=0xaa +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_NEWSESSIONL=0xb5 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_PANICCLIENT=0xb3 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_PANICSERVER=0xb4 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_PAUSE=0xa1 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_PAUSEREADY=0xa5 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_REGISTERHARVESTCOMPLETE=0xad +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_REGISTERHARVESTEREVENT=0xaf +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_REGISTERPROCESSORIGIN=0xab +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_RESTARTNOTIFICATION=0xa8 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_RESUME=0xa2 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_RESUMEREADY=0xa6 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_RUNERROR=0xb7 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_SHUTDOWNNOTIFICATION=0xa7 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_THREADFUNCTION=0xba +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_THREADFUNCTIONL=0xb8 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_UNREGISTERHARVESTCOMPLETE=0xae +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_UNREGISTERHARVESTEREVENT=0xb0 +[TRACE]TRACE_NORMAL[0x86]_CHARVESTERSERVER_UNREGISTERPROCESSORIGIN=0xac +[TRACE]TRACE_NORMAL[0x86]_DUP10_CHARVESTERAO_HANDLESESSIONOPENED=0x46 +[TRACE]TRACE_NORMAL[0x86]_DUP10_CHARVESTERAO_HANDLEUNMOUNT=0x19 +[TRACE]TRACE_NORMAL[0x86]_DUP10_CHARVESTERAO_HARVESTFILE=0x71 +[TRACE]TRACE_NORMAL[0x86]_DUP10_CHARVESTERAO_HARVESTFILEWITHUID=0x7c +[TRACE]TRACE_NORMAL[0x86]_DUP10_CHARVESTERAO_HARVESTINGCOMPLETED=0x39 +[TRACE]TRACE_NORMAL[0x86]_DUP11_CHARVESTERAO_HANDLESESSIONOPENED=0x47 +[TRACE]TRACE_NORMAL[0x86]_DUP11_CHARVESTERAO_HANDLEUNMOUNT=0x1a +[TRACE]TRACE_NORMAL[0x86]_DUP11_CHARVESTERAO_HARVESTINGCOMPLETED=0x3a +[TRACE]TRACE_NORMAL[0x86]_DUP12_CHARVESTERAO_HANDLESESSIONOPENED=0x48 +[TRACE]TRACE_NORMAL[0x86]_DUP12_CHARVESTERAO_HANDLEUNMOUNT=0x1b +[TRACE]TRACE_NORMAL[0x86]_DUP12_CHARVESTERAO_HARVESTINGCOMPLETED=0x3b +[TRACE]TRACE_NORMAL[0x86]_DUP13_CHARVESTERAO_HANDLESESSIONOPENED=0x49 +[TRACE]TRACE_NORMAL[0x86]_DUP13_CHARVESTERAO_HANDLEUNMOUNT=0x1c +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_BOOTPARTIALRESTORESCANL=0x96 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_BOOTSCANL=0x98 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_CHARVESTERAO=0x4 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x27 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_CONSTRUCTL=0x6 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS=0x4c +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x8d +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_DELETEMONITORPLUGINS=0xa +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL=0x65 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HANDLEPLACEHOLDERSL=0x23 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HANDLESESSIONOPENED=0x3d +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HANDLEUNMOUNT=0x11 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HARVESTCOMPLETED=0x93 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HARVESTFILE=0x68 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HARVESTFILEWITHUID=0x73 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_HARVESTINGCOMPLETED=0x38 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_LOADMONITORPLUGINSL=0x8 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_PAUSEHARVESTER=0x4f +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_PAUSEMONITORING=0xe +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_REGISTERPROCESSORIGIN=0x7e +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_RUNERROR=0x5c +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_RUNL=0x52 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERAO_UNREGISTERPROCESSORIGIN=0x84 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION=0xc1 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_CHARVESTERSERVER=0xb2 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_CONSTRUCTL=0xa0 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_NEWSESSIONL=0xb6 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_PAUSE=0xa3 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_RESUME=0xa4 +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_THREADFUNCTION=0xbb +[TRACE]TRACE_NORMAL[0x86]_DUP1_CHARVESTERSERVER_THREADFUNCTIONL=0xb9 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_BOOTSCANL=0x99 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x28 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS=0x4d +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x8e +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL=0x66 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HANDLEPLACEHOLDERSL=0x24 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HANDLESESSIONOPENED=0x3e +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HANDLEUNMOUNT=0x12 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HARVESTFILE=0x69 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HARVESTFILEWITHUID=0x74 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_HARVESTINGCOMPLETED=0x30 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_REGISTERPROCESSORIGIN=0x7f +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_RUNERROR=0x5d +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_RUNL=0x53 +[TRACE]TRACE_NORMAL[0x86]_DUP2_CHARVESTERAO_UNREGISTERPROCESSORIGIN=0x85 +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_BOOTSCANL=0x9a +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x29 +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x8f +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_HANDLEPLACEHOLDERSL=0x25 +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_HANDLESESSIONOPENED=0x3f +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_HANDLEUNMOUNT=0x13 +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_HARVESTFILE=0x6a +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_HARVESTFILEWITHUID=0x75 +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_HARVESTINGCOMPLETED=0x31 +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_REGISTERPROCESSORIGIN=0x80 +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_RUNERROR=0x5e +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_RUNL=0x54 +[TRACE]TRACE_NORMAL[0x86]_DUP3_CHARVESTERAO_UNREGISTERPROCESSORIGIN=0x86 +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_BOOTSCANL=0x9b +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2a +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x90 +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_HANDLESESSIONOPENED=0x40 +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_HANDLEUNMOUNT=0x14 +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_HARVESTFILE=0x6b +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_HARVESTFILEWITHUID=0x76 +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_HARVESTINGCOMPLETED=0x32 +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_REGISTERPROCESSORIGIN=0x81 +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_RUNERROR=0x5f +[TRACE]TRACE_NORMAL[0x86]_DUP4_CHARVESTERAO_RUNL=0x55 +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_BOOTSCANL=0x9c +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2b +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS=0x91 +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_HANDLESESSIONOPENED=0x41 +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_HANDLEUNMOUNT=0x15 +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_HARVESTFILE=0x6c +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_HARVESTFILEWITHUID=0x77 +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_HARVESTINGCOMPLETED=0x33 +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_REGISTERPROCESSORIGIN=0x82 +[TRACE]TRACE_NORMAL[0x86]_DUP5_CHARVESTERAO_RUNL=0x56 +[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2c +[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_HANDLESESSIONOPENED=0x42 +[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_HANDLEUNMOUNT=0x16 +[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_HARVESTFILE=0x6d +[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_HARVESTFILEWITHUID=0x78 +[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_HARVESTINGCOMPLETED=0x34 +[TRACE]TRACE_NORMAL[0x86]_DUP6_CHARVESTERAO_RUNL=0x57 +[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2d +[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_HANDLESESSIONOPENED=0x43 +[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_HANDLEUNMOUNT=0x17 +[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_HARVESTFILE=0x6e +[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_HARVESTFILEWITHUID=0x79 +[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_HARVESTINGCOMPLETED=0x35 +[TRACE]TRACE_NORMAL[0x86]_DUP7_CHARVESTERAO_RUNL=0x58 +[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL=0x2e +[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_HANDLESESSIONOPENED=0x44 +[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_HANDLEUNMOUNT=0x18 +[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_HARVESTFILE=0x6f +[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_HARVESTFILEWITHUID=0x7a +[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_HARVESTINGCOMPLETED=0x36 +[TRACE]TRACE_NORMAL[0x86]_DUP8_CHARVESTERAO_RUNL=0x59 +[TRACE]TRACE_NORMAL[0x86]_DUP9_CHARVESTERAO_HANDLESESSIONOPENED=0x45 +[TRACE]TRACE_NORMAL[0x86]_DUP9_CHARVESTERAO_HARVESTFILE=0x70 +[TRACE]TRACE_NORMAL[0x86]_DUP9_CHARVESTERAO_HARVESTFILEWITHUID=0x7b +[TRACE]TRACE_NORMAL[0x86]_DUP9_CHARVESTERAO_HARVESTINGCOMPLETED=0x37 +[TRACE]TRACE_NORMAL[0x86]__E32MAIN=0xbc diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/server/traces/harvesteraoTraces.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/server/traces/harvesteraoTraces.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,172 @@ +// Created by TraceCompiler 2.2.3 +// DO NOT EDIT, CHANGES WILL BE LOST + +#ifndef __HARVESTERAOTRACES_H__ +#define __HARVESTERAOTRACES_H__ + +#define KOstTraceComponentID 0x200009f5 + +#define CHARVESTERAO_NEWLC 0x860001 +#define CHARVESTERAO_NEWL 0x860002 +#define CHARVESTERAO_CHARVESTERAO 0x860003 +#define DUP1_CHARVESTERAO_CHARVESTERAO 0x860004 +#define CHARVESTERAO_CONSTRUCTL 0x860005 +#define DUP1_CHARVESTERAO_CONSTRUCTL 0x860006 +#define CHARVESTERAO_LOADMONITORPLUGINSL 0x860007 +#define DUP1_CHARVESTERAO_LOADMONITORPLUGINSL 0x860008 +#define CHARVESTERAO_DELETEMONITORPLUGINS 0x860009 +#define DUP1_CHARVESTERAO_DELETEMONITORPLUGINS 0x86000a +#define CHARVESTERAO_STARTMONITORING 0x86000b +#define CHARVESTERAO_STOPMONITORING 0x86000c +#define CHARVESTERAO_PAUSEMONITORING 0x86000d +#define DUP1_CHARVESTERAO_PAUSEMONITORING 0x86000e +#define CHARVESTERAO_RESUMEMONITORING 0x86000f +#define CHARVESTERAO_HANDLEUNMOUNT 0x860010 +#define DUP1_CHARVESTERAO_HANDLEUNMOUNT 0x860011 +#define DUP2_CHARVESTERAO_HANDLEUNMOUNT 0x860012 +#define DUP3_CHARVESTERAO_HANDLEUNMOUNT 0x860013 +#define DUP4_CHARVESTERAO_HANDLEUNMOUNT 0x860014 +#define DUP5_CHARVESTERAO_HANDLEUNMOUNT 0x860015 +#define DUP6_CHARVESTERAO_HANDLEUNMOUNT 0x860016 +#define DUP7_CHARVESTERAO_HANDLEUNMOUNT 0x860017 +#define DUP8_CHARVESTERAO_HANDLEUNMOUNT 0x860018 +#define DUP10_CHARVESTERAO_HANDLEUNMOUNT 0x860019 +#define DUP11_CHARVESTERAO_HANDLEUNMOUNT 0x86001a +#define DUP12_CHARVESTERAO_HANDLEUNMOUNT 0x86001b +#define DUP13_CHARVESTERAO_HANDLEUNMOUNT 0x86001c +#define CHARVESTERAO_STARTCOMPOSERSL 0x86001d +#define CHARVESTERAO_STOPCOMPOSERS 0x86001e +#define CHARVESTERAO_DELETECOMPOSERS 0x86001f +#define CHARVESTERAO_ISCOMPOSINGREADY 0x860020 +#define CHARVESTERAO_READITEMFROMQUEUEL 0x860021 +#define CHARVESTERAO_HANDLEPLACEHOLDERSL 0x860022 +#define DUP1_CHARVESTERAO_HANDLEPLACEHOLDERSL 0x860023 +#define DUP2_CHARVESTERAO_HANDLEPLACEHOLDERSL 0x860024 +#define DUP3_CHARVESTERAO_HANDLEPLACEHOLDERSL 0x860025 +#define CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x860026 +#define DUP1_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x860027 +#define DUP2_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x860028 +#define DUP3_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x860029 +#define DUP4_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x86002a +#define DUP5_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x86002b +#define DUP6_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x86002c +#define DUP7_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x86002d +#define DUP8_CHARVESTERAO_CHECKFILEEXTENSIONANDHARVESTL 0x86002e +#define CHARVESTERAO_HARVESTINGCOMPLETED 0x86002f +#define DUP2_CHARVESTERAO_HARVESTINGCOMPLETED 0x860030 +#define DUP3_CHARVESTERAO_HARVESTINGCOMPLETED 0x860031 +#define DUP4_CHARVESTERAO_HARVESTINGCOMPLETED 0x860032 +#define DUP5_CHARVESTERAO_HARVESTINGCOMPLETED 0x860033 +#define DUP6_CHARVESTERAO_HARVESTINGCOMPLETED 0x860034 +#define DUP7_CHARVESTERAO_HARVESTINGCOMPLETED 0x860035 +#define DUP8_CHARVESTERAO_HARVESTINGCOMPLETED 0x860036 +#define DUP9_CHARVESTERAO_HARVESTINGCOMPLETED 0x860037 +#define DUP1_CHARVESTERAO_HARVESTINGCOMPLETED 0x860038 +#define DUP10_CHARVESTERAO_HARVESTINGCOMPLETED 0x860039 +#define DUP11_CHARVESTERAO_HARVESTINGCOMPLETED 0x86003a +#define DUP12_CHARVESTERAO_HARVESTINGCOMPLETED 0x86003b +#define CHARVESTERAO_HANDLESESSIONOPENED 0x86003c +#define DUP1_CHARVESTERAO_HANDLESESSIONOPENED 0x86003d +#define DUP2_CHARVESTERAO_HANDLESESSIONOPENED 0x86003e +#define DUP3_CHARVESTERAO_HANDLESESSIONOPENED 0x86003f +#define DUP4_CHARVESTERAO_HANDLESESSIONOPENED 0x860040 +#define DUP5_CHARVESTERAO_HANDLESESSIONOPENED 0x860041 +#define DUP6_CHARVESTERAO_HANDLESESSIONOPENED 0x860042 +#define DUP7_CHARVESTERAO_HANDLESESSIONOPENED 0x860043 +#define DUP8_CHARVESTERAO_HANDLESESSIONOPENED 0x860044 +#define DUP9_CHARVESTERAO_HANDLESESSIONOPENED 0x860045 +#define DUP10_CHARVESTERAO_HANDLESESSIONOPENED 0x860046 +#define DUP11_CHARVESTERAO_HANDLESESSIONOPENED 0x860047 +#define DUP12_CHARVESTERAO_HANDLESESSIONOPENED 0x860048 +#define DUP13_CHARVESTERAO_HANDLESESSIONOPENED 0x860049 +#define CHARVESTERAO_HANDLESESSIONERROR 0x86004a +#define CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS 0x86004b +#define DUP1_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS 0x86004c +#define DUP2_CHARVESTERAO_CONTEXTINITIALIZATIONSTATUS 0x86004d +#define CHARVESTERAO_PAUSEHARVESTER 0x86004e +#define DUP1_CHARVESTERAO_PAUSEHARVESTER 0x86004f +#define CHARVESTERAO_RESUMEHARVESTERL 0x860050 +#define CHARVESTERAO_RUNL 0x860051 +#define DUP1_CHARVESTERAO_RUNL 0x860052 +#define DUP2_CHARVESTERAO_RUNL 0x860053 +#define DUP3_CHARVESTERAO_RUNL 0x860054 +#define DUP4_CHARVESTERAO_RUNL 0x860055 +#define DUP5_CHARVESTERAO_RUNL 0x860056 +#define DUP6_CHARVESTERAO_RUNL 0x860057 +#define DUP7_CHARVESTERAO_RUNL 0x860058 +#define DUP8_CHARVESTERAO_RUNL 0x860059 +#define CHARVESTERAO_DOCANCEL 0x86005a +#define CHARVESTERAO_RUNERROR 0x86005b +#define DUP1_CHARVESTERAO_RUNERROR 0x86005c +#define DUP2_CHARVESTERAO_RUNERROR 0x86005d +#define DUP3_CHARVESTERAO_RUNERROR 0x86005e +#define DUP4_CHARVESTERAO_RUNERROR 0x86005f +#define CHARVESTERAO_SETNEXTREQUEST 0x860060 +#define CHARVESTERAO_ISSERVERPAUSED 0x860061 +#define CHARVESTERAO_BACKUPRESTORESTART 0x860062 +#define CHARVESTERAO_BACKUPRESTOREREADY 0x860063 +#define CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL 0x860064 +#define DUP1_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL 0x860065 +#define DUP2_CHARVESTERAO_HANDLEDISKSPACENOTIFICATIONL 0x860066 +#define CHARVESTERAO_HARVESTFILE 0x860067 +#define DUP1_CHARVESTERAO_HARVESTFILE 0x860068 +#define DUP2_CHARVESTERAO_HARVESTFILE 0x860069 +#define DUP3_CHARVESTERAO_HARVESTFILE 0x86006a +#define DUP4_CHARVESTERAO_HARVESTFILE 0x86006b +#define DUP5_CHARVESTERAO_HARVESTFILE 0x86006c +#define DUP6_CHARVESTERAO_HARVESTFILE 0x86006d +#define DUP7_CHARVESTERAO_HARVESTFILE 0x86006e +#define DUP8_CHARVESTERAO_HARVESTFILE 0x86006f +#define DUP9_CHARVESTERAO_HARVESTFILE 0x860070 +#define DUP10_CHARVESTERAO_HARVESTFILE 0x860071 +#define CHARVESTERAO_HARVESTFILEWITHUID 0x860072 +#define DUP1_CHARVESTERAO_HARVESTFILEWITHUID 0x860073 +#define DUP2_CHARVESTERAO_HARVESTFILEWITHUID 0x860074 +#define DUP3_CHARVESTERAO_HARVESTFILEWITHUID 0x860075 +#define DUP4_CHARVESTERAO_HARVESTFILEWITHUID 0x860076 +#define DUP5_CHARVESTERAO_HARVESTFILEWITHUID 0x860077 +#define DUP6_CHARVESTERAO_HARVESTFILEWITHUID 0x860078 +#define DUP7_CHARVESTERAO_HARVESTFILEWITHUID 0x860079 +#define DUP8_CHARVESTERAO_HARVESTFILEWITHUID 0x86007a +#define DUP9_CHARVESTERAO_HARVESTFILEWITHUID 0x86007b +#define DUP10_CHARVESTERAO_HARVESTFILEWITHUID 0x86007c +#define CHARVESTERAO_REGISTERPROCESSORIGIN 0x86007d +#define DUP1_CHARVESTERAO_REGISTERPROCESSORIGIN 0x86007e +#define DUP2_CHARVESTERAO_REGISTERPROCESSORIGIN 0x86007f +#define DUP3_CHARVESTERAO_REGISTERPROCESSORIGIN 0x860080 +#define DUP4_CHARVESTERAO_REGISTERPROCESSORIGIN 0x860081 +#define DUP5_CHARVESTERAO_REGISTERPROCESSORIGIN 0x860082 +#define CHARVESTERAO_UNREGISTERPROCESSORIGIN 0x860083 +#define DUP1_CHARVESTERAO_UNREGISTERPROCESSORIGIN 0x860084 +#define DUP2_CHARVESTERAO_UNREGISTERPROCESSORIGIN 0x860085 +#define DUP3_CHARVESTERAO_UNREGISTERPROCESSORIGIN 0x860086 +#define CHARVESTERAO_REGISTERHARVESTCOMPLETE 0x860087 +#define CHARVESTERAO_UNREGISTERHARVESTCOMPLETE 0x860088 +#define CHARVESTERAO_REGISTERHARVESTEREVENT 0x860089 +#define CHARVESTERAO_UNREGISTERHARVESTEREVENT 0x86008a +#define CHARVESTERAO_GETLASTOBSERVERID 0x86008b +#define CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x86008c +#define DUP1_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x86008d +#define DUP2_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x86008e +#define DUP3_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x86008f +#define DUP4_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x860090 +#define DUP5_CHARVESTERAO_CONTEXTSNAPSHOTSTATUS 0x860091 +#define CHARVESTERAO_HARVESTCOMPLETED 0x860092 +#define DUP1_CHARVESTERAO_HARVESTCOMPLETED 0x860093 +#define CHARVESTERAO_BOOTROMSCANL 0x860094 +#define CHARVESTERAO_BOOTPARTIALRESTORESCANL 0x860095 +#define DUP1_CHARVESTERAO_BOOTPARTIALRESTORESCANL 0x860096 +#define CHARVESTERAO_BOOTSCANL 0x860097 +#define DUP1_CHARVESTERAO_BOOTSCANL 0x860098 +#define DUP2_CHARVESTERAO_BOOTSCANL 0x860099 +#define DUP3_CHARVESTERAO_BOOTSCANL 0x86009a +#define DUP4_CHARVESTERAO_BOOTSCANL 0x86009b +#define DUP5_CHARVESTERAO_BOOTSCANL 0x86009c +#define CHARVESTERAO_MEMORYLOW 0x86009d +#define CHARVESTERAO_MEMORYGOOD 0x86009e + + +#endif + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/server/traces/harvesterserverTraces.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/server/traces/harvesterserverTraces.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,44 @@ +// Created by TraceCompiler 2.2.3 +// DO NOT EDIT, CHANGES WILL BE LOST + +#ifndef __HARVESTERSERVERTRACES_H__ +#define __HARVESTERSERVERTRACES_H__ + +#define KOstTraceComponentID 0x200009f5 + +#define CHARVESTERSERVER_CONSTRUCTL 0x86009f +#define DUP1_CHARVESTERSERVER_CONSTRUCTL 0x8600a0 +#define CHARVESTERSERVER_PAUSE 0x8600a1 +#define CHARVESTERSERVER_RESUME 0x8600a2 +#define DUP1_CHARVESTERSERVER_PAUSE 0x8600a3 +#define DUP1_CHARVESTERSERVER_RESUME 0x8600a4 +#define CHARVESTERSERVER_PAUSEREADY 0x8600a5 +#define CHARVESTERSERVER_RESUMEREADY 0x8600a6 +#define CHARVESTERSERVER_SHUTDOWNNOTIFICATION 0x8600a7 +#define CHARVESTERSERVER_RESTARTNOTIFICATION 0x8600a8 +#define CHARVESTERSERVER_HARVESTFILE 0x8600a9 +#define CHARVESTERSERVER_HARVESTFILEWITHUID 0x8600aa +#define CHARVESTERSERVER_REGISTERPROCESSORIGIN 0x8600ab +#define CHARVESTERSERVER_UNREGISTERPROCESSORIGIN 0x8600ac +#define CHARVESTERSERVER_REGISTERHARVESTCOMPLETE 0x8600ad +#define CHARVESTERSERVER_UNREGISTERHARVESTCOMPLETE 0x8600ae +#define CHARVESTERSERVER_REGISTERHARVESTEREVENT 0x8600af +#define CHARVESTERSERVER_UNREGISTERHARVESTEREVENT 0x8600b0 +#define CHARVESTERSERVER_CHARVESTERSERVER 0x8600b1 +#define DUP1_CHARVESTERSERVER_CHARVESTERSERVER 0x8600b2 +#define CHARVESTERSERVER_PANICCLIENT 0x8600b3 +#define CHARVESTERSERVER_PANICSERVER 0x8600b4 +#define CHARVESTERSERVER_NEWSESSIONL 0x8600b5 +#define DUP1_CHARVESTERSERVER_NEWSESSIONL 0x8600b6 +#define CHARVESTERSERVER_RUNERROR 0x8600b7 +#define CHARVESTERSERVER_THREADFUNCTIONL 0x8600b8 +#define DUP1_CHARVESTERSERVER_THREADFUNCTIONL 0x8600b9 +#define CHARVESTERSERVER_THREADFUNCTION 0x8600ba +#define DUP1_CHARVESTERSERVER_THREADFUNCTION 0x8600bb +#define _E32MAIN 0x8600bc + + +#endif + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 harvester/server/traces/harvesterserversessionTraces.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/harvester/server/traces/harvesterserversessionTraces.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,21 @@ +// Created by TraceCompiler 2.2.3 +// DO NOT EDIT, CHANGES WILL BE LOST + +#ifndef __HARVESTERSERVERSESSIONTRACES_H__ +#define __HARVESTERSERVERSESSIONTRACES_H__ + +#define KOstTraceComponentID 0x200009f5 + +#define CHARVESTERSERVERSESSION_NEWL 0x8600bd +#define CHARVESTERSERVERSESSION_NEWLC 0x8600be +#define CHARVESTERSERVERSESSION_CONSTRUCTL 0x8600bf +#define CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION 0x8600c0 +#define DUP1_CHARVESTERSERVERSESSION_CHARVESTERSERVERSESSION 0x8600c1 +#define CHARVESTERSERVERSESSION_SERVICEL 0x8600c2 +#define CHARVESTERSERVERSESSION_DISCONNECT 0x8600c3 + + +#endif + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 iadstoprestart/group/iadstop.mmp --- a/iadstoprestart/group/iadstop.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/iadstoprestart/group/iadstop.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -24,8 +24,7 @@ UID 0x100039ce 0x20022E94 VENDORID VID_DEFAULT -//CAPABILITY ALL -TCB -CAPABILITY CAP_GENERAL_DLL +CAPABILITY ALL -TCB SOURCEPATH ../src SOURCE iadstop.cpp diff -r bf039b7fe409 -r 3d9988ee47f5 inc/mdcserializationtype.h --- a/inc/mdcserializationtype.h Fri Jun 25 13:56:30 2010 +0100 +++ b/inc/mdcserializationtype.h Thu Jul 22 16:38:01 2010 +0100 @@ -15,13 +15,12 @@ * */ +#ifndef __MDCSERIALIZATIONTYPE_H__ +#define __MDCSERIALIZATIONTYPE_H__ + #include "mdscommoninternal.h" #include "mdcserializationbuffer.h" - -#ifndef __MDCSERIALIZATIONTYPE_H__ -#define __MDCSERIALIZATIONTYPE_H__ - NONSHARABLE_CLASS(TMdCSerializationType) { protected: diff -r bf039b7fe409 -r 3d9988ee47f5 inc/mdscommoninternal.h --- a/inc/mdscommoninternal.h Fri Jun 25 13:56:30 2010 +0100 +++ b/inc/mdscommoninternal.h Thu Jul 22 16:38:01 2010 +0100 @@ -31,9 +31,11 @@ _LIT( KMdsDefaultImportFile, "C:\\private\\200009f3\\defaultimportfile.mde" ); _LIT( KMdsDefaultRomImportFile, "Z:\\private\\200009f3\\defaultimportfile.mde" ); +// Universal image folder +_LIT( KDCIMFolder, ":\\DCIM"); + // schema file version -const TInt KSchemaFileMajorVersion = 2; -const TInt KSchemaFileMinorVersion = 0; +const TInt KSchemaFileMajorVersion = 3; const TDefId KDefaultNamespaceDefId = 1; @@ -48,6 +50,8 @@ const TInt KMaxTitleFieldLength = 255; +const TInt KTriggerDbMaintenanceTreasholdValue( 2500 ); + _LIT( KMdSServerName,"!MdSServer" ); // Server name _LIT( KMdSServerProcessString,"!MdSServer*" ); _LIT( KSchemaChunkName, "MdSSchema" ); diff -r bf039b7fe409 -r 3d9988ee47f5 inc/mdssqliteconnection.h --- a/inc/mdssqliteconnection.h Fri Jun 25 13:56:30 2010 +0100 +++ b/inc/mdssqliteconnection.h Thu Jul 22 16:38:01 2010 +0100 @@ -175,6 +175,8 @@ void EnableTransaction( TBool aEnable, RMdsStatement& aQuery ); + void DoAnalyzeL(); + protected: // Personal methods /** diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeoCoderPlugin/data/2002DD11.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeoCoderPlugin/data/2002DD11.rss Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 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: Resource file used to register ecom dll's with registry. +* +*/ + +#include + +RESOURCE REGISTRY_INFO theInfo + { + // UID for the DLL + dll_uid = 0x2002DD11; + + // Declare array of interface info + interfaces = + { + INTERFACE_INFO + { + // UID of interface that is implemented + interface_uid = 0x2002DD13; + implementations = + { + // Info for Reverse GeoCoder + IMPLEMENTATION_INFO + { + implementation_uid = 0x2002DD12; + version_no = 1; + display_name = "Reverse GeoCoder"; + default_data = ""; + opaque_data = ""; + } + }; + } + }; + } + +//End of File diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeoCoderPlugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeoCoderPlugin/group/bld.inf Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 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 provides the information required for building the plugin +* +*/ + +PRJ_PLATFORMS + + +PRJ_EXPORTS + + +PRJ_MMPFILES +reversegeocoderplugin.mmp + + + +//End of File diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeoCoderPlugin/group/reversegeocoderplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeoCoderPlugin/group/reversegeocoderplugin.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 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: Project file for ECom ReverseGeoCoderPlugin plug-in +* +*/ + +#include +#include + +TARGET reversegeocoderplugin.dll +TARGETTYPE PLUGIN + +// ECom Dll recognition UID followed by the unique UID for this dll +UID 0x10009D8D 0x2002DD11 +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ..\src +SOURCE proxy.cpp +SOURCE reversegeocoderplugin.cpp + + +USERINCLUDE ..\inc +USERINCLUDE ..\..\inc +USERINCLUDE ..\..\..\inc +USERINCLUDE ..\..\ReverseGeocode\inc + + +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/stdapis + + +SOURCEPATH ../data +START RESOURCE 2002DD11.RSS +TARGET reversegeocoderplugin.rsc +END + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY reversegeocode.lib +LIBRARY libc.lib + +PAGED +BYTEPAIRCOMPRESSTARGET +OPTION ARMCC -O3 -OTime + +//End of File + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeoCoderPlugin/inc/reversegeocoderplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeoCoderPlugin/inc/reversegeocoderplugin.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2009 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: The header file for ReverseGeoCoderPlugin that creates the ReverseGeocoder +* +*/ + + +#ifndef __REVERSEGEOCODERPLUGIN_H__ +#define __REVERSEGEOCODERPLUGIN_H__ + +// INCLUDES +#include + +#include "reversegeocode.h" + +/** + * CReverseGeoCoderPlugin + * + * An implementation of the CReverseGeoCoderPlugin definition. + * Encapsulates the reverse goecoding functionality + * This is concrete class, instance of which + * ECOM framework gives to ECOM clients. + */ +class CReverseGeoCoderPlugin : public CBase + { +public: + + /** + * Create instance of concrete implementation. + * @return: Instance of this class. + */ + static CReverseGeoCoderPlugin* NewL(); + + /** + * Static constructor. + * @return: Instance of this class. + */ + static CReverseGeoCoderPlugin* NewLC(); + + /** + * Destructor. + */ + ~CReverseGeoCoderPlugin(); + + +protected: + + /** + * The default constructor + * Perform the first phase of two phase construction + */ + CReverseGeoCoderPlugin(); + + /** + * Perform the second phase construction of a + * CImplementationClassPlus object. + */ + void ConstructL(); + +public: + + /** + * Creates the instance of Reverse Geocoder + * + */ + void CreateReverseGeoCoderL(); + + /** + * Initializes the ReverseGeoCodeObserver + * @param: aObserver The observer class instance that is to be notified when reverse geocoding completes + * + */ + virtual void AddObserverL(MReverseGeocodeObserver& aObserver); + + /** + * A wrapper API to fetch the address from geocoordinates + * Internally calls the ReverseGeoCoder + * @param aLocality A TLocality object that contains the geocoordinate information + * @param aOption Indicates if the connection is silent connection or not + * + */ + virtual void GetAddressByCoordinateL( TLocality aLocality,const TConnectionOption aOption ); + + /** + * Wrapper API to check if the ReverseGeoCoder allows a silent connection + * @return:TBool Indicates if a silent connection is allowed + * + */ + virtual TBool SilentConnectionAllowed(); + +private: + + /** + * iRevGeocoder + * An instance of the CReverseGeocode class to fetch the place name from geocoordinates + */ + CReverseGeocode *iRevGeocoder; + + /* + * iObserver + * An instance of the class that is to be notified once Reverse Geocoding is completed + */ + MReverseGeocodeObserver* iObserver; + /** + * iDtorKey + * Identification of the plugin on cleanup + */ + TUid iDtorKey; + + }; + + +#endif //__REVERSEGEOCODERPLUGIN_H__ + +//End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeoCoderPlugin/src/proxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeoCoderPlugin/src/proxy.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 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 is the standard proxy for the ECOM plugin +* +*/ + + +// INCLUDE FILES +#include +#include + +#include "reversegeocoderplugin.h" + + +// ---------------------------------------------------------------------------- +// Provides a key value pair table, this is used to identify +// the correct construction function for the requested interface. +// ---------------------------------------------------------------------------- +// + +const TImplementationProxy ImplementationTable[] = + { + IMPLEMENTATION_PROXY_ENTRY(0x2002DD12, CReverseGeoCoderPlugin::NewL) + }; + +// ---------------------------------------------------------------------------- +// ImplementationGroupProxy +// Function used to return an instance of the proxy table. +// ---------------------------------------------------------------------------- + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; + } + +//End of File diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeoCoderPlugin/src/reversegeocoderplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeoCoderPlugin/src/reversegeocoderplugin.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 2009 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: The source file for ReverseGeoCoderPlugin that creates the ReverseGeocoder +* +*/ + +// INCLUDE FILES +#include +#include + + +#include "reversegeocoderplugin.h" +#include "reversegeocode.h" +#include "geotagger.h" +#include "locationmanagerdebug.h" + + +// ---------------------------------------------------------------------------- +// CReverseGeoCoderPlugin::NewL +// Create instance of concrete ECOM interface implementation +// ---------------------------------------------------------------------------- +// +CReverseGeoCoderPlugin* CReverseGeoCoderPlugin::NewL() + { + LOG( "CReverseGeoCoderPlugin::NewL" ); + CReverseGeoCoderPlugin* self = CReverseGeoCoderPlugin::NewLC(); + CleanupStack::Pop(self); + return self; + } + + +// ---------------------------------------------------------------------------- +// CReverseGeoCoderPlugin::NewLC +// Create instance of concrete ECOM interface implementation +// ---------------------------------------------------------------------------- +// +CReverseGeoCoderPlugin* CReverseGeoCoderPlugin::NewLC() + { + LOG( "CReverseGeoCoderPlugin::NewLC" ); + CReverseGeoCoderPlugin* self = new (ELeave) CReverseGeoCoderPlugin; + CleanupStack::PushL (self); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// CReverseGeoCoderPlugin::CReverseGeoCoderPlugin() +// The default constructor +// ---------------------------------------------------------------------------- +// +CReverseGeoCoderPlugin::CReverseGeoCoderPlugin() + : iRevGeocoder(NULL), + iObserver(NULL) + { + } + +// ---------------------------------------------------------------------------- +// CReverseGeoCoderPlugin::ConstructL +// Second phase construction. +// ---------------------------------------------------------------------------- +// +void CReverseGeoCoderPlugin::ConstructL() + { + LOG( "CReverseGeoCoderPlugin::ConstructL" ); + } + +// ---------------------------------------------------------------------------- +// CReverseGeoCoderPlugin::~CReverseGeoCoderPlugin +// Destructor +// ---------------------------------------------------------------------------- +// +CReverseGeoCoderPlugin::~CReverseGeoCoderPlugin() + { + LOG( "CReverseGeoCoderPlugin::~CReverseGeoCoderPlugin,begin" ); + delete iRevGeocoder; + iObserver = NULL; + LOG( "CReverseGeoCoderPlugin::~CReverseGeoCoderPlugin,end" ); + } + +// ---------------------------------------------------------------------------- +// CReverseGeoCoderPlugin::CreateReverseGeoCoderL +// Creates an instance of the ReverseGeoCoder +// ---------------------------------------------------------------------------- +// +void CReverseGeoCoderPlugin::CreateReverseGeoCoderL() + { + LOG( "CReverseGeoCoderPlugin::CreateReverseGeoCoderL,begin" ); + if(iObserver) + { + iRevGeocoder = CReverseGeocode::NewL(*iObserver); + } + LOG( "CReverseGeoCoderPlugin::CreateReverseGeoCoderL,end" ); + } + +// ---------------------------------------------------------------------------- +// CReverseGeoCoderPlugin::AddObserverL +// Initializes the ReverseGeoCodeObserver +// ---------------------------------------------------------------------------- +// +void CReverseGeoCoderPlugin::AddObserverL(MReverseGeocodeObserver& aObserver) + { + LOG( "CReverseGeoCoderPlugin::AddObserverL,begin" ); + iObserver = &aObserver; + + if(!iRevGeocoder) + { + CreateReverseGeoCoderL(); + } + LOG( "CReverseGeoCoderPlugin::AddObserverL,end" ); + } + + +// ---------------------------------------------------------------------------- +// CReverseGeoCoderPlugin::GetAddressByCoordinateL +// Gets the address for the given geo-coordinaates. +// ---------------------------------------------------------------------------- +// +void CReverseGeoCoderPlugin::GetAddressByCoordinateL( TLocality aLocality, + const TConnectionOption aOption ) + { + LOG( "CReverseGeoCoderPlugin::GetAddressByCoordinateL,begin" ); + if(iRevGeocoder) + { + iRevGeocoder->GetAddressByCoordinateL(aLocality, aOption); + } + LOG( "CReverseGeoCoderPlugin::GetAddressByCoordinateL,end" ); + } + + + // ---------------------------------------------------------------------------- + // CReverseGeoCoderPlugin::SilentConnectionAllowed + // Wrapper API to check if the ReverseGeoCoder allows a silent connection + // ---------------------------------------------------------------------------- + // +TBool CReverseGeoCoderPlugin::SilentConnectionAllowed() + { + LOG( "CReverseGeoCoderPlugin::SilentConnectionAllowed,begin" ); + TBool ret = EFalse; + if(iRevGeocoder) + { + ret = iRevGeocoder->SilentConnectionAllowed(); + } + LOG1( "CReverseGeoCoderPlugin::SilentConnectionAllowed,end ret - %d", ret ); + return ret; + } + + + + //End of File + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/bwincw/reversegeocodewinscw.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/bwincw/reversegeocodewinscw.def Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?NewL@CReverseGeocode@@SAPAV1@AAVMReverseGeocodeObserver@@@Z @ 1 NONAME ; class CReverseGeocode * CReverseGeocode::NewL(class MReverseGeocodeObserver &) + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/eabi/reversegeocodearm.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/eabi/reversegeocodearm.def Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,5 @@ +EXPORTS + _ZN15CReverseGeocode4NewLER23MReverseGeocodeObserver @ 1 NONAME + _ZTI23CConnectionTimerHandler @ 2 NONAME + _ZTV23CConnectionTimerHandler @ 3 NONAME + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/group/bld.inf Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2005-2009 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: Build information file +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +ReverseGeocode.mmp diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/group/reversegeocode.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/group/reversegeocode.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2005-2009 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: Project definition file +* +*/ + +#include +#include + +#if defined(WINSCW) +deffile ../bwincw/reversegeocodewinscw.def +#elif defined(ARMCC) +deffile ../eabi/reversegeocodearm.def +#endif +nostrictdef + +VERSION 10.0 +TARGET reversegeocode.dll +TARGETTYPE dll +UID 0x1000008d 0xEF7E39A4 + +VENDORID VID_DEFAULT +CAPABILITY CAP_GENERAL_DLL + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + + +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/stdapis + +SOURCEPATH ../src + +SOURCE clientengine.cpp +SOURCE xmlhandler.cpp +SOURCE internalreversegeocode.cpp +SOURCE internaladdressinfo.cpp +SOURCE reversegeocode.cpp +SOURCE connectiontimerhandler.cpp + +LIBRARY cone.lib +LIBRARY netmeta.lib +LIBRARY euser.lib +LIBRARY insock.lib +LIBRARY inetprotutil.lib +LIBRARY http.lib +LIBRARY ecom.lib // for HTTP Client API +LIBRARY bafl.lib +LIBRARY commdb.lib +LIBRARY cmmanager.lib // ALR / SNAP +LIBRARY xmlframework.lib +LIBRARY esock.lib +LIBRARY lbs.lib +LIBRARY charconv.lib +LIBRARY extendedconnpref.lib +LIBRARY etel.lib +LIBRARY etelmm.lib +LIBRARY libc.lib + +PAGED +BYTEPAIRCOMPRESSTARGET +OPTION ARMCC -O3 -OTime + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/inc/clientengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/inc/clientengine.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,302 @@ +/* +* Copyright (c) 2006-2009 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: HTTP client engine, which takes of doing an Http GET request for +* the maps server. +*/ + +#ifndef __CLIENTENGINE_H__ +#define __CLIENTENGINE_H__ + +#include +#include +#include +#include +#include +#include +#include + +#include "reversegeocode.h" + +class RHTTPSession; +class RHTTPTransaction; + +const TInt KDefaultBufferSize = 256; + +/* + * Enumration for the different states of HTTP GET request. + */ +enum THttpStatus + { + EHttpSessionError =0, + EHttpExitingApp, + EHttpConnecting, + EHttpTxCancelled, + EHttpHdrReceived, + EHttpBytesReceieved, + EHttpBodyReceieved, + EHttpTxCompleted, + EHttpTxSuccess, + EHttpTxFailed, + EHttpConnectionFailure, + EHttpUnknownEvent, + EHttpMhfRunError, + EHttpAuthNote, + EHttpAuthFailed, + EHttpAuthRequired, + }; + +enum TMobileRoamingStatus + { + EMobileNotRegistered = 0x00, + EMobileRegHomeNetwork, // home network + EMobileNationalRoaming, + EMobileInternationalRoaming + }; + +/* +* MClientObserver +* CClientEngine passes events and responses body data with this interface. +* An instance of this class must be provided for construction of CClientEngine. +*/ +class MClientObserver + { + public: + /* + * ClientEvent() + * + * Called when event occurs in CClientEngine. + * + * @params aEvent Status of the event. + */ + virtual void ClientEvent( const THttpStatus& aEvent ) = 0; + + /* + * ClientBodyReceived() + * + * Called when a part of the HTTP body is received. + * + * @param aBodyData Part of the body data received. (e.g. part of + * the received HTML page) + */ + virtual void ClientBodyReceived( const TDesC8& aBodyData ) = 0; + + /* + * Get registrer network country code + * + * @return current register n/w info + */ + virtual RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw() = 0; + + /* + * UE is registered to home network? + * + * @return ETrue if UE is registered at home network else EFalse + */ + virtual TBool IsRegisteredAtHomeNetwork() = 0; + + /* + * Get home network country code + * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse + * @return user home n/w info + */ + virtual const RMobilePhone::TMobilePhoneNetworkInfoV1& + GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) = 0; + }; + + +/* +* Provides simple interface to HTTP Client API. +*/ +NONSHARABLE_CLASS( CClientEngine ): public CActive, + public MHTTPTransactionCallback, + public MMobilityProtocolResp + { + + //Internal Engine state + enum TEngineState + { + EIdle = 0, + EGet + }; + + public: + /* + * Create a CClientEngine object. + * + * @params iObserver refernce to the MClientObservers implementation + * + * @returns A pointer to the created instance of CClientEngine + */ + static CClientEngine* NewL( MClientObserver& iObserver ); + + /* + * Create a CClientEngine object. This leaves the object on the clean up + * stack. + * + * @params iObserver refernce to the MClientObservers implementation + * + * @returns A pointer to the created instance of CClientEngine + */ + static CClientEngine* NewLC( MClientObserver& iObserver ); + + /* + * Destroy the object + * + */ + ~CClientEngine(); + + /* + * Starts a new HTTP GET transaction. + * + * @param aUri URI to get request. (e.g. http://host.org") + */ + void IssueHTTPGetL( const TDesC8& aUri, const TConnectionOption aOption ); + + /* + * Closes currently running transaction and frees resources related to it. + */ + void CancelTransaction(); + + /* + * Closes the connection + */ + void CloseConnection(); + + + /* + * checks if silent connection is allowed + * @return ETrue if silent connection is allowed + */ + TBool SilentConnectionAllowed(); + + private: + /* + * Perform the second phase construction of a CClientEngine object. + */ + void ConstructL(); + + /* + * Performs the first phase of two phase construction. + * @param iObserver The observer that is notified after the HTTP transcation is over + */ + CClientEngine( MClientObserver& iObserver ); + + /* + * Sets header value of an HTTP request. + * + * @param aHeaders Headers of the HTTP request + * @param aHdrField Enumerated HTTP header field, e.g. HTTP::EUserAgent + * @param aHdrValue New value for header field. + */ + void SetHeaderL( RHTTPHeaders aHeaders, TInt aHdrField, + const TDesC8& aHdrValue ); + + /* + * Sets up the connection + * @param aOption The connection option + */ + void SetupConnectionL( const TConnectionOption aOption ); + + private: + //From MHTTPSessionEventCallback + /* + * Called by framework to notify about transaction events. + * + * @param aTransaction Transaction, where the event occured. + * @param aEvent Occured event. + */ + void MHFRunL( RHTTPTransaction aTransaction, const THTTPEvent& aEvent ); + + /* + * Called by framework to notify about transaction events. + * + * @param aTransaction Transaction, where the event occured. + * @param aError Error status code. + * @param aEvent The event that was being processed when leave occured. + * + * @retuen KErrNone, if the error was handled. Otherwise the value of aError, or + * some other error value. Returning error value causes causes + * HTTP-CORE 6 panic. + */ + TInt MHFRunError( TInt aError, RHTTPTransaction aTransaction, const THTTPEvent& aEvent ); + + private: + // from MMobilityProtocolResp + void PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo, + TAccessPointInfo aNewAPInfo, + TBool aIsUpgrade, + TBool aIsSeamless ); + void NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless ); + void Error( TInt aError ); + + TBool IsDataConnectionAskAlwaysL(); + TMobileRoamingStatus UeRegNetworkStatus(); + TBool IsVisitorNetwork(const TMobileRoamingStatus& aRoamingStatus) const; + TBool IsWlanOnly(const TMobileRoamingStatus& aRoamingStatus, + const TCmGenConnSettings& aGenConnSettings) const; + +private: // from CActive + + /** + * RunL + * This method is called on completion of the active object request + */ + + void RunL(); + + /** + * DoCancel + * Cancels any outstanding requests + */ + void DoCancel(); + + /** + * This method is called if the RunL leaves + * @param aError The errcode with which it leaves + */ + TInt RunError(TInt aError); + +private: + + /** + * Submits a HTTP transaction + */ + void DoHTTPGetL(); + +private: + // declare members + RSocketServ iSocketServ; + RConnection iConnection; + TUint32 iSelectedIap; + + RHTTPSession iSession; + RHTTPTransaction iTransaction; + + MClientObserver& iObserver; // Used for passing body data and events to UI + TBool iRunning; // ETrue, if transaction running + TBool iConnectionSetupDone; + + TInt iPrevProfileId; + + CActiveCommsMobilityApiExt* iMobility; + TBool iTransactionOpen; + TEngineState iEngineState; + HBufC8* iUri; + RCmManager iCmManager; + + }; + +#endif // __CLIENTENGINE_H__ + +// End of file diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/inc/connectiontimerhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/inc/connectiontimerhandler.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2009 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: Handle connection close +* +*/ + +#ifndef __CONNECTIONTIMERHANDLER_H__ +#define __CONNECTIONTIMERHANDLER_H__ + + +// INCLUDES +#include +#include + +class MConnectionTimeoutHandlerInterface + { + public: + + /** + * Handles the timedout event + * @param aErrorCode the errcode for time out + */ + virtual void HandleTimedoutEvent(TInt aErrorCode) = 0; + }; + +class CConnectionTimerHandler : public CTimer +{ + +public: + + /** + * @param aConnectionTimeoutHandlerInterface the interace class that handles the timeout events + */ + static CConnectionTimerHandler* NewL(MConnectionTimeoutHandlerInterface& aConnectionTimeoutHandlerInterface); + + /** + * Destructor + */ + ~CConnectionTimerHandler(); + + /** + * starts a timer + * @param aTimeoutVal the time after which the timer will expire + */ + void StartTimer(const TInt aTimeoutVal); + + +protected: + + /** + * RunL + * from CActive + */ + void RunL(); + + private: + + /** + * Second phase construction + */ + void ConstructL(); + + /** + * @param aConnectionTimeoutHandlerInterface the interace class that handles the timeout events + */ + CConnectionTimerHandler(MConnectionTimeoutHandlerInterface& aConnectionTimeoutHandlerInterface); + + + +private: + + /** + * An instance of the interace class that handles the timeout events + */ + MConnectionTimeoutHandlerInterface& iConnectionTimeoutHandlerInterface; +}; + + +#endif /*__CONNECTIONTIMERHANDLER_H__*/ + +// End of file diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/inc/internaladdressinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/inc/internaladdressinfo.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2006-2009 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: Implementation class from the CAddressInfo abstract class. +*/ + +#ifndef INTERNALADDRESSINFO_H_ +#define INTERNALADDRESSINFO_H_ + +#include "reversegeocode.h" +/* + * Internal implementation class for theCAddressInfo abstract class. + */ +NONSHARABLE_CLASS( CInternalAddressInfo ) : public MAddressInfo + { + public: + //from CAddressInfo class + + /** + * Gets the country name + * @return The country name + */ + virtual TDesC& GetCountryName(); + + /** + * Gets the state name + * @return The state name + */ + virtual TDesC& GetState(); + + /** + * Gets the city name + * @return The city name + */ + virtual TDesC& GetCity(); + + /** + * Gets the district name + * @return The district name + */ + virtual TDesC& GetDistrict(); + + /** + * Gets the pincode + * @return The cpincode + */ + virtual TDesC& GetPincode(); + + /** + * Gets the Thoroughfare name + * @return The Thoroughfare name + */ + virtual TDesC& GetThoroughfareName(); + + /** + * Gets the ThoroughfareNumber + * @return The ThoroughfareNumber + */ + virtual TDesC& GetThoroughfareNumber(); + + protected: + + /** + * Performs the secondphase construction + */ + void ConstructL(); + + /** + * Constructor + */ + CInternalAddressInfo(); + + public: + + + /** + * Factory function to create the instance + * @return A pointer to the CInternalAddressInfo + */ + static CInternalAddressInfo* NewL(); + + + /** + * Destructor + */ + ~CInternalAddressInfo(); + + // internal setter utilities to + // set the different attributes of the address. + + /** + * Sets the country name + * @param aCountryName The country name + */ + void SetCountryName( const TDesC& aCountryName ); + + /** + * Sets the state name + * @param aStateName The state name + */ + void SetState( const TDesC& aStateName ); + + /** + * Sets the City name + * @param aCityName The City name + */ + void SetCity( const TDesC& aCityName ); + + /** + * Sets the District name + * @param aDistrictName The District name + */ + void SetDistrict( const TDesC& aDistrictName ); + + /** + * Sets the Pincode + * @param aPincode The Pincode\ + */ + void SetPincode( const TDesC& aPincode ); + + /** + * Sets the Thoroughfare name + * @param aTFName The Thoroughfare name + */ + void SetThoroughfareName( const TDesC& aTFName ); + /** + * Sets the ThoroughfareNumber + * @param aTFNumber The ThoroughfareNumber + */ + void SetThoroughfareNumber( const TDesC& aTFNumber ); + + /** + * Resets the address info + */ + void ResetAddressInfoL(); + + private: + HBufC* iCountryName; + HBufC* iState; + HBufC* iCity; + HBufC* iDistrict; + HBufC* iPin; + HBufC* iTFName; + HBufC* iTFNumber; + }; +#endif /* INTERNALADDRESSINFO_H_ */ + +// End of file diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/inc/internalreversegeocode.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/inc/internalreversegeocode.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2006-2009 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: Implementaion class for the CReverseGeocode class. +*/ +#ifndef _INTERNALREVERSEGEOCODE_H_ +#define _INTERNALREVERSEGEOCODE_H_ + +#include + +#include "reversegeocode.h" +#include "xmlhandler.h" +#include "clientengine.h" +#include "connectiontimerhandler.h" + + +/* + * Internal implementation class for the CReverseGeocode class. + */ +NONSHARABLE_CLASS( CInternalReverseGeocode ) : public CReverseGeocode, + public MClientObserver, + public MXmlHandlerObserver, + public MConnectionTimeoutHandlerInterface + { +public: + /** + * Factory function to create the instance + * @param aObserver The observer instance that is to be notified when reverse geocoding is over + * @return A pointer to the CInternalReverseGeocode instance + */ + static CInternalReverseGeocode* NewL( MReverseGeocodeObserver& aObserver ); + + /** + * Gets the address for the given geo-coordinaates. + * @param aLocality The locality information + * aOption The connection option whether its silent or not + */ + virtual void GetAddressByCoordinateL( TLocality aLocality, const TConnectionOption aOption ); + + /** + * Checks if a silent connection is allowed + * @return ETrue If silentconnection is allowed + */ + virtual TBool SilentConnectionAllowed(); + + + /** + * Helper function to get the appropriate language for the request. + * @param aLanguage The language for the request + */ + void GetLanguageForTheRequest( TDes8& aLanguage ); + + + /** + * destructor + * + */ + ~CInternalReverseGeocode(); + + // MConnectionTimeoutHandlerInterface + /** + * Closes the connection once it times out + * @param aErrorCode The Error code + */ + void HandleTimedoutEvent(TInt aErrorCode); + +protected: + + /** + * Second phase construction + */ + void ConstructL(); + + + /** + * First phase construction. + * @param aObserver The observer instance that is to be notified when reverse geocoding is over + */ + CInternalReverseGeocode( MReverseGeocodeObserver& aObserver ); + + //From MClientObserver + /** + * callback which notifies progess of HTTP request + * @param aEvent The Httpstatus + */ + void ClientEvent( const THttpStatus& aEvent ); + + /** + * callback through which the HTTP body data is recieved. + * @param aBodyData The body recieved + */ + void ClientBodyReceived(const TDesC8& aBodyData); + + /* + * Get registrer network country code + * + * @return current register n/w info + */ + RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw(); + + //From MXmlHandlerObserver + /** + * callback which notifys the completion of parsing. + * @param aError The err code + * aAddressInfo The address info obtained after parsing + */ + void OnParseCompletedL( TInt aError, MAddressInfo& aAddressInfo ); + + /* + * UE is registered to home network? + * + * @return ETrue if UE is registered at home network else EFalse + */ + TBool IsRegisteredAtHomeNetwork(); + + + /* + * Get home network country code + * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse + * @return user home n/w info + */ + const RMobilePhone::TMobilePhoneNetworkInfoV1& + GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag); + +private: + + /** + * Starts the timer + */ + void StartTimer(); + + /** + * Closes the http connection and notifies the observer + */ + void CloseConnection(); + +private: + CXmlHandler *iXmlHandler; + CClientEngine *iClientEngine; + CInternalAddressInfo *iAddressInfo; + HBufC8* iXMLBuf; + MReverseGeocodeObserver& iObserver; + CConnectionTimerHandler* iTimer; + + // Optimize the buffer len..?? + TBuf8 iQueryString; + TBuf8 iAuthCode; + TBuf8 iRefURL; + TBuf8 iLang; + TBool iStartTimerFlag; +}; + +#endif //_INTERNALREVERSEGEOCODE_H_ + +// End of file diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/inc/reversegeocode.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/inc/reversegeocode.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 2006-2009 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: Reverse Geocode utility which converts the geo coordinates in to +* the actual address information. +*/ + +#ifndef REVERSEGEOCODE_H_ +#define REVERSEGEOCODE_H_ + +#include +#include +#include +#include +#include "geotagger.h" + +/* + * Data class to get the address details. An handle to this type will be given to the + * user through MReverseGeocodeObserver::ReverseGeocodeComplete callback, through which + * user can retrieve the address details using the following interfaces. + * + **/ +class MAddressInfo + { + public: + /* + * Gets the reference to the country name. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the Country Name. + */ + virtual TDesC& GetCountryName()= 0; + + /* + * Gets the reference to the State. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the State name. + */ + virtual TDesC& GetState()= 0; + + /* + * Gets the reference to the City. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the City Name. + */ + virtual TDesC& GetCity()= 0; + + /* + * Gets the reference to the District name. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the District Name. + */ + virtual TDesC& GetDistrict()= 0; + + /* + * Gets the reference to the postal code. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the postal code. + */ + virtual TDesC& GetPincode()= 0; + + /* + * Gets the reference to the thoroughfare name. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the thoroughfare name. + */ + virtual TDesC& GetThoroughfareName()= 0; + + /* + * Gets the reference to the thoroughfare number. Scope of this returned reference is limited to + * this perticular call. User has to store it for their further processing. + * + * @return reference to the String which holds the thoroughfare number. + */ + virtual TDesC& GetThoroughfareNumber() = 0; + }; + +/* + * Observer class which exposes callbacks to notify the completion of reversegeocoding event. + * + **/ +class MReverseGeocodeObserver + { + public: + /* + * Callback function which notifys the completion of reverse geocode event. This signals the completion + * of the asynchronous function CReverseGeoCode::GetAddressByCoordinate. + * + * @param aErrorcode Error status KErrNone in case of success or other system specific errorcodes + * in case of failures. + * + * @param aAddressInfo refrence to the address stucture, through which user can access the + * address information. + */ + + virtual void ReverseGeocodeComplete( TInt& aErrorcode, MAddressInfo& aAddressInfo ) =0; + + /* + * Get registrer network country code + * + * @return current register n/w info + */ + virtual RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw() = 0; + + + /* + * UE is registered to home network? + * + * @return ETrue if UE is registered at home network else EFalse + */ + virtual TBool IsRegisteredAtHomeNetwork() = 0; + + /* + * Get home network country code + * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse + * @return user home n/w info + */ + virtual const RMobilePhone::TMobilePhoneNetworkInfoV1& + GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) = 0; + }; + +/* + * CReverseGeocode + * Concrete class which exposes interfaces to convert the geo-coordinates information + * in to the address information. + * + **/ +class CReverseGeocode : public CBase + { + public: + /* + * Factory function to create the instance of CReverseGeocode Class. This also registers + * observer for getting the reverse geocode completion notifications. + * + * @param aObserver refrence to the instance MReverseGeocodeObserver's + * implementation class. + * @return pointer to the instance of CReverseGeocode. + */ + IMPORT_C static CReverseGeocode* NewL( MReverseGeocodeObserver& aObserver ); + + /* + * Gets the address information for the given geo coordinates. This is an asynchronous function + * Whose completion will be notified by the MReverseGeocodeObserver::ReverseGeocodeComplete callback. + * + * @param aObserver refrence to the instance MReverseGeocodeObserver's + * implementation class. + */ + virtual void GetAddressByCoordinateL( TLocality aLocality, + const TConnectionOption aOption = ESilent ) = 0; + + /* + * checks if silent connection is allowed + * @return ETrue if silent connection is allowed + */ + virtual TBool SilentConnectionAllowed() = 0; + }; + +#endif /* REVERSEGEOCODE_H_ */ diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/inc/xmlhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/inc/xmlhandler.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,217 @@ +/* +* Copyright (c) 2006-2009 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: XMLHandler class to parse the resultant reverse geocoded +* information. +*/ + +#ifndef __XMLHANDLER_H__ +#define __XMLHANDLER_H__ + +// INCLUDE FILES +#include +#include // for mcontenthandler +#include // for cparser +using namespace Xml; + +//Forward declarations +class CAddressInfo; +class CInternalAddressInfo; + +/* + * Category of the address information. This is used for + * internal parsing procedure. + */ +namespace xmlhandler + { + enum TLocationInfoType + { + ENone = 0, + ECountryName, + EState, + ECity, + EDistrict, + EPostalCode, + EThoroughfareName, + EThoroughfareNumber + }; + } + +/** + * MXmlHandlerObserver, an observer to CXmlHandler class. + */ +class MXmlHandlerObserver + { + public: + /* + * Signifies the completion of parsing of the output data. + * + * @param aError error status of parsing part. + * @param aLocationInfo reference to the resultant address information structure. + */ + virtual void OnParseCompletedL( TInt aError, MAddressInfo& aLocationInfo ) = 0; + }; + +/** + * CXmlHandler, a class to parse XML file and then output log information + * to a buffer. + */ +NONSHARABLE_CLASS( CXmlHandler ) : public MContentHandler + { + public: // Constructors and destructor + + /** + * 1st phase constructor + * + * @param aObserver The observer class to be notified after xml parsing is done + * aAddressInfo The address info + */ + static CXmlHandler* NewL( MXmlHandlerObserver& aObserver, CInternalAddressInfo *aAddressInfo ); + + /** + * 1st phase constructor pushes the object into cleanup stack + * @param aObserver The observer class to be notified after xml parsing is done + * aAddressInfo The address info + */ + static CXmlHandler* NewLC( MXmlHandlerObserver& aObserver, CInternalAddressInfo *aAddressInfo ); + + /** + * Destructor + */ + virtual ~CXmlHandler(); + + public: // Public methods + + /** + * Starts parsing the xml content + * @param aBuf The xml data + */ + + void StartParsingL( HBufC8 *aBuf ); + + private: // Constructors + + /** + * @param aObserver The observer class to be notified after xml parsing is done + * @param aAddressInfo The address info + */ + + CXmlHandler( MXmlHandlerObserver& aObserver, CInternalAddressInfo *aAddressInfo ); + + /** + * Second phase construction + */ + void ConstructL(); + + private: + // from MContentHandler + + /** + * This method is a callback to indicate the start of the document + * @param aDocParam Specifies the various parameters of the document. + * @param aErrorCode The error code. If this is not KErrNone then special action may be required. + * + */ + void OnStartDocumentL( const RDocumentParameters &aDocParam, TInt aErrorCode ); + + /** + * This method is a callback to indicate the end of the document + * @param aErrorCode The error code. If this is not KErrNone then special action may be required. + */ + void OnEndDocumentL( TInt aErrorCode ); + + /** + * This method is a callback to indicate an element has been parsed. + * @param aElement Is a handle to the element's details. + * @param aAttributes Contains the attributes for the element + * @param aErrorCode The error code. If this is not KErrNone then special action may be required + */ + void OnStartElementL( const RTagInfo &aElement, const RAttributeArray &aAttributes, TInt aErrorCode ); + + /** + * This method is a callback to indicate the end of the element has been reached. + * @param aElement Is a handle to the element's details. + * @param aErrorCode The error code. If this is not KErrNone then special action may be required + */ + + void OnEndElementL( const RTagInfo &aElement, TInt aErrorCode ); + + /** + * This method is a callback that sends the content of the element + * @param aBytes the raw content data for the element + * @param aErrorCode The error code. If this is not KErrNone then special action may be required + */ + void OnContentL( const TDesC8 &aBytes, TInt aErrorCode ); + + /** + * This method is a notification of the beginning of the scope of a prefix-URI Namespace mapping + * @param aPrefix the Namespace prefix being declared + * @param aUri the Namespace URI the prefix is mapped to + * @param aErrorCode The error code. If this is not KErrNone then special action may be required + */ + void OnStartPrefixMappingL( const RString &aPrefix, const RString &aUri, TInt aErrorCode ); + + /** + * This method is a notification of the end of the scope of a prefix-URI mapping + * @param aPrefix the Namespace prefix being declared + * @param aErrorCode The error code. If this is not KErrNone then special action may be required + */ + void OnEndPrefixMappingL( const RString &aPrefix, TInt aErrorCode ); + + /** + * This method is a notification of ignorable whitespace in element content + * @param aBytes the ignored bytes from the document being parsed + * @param aErrorCode The error code. If this is not KErrNone then special action may be required + */ + void OnIgnorableWhiteSpaceL( const TDesC8 &aBytes, TInt aErrorCode ); + + /** + * This method is a notification of a skipped entity + * @param aName the name of the skipped entity. + * @param aErrorCode The error code. If this is not KErrNone then special action may be required + */ + void OnSkippedEntityL( const RString &aName, TInt aErrorCode ); + + /** + * This method is a receive notification of a processing instruction. + * @param aTarget the processing instruction target + * @param aData the processing instruction data + * @param aErrorCode The error code. If this is not KErrNone then special action may be required + */ + void OnProcessingInstructionL( const TDesC8 &aTarget, const TDesC8 &aData, TInt aErrorCode); + + /** + * This method indicates an error has occurred + * @param aErrorCode The error code. + */ + void OnError( TInt aErrorCode ); + + /** + * This method obtains the interface matching the specified uid. + * @param aUid the uid identifying the required interface + */ + TAny *GetExtendedInterface( const TInt32 aUid ); + + private: // Private data + + MXmlHandlerObserver& iObserver; + CParser* iParser; + HBufC8* iBuffer; + CInternalAddressInfo *iAddressInfo; + xmlhandler::TLocationInfoType iCurrentElement; + TBool iThoroughfare ; + }; + +#endif /* __XMLHANDLER_H__ */ + +// End of File diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/src/clientengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/src/clientengine.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,670 @@ +/* +* Copyright (c) 2006-2009 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: Implementation of HTTP Client Engine. +*/ + +//Symbian headers +#include +#include +#include +#include +#include +#include // voice call notification +#include // kmmtsymodulename +#include "locationmanagerdebug.h" +#include "clientengine.h" + +// Used user agent for requests +_LIT8(KUserAgent, "SimpleClient 1.0"); + +// This client accepts all content types. +_LIT8(KAccept, "*/*"); + +// ---------------------------------------------------------------------------- +// CClientEngine::NewL() +// ---------------------------------------------------------------------------- +CClientEngine* CClientEngine::NewL( MClientObserver& aObserver) + { + LOG("CClientEngine::NewL ,begin"); + CClientEngine* self = CClientEngine::NewLC( aObserver); + CleanupStack::Pop( self ); + return self; + } + +// ---------------------------------------------------------------------------- +// CClientEngine::NewLC() +// ---------------------------------------------------------------------------- +CClientEngine* CClientEngine::NewLC(MClientObserver& aObserver) + { + LOG("CClientEngine::NewLC ,begin"); + CClientEngine* self = new ( ELeave ) CClientEngine( aObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// CClientEngine::CClientEngine() +// ---------------------------------------------------------------------------- +CClientEngine::CClientEngine( MClientObserver& aObserver): + CActive( CActive::EPriorityStandard ), + iObserver( aObserver ), + iConnectionSetupDone( EFalse ), + iPrevProfileId( -1 ), + iMobility(NULL), + iTransactionOpen( EFalse ), + iUri(NULL) + { + } + +// ---------------------------------------------------------------------------- +// CClientEngine::~CClientEngine() +// ---------------------------------------------------------------------------- +CClientEngine::~CClientEngine() + { + LOG("CClientEngine::~CClientEngine ,begin"); + Cancel(); + + if ( iTransactionOpen ) + { + iTransaction.Close(); + iTransactionOpen = EFalse; + } + + if ( iMobility ) + { + iMobility->Cancel(); + } + delete iMobility; + if(iConnectionSetupDone) + { + iSession.Close(); + iConnection.Close(); + iSocketServ.Close(); + } + delete iUri; + + iCmManager.Close(); + + + // DON'T cose RMobilePhone object + + LOG("CClientEngine::~CClientEngine ,end"); + } + +// ---------------------------------------------------------------------------- +// CClientEngine::ConstructL() +// ---------------------------------------------------------------------------- +void CClientEngine::ConstructL() + { + LOG("CClientEngine::ConstructL ,begin"); + CActiveScheduler::Add(this); + iCmManager.OpenL(); + LOG("CClientEngine::ConstructL ,end"); + } + +// ---------------------------------------------------------------------------- +// CClientEngine::CloseConnection() +// ---------------------------------------------------------------------------- +void CClientEngine::CloseConnection() + { + LOG("CClientEngine::CloseConnection ,begin" ); + if ( iTransactionOpen ) + { + iTransaction.Close(); + iTransactionOpen = EFalse; + } + + if ( iMobility ) + { + iMobility->Cancel(); + delete iMobility; + iMobility = NULL; + } + + if(iConnectionSetupDone) + { + iSession.Close(); + iConnection.Close(); + iSocketServ.Close(); + + iConnectionSetupDone = EFalse; + } + LOG("CClientEngine::CloseConnection ,end"); + } + + +// ---------------------------------------------------------------------------- +// CClientEngine::IsVisitorNetwork() +// ---------------------------------------------------------------------------- +TBool CClientEngine::IsVisitorNetwork(const TMobileRoamingStatus& aRegNetworkStatus) const + { + LOG1("CClientEngine::IsVisitorNetwork. reg network status - %d", + (TInt) aRegNetworkStatus); + + return (aRegNetworkStatus == EMobileNationalRoaming || + aRegNetworkStatus== EMobileInternationalRoaming); + + } + +// ---------------------------------------------------------------------------- +// CClientEngine::IsWlanOnly() +// ---------------------------------------------------------------------------- +TBool CClientEngine::IsWlanOnly(const TMobileRoamingStatus& aRoamingStatus, + const TCmGenConnSettings& aGenConnSettings) const + { + LOG1("CClientEngine::IsVisitorNetwork. reg network status - %d",(TInt) aRoamingStatus); + TBool wlanOnlyFlag = EFalse; + switch(aRoamingStatus) + { + case EMobileRegHomeNetwork: + LOG("Home network"); + wlanOnlyFlag = (aGenConnSettings.iCellularDataUsageHome == ECmCellularDataUsageDisabled); + break; + case EMobileNationalRoaming: + case EMobileInternationalRoaming: + LOG("Visitor network"); + wlanOnlyFlag = (aGenConnSettings.iCellularDataUsageVisitor == ECmCellularDataUsageDisabled); + break; + default: + break; + } // end of switch + LOG1("Wlan only flag - %d", wlanOnlyFlag ? 1 : 0); + return wlanOnlyFlag; + } + + +// ---------------------------------------------------------------------------- +// CClientEngine::UeRegNetworkStatus() +// ---------------------------------------------------------------------------- +TMobileRoamingStatus CClientEngine::UeRegNetworkStatus() + { + LOG("CClientEngine::UeRegNetworkStatus() ,begin"); + TMobileRoamingStatus roamingStatus = EMobileNotRegistered; + if(iObserver.IsRegisteredAtHomeNetwork()) + { + // home network. + roamingStatus = EMobileRegHomeNetwork; + LOG("UE registered in home network"); + } + else + { + // roaming network + TBool homeNwInfoAvailableFlag = EFalse; + const RMobilePhone::TMobilePhoneNetworkInfoV1& homeNwInfo = + iObserver.GetHomeNetworkInfo(homeNwInfoAvailableFlag); + if(homeNwInfoAvailableFlag) + { + RMobilePhone::TMobilePhoneNetworkCountryCode countryCode = + iObserver.GetCurrentRegisterNw().iCountryCode; + if(countryCode.Compare(homeNwInfo.iCountryCode) == 0) + { + // national roaming.. + LOG("UE is in nation roaming"); + roamingStatus = EMobileNationalRoaming; + } + else + { + // international roaming. + LOG("UE is in international roaming"); + roamingStatus = EMobileInternationalRoaming; + } + } + } + if(roamingStatus == EMobileNotRegistered) + { + LOG("UE is not registered with the network. Offline mode."); + } + LOG("CClientEngine::UeRegNetworkStatus ,end"); + return roamingStatus; + } + +// ---------------------------------------------------------------------------- +// CClientEngine::IsDataConnectionAskAlwaysL() +// ---------------------------------------------------------------------------- +TBool CClientEngine::IsDataConnectionAskAlwaysL() + { + LOG("CClientEngine::IsDataConnectionAskAlwaysL ,begin"); + TMobileRoamingStatus roamingStatus = UeRegNetworkStatus(); + + TCmGenConnSettings genConnSettings; + TBool retVal = EFalse; + iCmManager.ReadGenConnSettingsL(genConnSettings); + + LOG1("wlan usage - %d", genConnSettings.iUsageOfWlan); + LOG1("Home usage - %d", genConnSettings.iCellularDataUsageHome); + LOG1("Visitor usage - %d", genConnSettings.iCellularDataUsageVisitor); + + if((IsWlanOnly(roamingStatus, genConnSettings) && genConnSettings.iUsageOfWlan == ECmUsageOfWlanManual) // wlan + || (roamingStatus == EMobileRegHomeNetwork && // home + genConnSettings.iCellularDataUsageHome == ECmCellularDataUsageConfirm) + || (IsVisitorNetwork(roamingStatus) && // roaming + genConnSettings.iCellularDataUsageVisitor == ECmCellularDataUsageConfirm) + ) + { + retVal = ETrue; + } + LOG("CClientEngine::IsDataConnectionAskAlwaysL ,end"); + return retVal; + } + +// ---------------------------------------------------------------------------- +// CClientEngine::SetupConnectionL() +// ---------------------------------------------------------------------------- +void CClientEngine::SetupConnectionL( const TConnectionOption aOption ) + { + LOG("CClientEngine::SetupConnectionL ,begin"); + if ( aOption == ESilent && IsDataConnectionAskAlwaysL()) + { + LOG("Silent mode. connection setup is asked always."); + if ( iConnectionSetupDone ) + { + LOG("Already connected. Close the connection\n"); + CloseConnection(); + } + User::Leave(KErrNotSupported); + } + if ( iConnectionSetupDone ) + { + // Connection setup is done + LOG("Already connected.\n"); + User::Leave(KErrAlreadyExists); + } + + + LOG1("SetupConnectionL: connection option: %d\n", aOption ); + + // Open HTTP Session + iSession.OpenL(); + User::LeaveIfError(iSocketServ.Connect()); + User::LeaveIfError(iConnection.Open(iSocketServ)); + + if ( aOption == ESilent ) + { + // Create overrides + TConnPrefList prefList; + TExtendedConnPref prefs; + prefs.SetSnapPurpose( CMManager::ESnapPurposeInternet ); + prefs.SetNoteBehaviour( TExtendedConnPref::ENoteBehaviourConnSilent ); + prefList.AppendL( &prefs ); + + iConnection.Start(prefList, iStatus); + } + else + { + iConnection.Start( iStatus ); + } + + + SetActive(); + LOG("CClientEngine::SetupConnectionL ,end"); + } + +// ---------------------------------------------------------------------------- +// CClientEngine::SetHeaderL() +// ---------------------------------------------------------------------------- +void CClientEngine::SetHeaderL( RHTTPHeaders aHeaders, TInt aHdrField, const TDesC8& aHdrValue ) + { + LOG("CClientEngine::SetHeaderL ,begin"); + RStringF valStr = iSession.StringPool().OpenFStringL( aHdrValue ); + CleanupClosePushL( valStr ); + THTTPHdrVal val(valStr); + aHeaders.SetFieldL( iSession.StringPool().StringF( aHdrField, RHTTPSession::GetTable()), val); + CleanupStack::PopAndDestroy(); // valStr + LOG("CClientEngine::SetHeaderL ,end"); + } + +// ---------------------------------------------------------------------------- +// CClientEngine::IssueHTTPGetL() +// ---------------------------------------------------------------------------- +void CClientEngine::IssueHTTPGetL( const TDesC8& aUri, const TConnectionOption aOption ) + { + LOG("CClientEngine::IssueHTTPGetL ,begin"); + if ( IsActive() ) + { + // If there is some request in pending state + // return with out further processing + // Should we leave here !? + LOG("Client engine is already active"); + return; + } + + delete iUri; + iUri = NULL; + + iUri = aUri.AllocL(); + + // Create HTTP connection + TRAPD( err, SetupConnectionL( aOption ) ); + //If the Err is KErrNone, It will lead to RunL and + //hence jump to the DoHTTPGetL() from there. + + if( err == KErrAlreadyExists ) + { + DoHTTPGetL(); + } + else if( err != KErrNone ) + { + LOG("Connection failure. Leaving."); + iObserver.ClientEvent( EHttpConnectionFailure ); + User::Leave(err); + } + iEngineState = EGet; + LOG("CClientEngine::IssueHTTPGetL ,end"); + } + +// ---------------------------------------------------------------------------- +// CClientEngine::DoHTTPGetL() +// ---------------------------------------------------------------------------- +void CClientEngine::DoHTTPGetL() + { + LOG("CClientEngine::DoHTTPGetL ,begin"); + // Parse string to URI (as defined in RFC2396) + TUriParser8 uri; + uri.Parse( *iUri ); + + // Get request method string for HTTP GET + RStringF method = iSession.StringPool().StringF( HTTP::EGET,RHTTPSession::GetTable() ); + + // Open transaction with previous method and parsed uri. This class will + // receive transaction events in MHFRunL and MHFRunError. + iTransaction = iSession.OpenTransactionL( uri, *this, method ); + iTransactionOpen = ETrue; + + // Set headers for request; user agent and accepted content type + RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection(); + SetHeaderL( hdr, HTTP::EUserAgent, KUserAgent ); + SetHeaderL( hdr, HTTP::EAccept, KAccept ); + + // Submit the transaction. After this the framework will give transaction + // events via MHFRunL and MHFRunError. + iTransaction.SubmitL(); + + iObserver.ClientEvent( EHttpConnecting ); + LOG("CClientEngine::DoHTTPGetL ,end"); +} + +// ---------------------------------------------------------------------------- +// CClientEngine::CancelTransaction() +// ---------------------------------------------------------------------------- +void CClientEngine::CancelTransaction() + { + LOG("CClientEngine::CancelTransaction ,begin"); + iEngineState = EIdle; + delete iUri; + iUri = NULL; + + // Close() also cancels transaction (Cancel() can also be used but + // resources allocated by transaction must be still freed with Close()) + if( iTransactionOpen ) + { + iTransaction.Close(); + iTransactionOpen = EFalse; + + iObserver.ClientEvent( EHttpTxCancelled ); + } + LOG("CClientEngine::CancelTransaction ,end"); + } + +// ---------------------------------------------------------------------------- +// CClientEngine::MHFRunL() +// ---------------------------------------------------------------------------- +void CClientEngine::MHFRunL( RHTTPTransaction aTransaction, const THTTPEvent& aEvent ) + { + LOG("CClientEngine::MHFRunL ,begin"); + switch ( aEvent.iStatus ) + { + case THTTPEvent::EGotResponseHeaders: + { + // HTTP response headers have been received. Use + // aTransaction.Response() to get the response. However, it's not + // necessary to do anything with the response when this event occurs. + iObserver.ClientEvent( EHttpHdrReceived ); + break; + } + case THTTPEvent::EGotResponseBodyData: + { + // Part (or all) of response's body data received. Use + // aTransaction.Response().Body()->GetNextDataPart() to get the actual + // body data. + + // Get the body data supplier + MHTTPDataSupplier* body = aTransaction.Response().Body(); + TPtrC8 dataChunk; + + // GetNextDataPart() returns ETrue, if the received part is the last + // one. + TBool isLast = body->GetNextDataPart(dataChunk); + iObserver.ClientBodyReceived(dataChunk); + + iObserver.ClientEvent( EHttpBytesReceieved ); + + // NOTE: isLast may not be ETrue even if last data part received. + // (e.g. multipart response without content length field) + // Use EResponseComplete to reliably determine when body is completely + // received. + if( isLast ) + { + iObserver.ClientEvent( EHttpBodyReceieved ); + } + // Always remember to release the body data. + body->ReleaseData(); + break; + } + case THTTPEvent::EResponseComplete: + { + // Indicates that header & body of response is completely received. + // No further action here needed. + + iObserver.ClientEvent( EHttpTxCompleted ); + break; + } + case THTTPEvent::ESucceeded: + { + // Indicates that transaction succeeded. + iObserver.ClientEvent( EHttpTxSuccess ); + // Transaction can be closed now. It's not needed anymore. + aTransaction.Close(); + iTransactionOpen = EFalse; + break; + } + case THTTPEvent::EFailed: + { + // Transaction completed with failure. + iObserver.ClientEvent( EHttpTxFailed ); + aTransaction.Close(); + iTransactionOpen = EFalse; + break; + } + default: + // There are more events in THTTPEvent, but they are not usually + // needed. However, event status smaller than zero should be handled + // correctly since it's error. + { + if ( aEvent.iStatus < 0 ) + { + iObserver.ClientEvent( EHttpConnectionFailure ); + // Close the transaction on errors + aTransaction.Close(); + iTransactionOpen = EFalse; + } + break; + } + } + LOG("CClientEngine::MHFRunL ,end"); + } + +// ---------------------------------------------------------------------------- +// CClientEngine::MHFRunError() +// ---------------------------------------------------------------------------- +TInt CClientEngine::MHFRunError( TInt /*aError*/, RHTTPTransaction /*aTransaction*/, const THTTPEvent& /*aEvent*/ ) + { + LOG("CClientEngine::MHFRunError ,begin"); + // Just notify about the error and return KErrNone. + CloseConnection(); + iObserver.ClientEvent(EHttpMhfRunError); + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CClientEngine::PreferredCarrierAvailable() +// ---------------------------------------------------------------------------- +void CClientEngine::PreferredCarrierAvailable( TAccessPointInfo /*aOldAPInfo*/, + TAccessPointInfo /*aNewAPInfo*/, + TBool /*aIsUpgrade*/, + TBool aIsSeamless ) + { + LOG("CClientEngine::PreferredCarrierAvailable ,begin"); + if( !aIsSeamless && iMobility) + { + iMobility->MigrateToPreferredCarrier(); + } + LOG("CClientEngine::PreferredCarrierAvailable ,end"); + } + +// ---------------------------------------------------------------------------- +// CClientEngine::NewCarrierActive() +// ---------------------------------------------------------------------------- +void CClientEngine::NewCarrierActive( TAccessPointInfo /*aNewAPInfo*/, + TBool aIsSeamless ) + { + LOG("CClientEngine::NewCarrierActive ,begin"); + if( !aIsSeamless && iMobility) + { + iMobility->NewCarrierAccepted(); + } + LOG("CClientEngine::NewCarrierActive ,end"); + } + +// ---------------------------------------------------------------------------- +// CClientEngine::Error() +// ---------------------------------------------------------------------------- +void CClientEngine::Error(TInt /*aError*/) + { + LOG("CClientEngine::Error"); + } + +// ---------------------------------------------------------------------------- +// CClientEngine::DoCancel() +// ---------------------------------------------------------------------------- +void CClientEngine::DoCancel() + { + LOG("CClientEngine::DoCancel"); + iConnection.Stop(); + } + +// ---------------------------------------------------------------------------- +// CClientEngine::DoCancel() +// ---------------------------------------------------------------------------- +TInt CClientEngine::RunError(TInt /*aError*/) + { + LOG("CClientEngine::RunError"); + // Just notify about the error and return KErrNone. + CloseConnection(); + iObserver.ClientEvent( EHttpTxFailed ); + return KErrNone; + } +// ---------------------------------------------------------------------------- +// CClientEngine::RunL() +// ---------------------------------------------------------------------------- +void CClientEngine::RunL() + { + LOG1("CClientEngine::RunL: error is: %d\n", iStatus.Int() ); + TInt statusCode = iStatus.Int(); + if ( statusCode == KErrNone ) + { + // Connection done ok + iConnectionSetupDone = ETrue; + + RStringPool strPool = iSession.StringPool(); + + // Remove first session properties just in case. + RHTTPConnectionInfo connInfo = iSession.ConnectionInfo(); + + // Clear RConnection and Socket Server instances + connInfo.RemoveProperty(strPool.StringF(HTTP::EHttpSocketServ,RHTTPSession::GetTable())); + connInfo.RemoveProperty(strPool.StringF(HTTP::EHttpSocketConnection,RHTTPSession::GetTable())); + + // Clear the proxy settings + connInfo.RemoveProperty(strPool.StringF(HTTP::EProxyUsage,RHTTPSession::GetTable())); + connInfo.RemoveProperty(strPool.StringF(HTTP::EProxyAddress,RHTTPSession::GetTable())); + + // RConnection and Socket Server + connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketServ, + RHTTPSession::GetTable()), + THTTPHdrVal (iSocketServ.Handle()) ); + + TInt connPtr1 = REINTERPRET_CAST(TInt, &iConnection); + connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketConnection, + RHTTPSession::GetTable() ), THTTPHdrVal (connPtr1) ); + + // Register for mobility API + if(iMobility) + { + delete iMobility; + iMobility = NULL ; + } + iMobility = CActiveCommsMobilityApiExt::NewL( iConnection, *this ); + // Start selected HTTP action + switch( iEngineState ) + { + case EIdle: + { + // + CancelTransaction(); + break; + } + case EGet: + { + DoHTTPGetL(); + break; + } + }; + } + else + { + //handle error + if ( statusCode == KErrPermissionDenied ) + { + iObserver.ClientEvent( EHttpAuthFailed ); + } + else + { + //Throw some general Transaction falure error! + iObserver.ClientEvent( EHttpTxFailed ); + } + CloseConnection(); + } + LOG("CClientEngine::RunL ,end"); + } + +// ---------------------------------------------------------------------------- +// CClientEngine::SilentConnectionAllowed() +// ---------------------------------------------------------------------------- +TBool CClientEngine::SilentConnectionAllowed() + { + LOG("CClientEngine::SilentConnectionAllowed ,begin"); + TBool retVal = EFalse; + TRAPD(err, retVal = IsDataConnectionAskAlwaysL()); + if(err == KErrNone) + { + // data connection is always ask... Silent connection is not allowed + retVal = !retVal; + } + LOG1("CClientEngine::SilentConnectionAllowed ,end. Ret - %d", retVal); + return retVal; + } + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/src/connectiontimerhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/src/connectiontimerhandler.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2009 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: Connection close timer handler +*/ + +#include "connectiontimerhandler.h" +#include "locationmanagerdebug.h" + + +// ---------------------------------------------------------------------------- +// CConnectionTimerHandler::CConnectionTimerHandler() +// ---------------------------------------------------------------------------- + + +CConnectionTimerHandler::CConnectionTimerHandler(MConnectionTimeoutHandlerInterface& aConnectionTimeoutHandlerInterface): + CTimer(EPriorityStandard ), + iConnectionTimeoutHandlerInterface(aConnectionTimeoutHandlerInterface) +{ + +} + +// ---------------------------------------------------------------------------- +// CConnectionTimerHandler::~CConnectionTimerHandler() +// ---------------------------------------------------------------------------- +CConnectionTimerHandler::~CConnectionTimerHandler() + { + } + +// ---------------------------------------------------------------------------- +// CConnectionTimerHandler::NewL() +// ---------------------------------------------------------------------------- +CConnectionTimerHandler* CConnectionTimerHandler::NewL(MConnectionTimeoutHandlerInterface& aConnectionTimeoutHandlerInterface) + { + LOG("CConnectionTimerHandler::NewL ,begin"); + CConnectionTimerHandler* self = new( ELeave ) CConnectionTimerHandler(aConnectionTimeoutHandlerInterface); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ---------------------------------------------------------------------------- +// CConnectionTimerHandler::ConstructL() +// ---------------------------------------------------------------------------- +void CConnectionTimerHandler::ConstructL() + { + LOG("CConnectionTimerHandler::ConstructL ,begin"); + CActiveScheduler::Add(this); + CTimer::ConstructL(); + LOG("CConnectionTimerHandler::ConstructL ,end"); + } + +// ---------------------------------------------------------------------------- +// CConnectionTimerHandler::StartTimer +// starts a timer +// ---------------------------------------------------------------------------- +void CConnectionTimerHandler::StartTimer(const TInt aTimeoutVal) + { + LOG("CConnectionTimerHandler::StartTimer ,begin"); + if(!IsActive()) + { + // already active. + LOG("Timer started"); + After(aTimeoutVal); + } + LOG("CConnectionTimerHandler::StartTimer ,end"); + } + +// ---------------------------------------------------------------------------- +// CConnectionTimerHandler::RunL +// ---------------------------------------------------------------------------- +void CConnectionTimerHandler::RunL( ) + { + LOG("CConnectionTimerHandler::RunL ,begin"); + iConnectionTimeoutHandlerInterface.HandleTimedoutEvent(iStatus.Int()); + LOG("CConnectionTimerHandler::RunL ,end"); + } + + + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/src/internaladdressinfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/src/internaladdressinfo.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,339 @@ +/* +* Copyright (c) 2006-2009 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: Implementation of Internal address info structure. +*/ + +#include "internaladdressinfo.h" +#include "locationmanagerdebug.h" + + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::CInternalAddressInfo() +// Constructor +// ---------------------------------------------------------------------------- +CInternalAddressInfo::CInternalAddressInfo(): iCountryName( NULL ), + iState( NULL ), + iCity( NULL ), + iDistrict( NULL ), + iPin( NULL ), + iTFName( NULL ), + iTFNumber( NULL ) + + { + + + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::~CInternalAddressInfo() +// Destructor +// ---------------------------------------------------------------------------- +CInternalAddressInfo::~CInternalAddressInfo() + { + LOG("CInternalAddressInfo::~CInternalAddressInfo ,begin"); + if (iCountryName) + { + delete iCountryName; + iCountryName = NULL ; + } + if (iState) + { + delete iState; + iState= NULL ; + } + if (iCity) + { + delete iCity; + iCity= NULL ; + } + if (iDistrict) + { + delete iDistrict; + iDistrict = NULL ; + } + if (iPin) + { + delete iPin; + iPin = NULL ; + } + if (iTFName) + { + delete iTFName; + iTFName = NULL ; + } + if (iTFNumber) + { + delete iTFNumber; + iTFNumber = NULL ; + } + + LOG("CInternalAddressInfo::~CInternalAddressInfo ,end"); + } + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::NewL() +// Factory function to create the instance +// ---------------------------------------------------------------------------- +CInternalAddressInfo* CInternalAddressInfo::NewL() + { + LOG("CInternalAddressInfo::NewL ,begin"); + CInternalAddressInfo *self = new (ELeave) CInternalAddressInfo(); + CleanupStack::PushL(self); + self->ConstructL(); + + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::ConstructL() +// Second phase construction. +// ---------------------------------------------------------------------------- +void CInternalAddressInfo::ConstructL() + { + LOG("CInternalAddressInfo::ConstructL ,begin"); + //Copy all with the empty strings; + ResetAddressInfoL(); + LOG("CInternalAddressInfo::ConstructL ,end"); + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::GetCountryName() +// Gets Country name +// ---------------------------------------------------------------------------- +TDesC& CInternalAddressInfo::GetCountryName() + { + return *iCountryName; + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::GetState() +// Gets State name +// ---------------------------------------------------------------------------- +TDesC& CInternalAddressInfo::GetState() + { + return *iState; + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::GetCity() +// Gets City name. +// ---------------------------------------------------------------------------- +TDesC& CInternalAddressInfo::GetCity() + { + return *iCity; + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::GetDistrict() +// Gets District name of the address. +// ---------------------------------------------------------------------------- +TDesC& CInternalAddressInfo::GetDistrict() + { + return *iDistrict; + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::GetPincode() +// Gets the postal code. +// ---------------------------------------------------------------------------- +TDesC& CInternalAddressInfo::GetPincode() + { + return *iPin; + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::GetThoroughfareName() +// Gets thoroughfare name +// ---------------------------------------------------------------------------- +TDesC& CInternalAddressInfo::GetThoroughfareName() + { + return *iTFName; + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::GetThoroughfareNumber() +// Gets thoroughfare number +// ---------------------------------------------------------------------------- +TDesC& CInternalAddressInfo::GetThoroughfareNumber() + { + return *iTFNumber; + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::SetCountryName() +// Sets the country name information +// ---------------------------------------------------------------------------- +void CInternalAddressInfo::SetCountryName( const TDesC& aCountryName ) + { + if( iCountryName ) + { + delete iCountryName; + } + iCountryName = aCountryName.Alloc(); + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::SetState() +// Sets the State name information +// ---------------------------------------------------------------------------- +void CInternalAddressInfo::SetState( const TDesC& aState ) + { + if( iState ) + { + delete iState; + } + iState = aState.Alloc(); + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::SetCity() +// Sets the City name information +// ---------------------------------------------------------------------------- +void CInternalAddressInfo::SetCity( const TDesC& aCity ) + { + if( iCity ) + { + delete iCity; + } + iCity = aCity.Alloc(); + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::SetDistrict() +// Sets the District name information +// ---------------------------------------------------------------------------- +void CInternalAddressInfo::SetDistrict( const TDesC& aDisrict ) + { + if( iDistrict ) + { + delete iDistrict; + } + iDistrict = aDisrict.Alloc(); + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::SetPincode() +// Sets the Postal code information +// ---------------------------------------------------------------------------- +void CInternalAddressInfo::SetPincode( const TDesC& aPincode ) + { + if( iPin ) + { + delete iPin; + } + iPin = aPincode.Alloc(); + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::SetThoroughfareName() +// Sets the thoroughfare name information +// ---------------------------------------------------------------------------- +void CInternalAddressInfo::SetThoroughfareName( const TDesC& aTFName ) + { + if( iTFName ) + { + delete iTFName; + } + iTFName = aTFName.Alloc(); + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::SetThoroughfareNumber() +// Sets the thoroughfare number information +// ---------------------------------------------------------------------------- +void CInternalAddressInfo::SetThoroughfareNumber( const TDesC& aTFNumber ) + { + if( iTFNumber ) + { + delete iTFNumber; + } + iTFNumber = aTFNumber.Alloc(); + } + + +// ---------------------------------------------------------------------------- +// CInternalAddressInfo::ResetAddressInfoL() +// resets the address info +// ---------------------------------------------------------------------------- +void CInternalAddressInfo::ResetAddressInfoL() + { + // Allocate empty buffer to avoid crash on get method + + // Free memory + if(iCountryName) + { + delete iCountryName; + iCountryName = NULL; + } + if(iState) + { + delete iState; + iState = NULL; + } + if(iCity) + { + delete iCity; + iCity = NULL; + } + if(iDistrict) + { + delete iDistrict; + iDistrict = NULL; + } + if(iPin) + { + delete iPin; + iPin = NULL; + } + if(iTFName) + { + delete iTFName; + iTFName = NULL; + } + if(iTFNumber) + { + delete iTFNumber; + iTFNumber = NULL; + } + // Allocate empty strings, + iCountryName = KNullDesC().AllocL(); + iCity = KNullDesC().AllocL(); + iState = KNullDesC().AllocL(); + iDistrict = KNullDesC().AllocL(); + iPin = KNullDesC().AllocL(); + iTFName = KNullDesC().AllocL(); + iTFNumber = KNullDesC().AllocL(); + + } + + +//end of file diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/src/internalreversegeocode.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/src/internalreversegeocode.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,454 @@ +/* +* Copyright (c) 2006-2009 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: Implementation of reversegeocodea achieved using HTTP get +* request to the Maps server. +*/ + +#include "internalreversegeocode.h" +#include "internaladdressinfo.h" +#include "locationmanagerdebug.h" + + +//Maximum length for the response buffer size +const int KMaxResponseLength = 2048; +//Authentication token for the Maps server +//This authentication in specific to our photo-tagging feature +_LIT8( KAuthenticationToken, "eb0ae60051e27d3cfcae94e7b47e9eff" ); +//Static RefererURL which shows that request has been made from this app +_LIT8( KRefererURL, "s60_app_photos" ); + +//Language option for the REST request +_LIT8( KDefaultLanguage, "eng" ); + + +//Format of the HTTP request for the reverse geocode +_LIT8( KRequestFormat, "http://loc.mobile.maps.svc.ovi.com/geocoder/rgc/1.0?token=%S&referer=%S&n=10&lat=%f&long=%f&lg=%S&output=xml" ); + + +// http://www.loc.gov/marc/languages/ +// These are the nokia language id converted to MARC language strings. + static const char Marc_Table[ 104 ][ 4 ] = { + " ", // dummy + "ENG", // 1 English + "FRE", // 2 French + "GER", // 3 German + "SPA", // 4 Spanish + "ITA", // 5 Italian + "SWE", // 6 Swedish + "DAN", // 7 Danish + "NOR", // 8 Norwegian + "FIN", // 9 Finnish + "010", // 10 American + "011", // 11 Swiss French + "GSW", // 12 Swiss German + "POR", // 13 Portuguese + "TUR", // 14 Turkish + "ICE", // 15 Icelandic + "RUS", // 16 Russian + "HUN", // 17 Hungarian + "DUT", // 18 Dutch + "019", // 19 Flemish + "020", // 20 Australian English + "021", // 21 Belgian French + "022", // 22 Austrian German + "023", // 23 New Zealand English + "FRE", // 24 International French + "CZE", // 25 Czech + "SLO", // 26 Slovak + "POL", // 27 Polish + "SLV", // 28 Slovenian + "029", // 29 TaiwanChinese + "CHT", // 30 HongKongChinese + "CHI", // 31 PeoplesRepublicOfChina Chinese + "JPN", // 32 Japanese + "THA", // 33 Thai + "AFR", // 34 Afrikaans + "ALB", // 35 Albanian + "AMH", // 36 Amharic + "ARA", // 37 Arabic + "ARM", // 38 Armenian + "TGL", // 39 Tagalog + "BEL", // 40 Belarusian + "BEN", // 41 Bengali + "BUL", // 42 Bulgarian + "BUR", // 43 Burmese + "CAT", // 44 Catalan + "SCR", // 45 Croatian + "046", // 46 Canadian English + "ENG", // 47 International English + "048", // 48 SouthAfrican English + "EST", // 49 Estonian + "PER", // 50 Persian (Farsi) + "051", // 51 Canadian French + "GAE", // 52 Scots Gaelic + "GEO", // 53 Georgian + "GRE", // 54 Greek + "055", // 55 Cyprus Greek + "GUJ", // 56 Gujarati + "HEB", // 57 Hebrew + "HIN", // 58 Hindi + "IND", // 59 Bahasa indonesia + "GLE", // 60 Irish + "061", // 61 Swiss Italian + "KAN", // 62 Kannada + "KAZ", // 63 Kazakh + "KHM", // 64 Khmer + "KOR", // 65 Korean + "LAO", // 66 Lao + "LAV", // 67 Latvian + "LIT", // 68 Lithuanian + "MAC", // 69 Macedonian + "070", // 70 Bahasa Malaysia + "MAL", // 71 Malayalam + "MAR", // 72 Marathi + "MOL", // 73 Moldavian + "MON", // 74 Mongolian + "NNO", // 75 Norwegian Nynorsk + "076", // 76 Brazilian Portuguese + "PAN", // 77 Punjabi + "RUM", // 78 Romanian + "SCC", // 79 Serbian + "SNH", // 80 Sinhalese + "SOM", // 81 Somali + "082", // 82 International Spanish + "083", // 83 LatinAmerican Spanish + "SWA", // 84 Swahili + "085", // 85 Finland Swedish + "TAJ", // 86 Tajik + "TAM", // 87 Tamil + "TEL", // 88 Telugu + "TIB", // 89 Tibetan + "TIR", // 90 Tigrinya + "091", // 91 Cyprus Turkish + "TUK", // 92 Turkmen + "UKR", // 93 Ukrainian + "URD", // 94 Urdu + "UZB", // 95 Uzbek + "VIE", // 96 Vietnamese + "WEL", // 97 Welsh + "ZUL", // 98 Zulu + "UND", // 99 Other + "UND", // 100 Undef + "UND", // 101 Undef + "BAQ", // 102 Basque + "103", // 103 Galician + }; + + // Timer interval + const TInt KInterval = 15000000; // 15 seconds + + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::NewL() +// Factory function to create the instance +// ---------------------------------------------------------------------------- +CInternalReverseGeocode* CInternalReverseGeocode::NewL( MReverseGeocodeObserver& aObserver ) + { + LOG( "CInternalReverseGeocode::NewL,begin" ); + CInternalReverseGeocode *self = new (ELeave) CInternalReverseGeocode( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + + CleanupStack::Pop( self ); + return self; + } + + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::CInternalReverseGeocode() +// Constructor +// ---------------------------------------------------------------------------- +CInternalReverseGeocode::CInternalReverseGeocode( MReverseGeocodeObserver& aObserver ): + iXmlHandler ( NULL ), + iClientEngine ( NULL ), + iXMLBuf ( NULL ), + iObserver( aObserver ), + iTimer( NULL ), + iStartTimerFlag(EFalse) + { + } + + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::~CInternalReverseGeocode() +// Destructor +// ---------------------------------------------------------------------------- +CInternalReverseGeocode::~CInternalReverseGeocode() + { + LOG( "CInternalReverseGeocode::~CInternalReverseGeocode,begin" ); + if ( iTimer) + { + iTimer->Cancel(); + delete iTimer; + iTimer = NULL; + } + delete iXMLBuf; + delete iXmlHandler; + delete iClientEngine; + delete iAddressInfo; + LOG( "CInternalReverseGeocode::~CInternalReverseGeocode,end" ); + } + + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::GetAddressByCoordinateL() +// Gets the address for the given geo-coordinaates. +// ---------------------------------------------------------------------------- +void CInternalReverseGeocode::GetAddressByCoordinateL( TLocality aLocality, + const TConnectionOption aOption ) + { + LOG("CInternalReverseGeocode::GetAddressByCoordinateL ,begin"); + TReal64 latitude = aLocality.Latitude(); + TReal64 longitude = aLocality.Longitude(); + + iAuthCode.Copy( KAuthenticationToken ); + iRefURL.Copy( KRefererURL ); + + + GetLanguageForTheRequest( iLang ); + + //Form the request URI + iQueryString.Format( KRequestFormat, &iAuthCode, &iRefURL, latitude, longitude, &iLang ); + TInt err = KErrNone; + TRAP(err, iClientEngine->IssueHTTPGetL( iQueryString, aOption )); + + if ( iTimer && iTimer->IsActive() ) + { + iTimer->Cancel(); + } + if(err == KErrNone || err == KErrNotSupported) + { + // connection is closed because of data usage is set to manual + iStartTimerFlag = EFalse; + } + LOG("CInternalReverseGeocode::GetAddressByCoordinateL ,end"); + } + + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::ConstructL() +// second phase construction. +// ---------------------------------------------------------------------------- +void CInternalReverseGeocode::ConstructL() + { + LOG( "CInternalReverseGeocode::ConstructL,begin" ); + iXMLBuf = HBufC8::NewL( KMaxResponseLength ); + + //Address Info + iAddressInfo = CInternalAddressInfo::NewL(); + + iXmlHandler = CXmlHandler::NewL( *this, iAddressInfo ); + + iClientEngine = CClientEngine::NewL( *this ); + + iTimer = CConnectionTimerHandler::NewL(*this); + + LOG( "CInternalReverseGeocode::ConstructL,end" ); + } + + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::OnParseCompletedL() +// callback which notifys the completion of parsing. +// ---------------------------------------------------------------------------- +void CInternalReverseGeocode::OnParseCompletedL( TInt aError, MAddressInfo& aLocationInfo ) + { + LOG( "CInternalReverseGeocode::OnParseCompletedL,begin" ); + ARG_USED(aLocationInfo); + iStartTimerFlag = ETrue; + iObserver.ReverseGeocodeComplete( aError, *iAddressInfo ); + if(iStartTimerFlag) + { + StartTimer(); + } + LOG( "CInternalReverseGeocode::OnParseCompletedL,end" ); + } + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::ClientEvent() +// callback which notifys progess of HTTP request +// ---------------------------------------------------------------------------- +void CInternalReverseGeocode::ClientEvent( const THttpStatus& aEvent ) + { + LOG( "CInternalReverseGeocode::ClientEvent,begin" ); + TInt err; + //Have a Switch here + switch( aEvent ) + { + case EHttpTxCompleted: + //Reading is done + //Parse the String and get the restults + if( iXmlHandler ) + { + TRAP_IGNORE( iXmlHandler->StartParsingL( iXMLBuf ) ); + } + break; + //All these cases will in turn lead to + //generic failure due to connection/Tx related problems + case EHttpConnectionFailure: + // May happen if Socket connection fails + err = KErrCouldNotConnect; + iObserver.ReverseGeocodeComplete( err , *iAddressInfo ); + break; + case EHttpTxFailed: + case EHttpMhfRunError: + // May happen if Socket connection fails + // Complete the RGC with generic error. + err = KErrGeneral; + iObserver.ReverseGeocodeComplete( err , *iAddressInfo ); + break; + case EHttpTxCancelled: + //On Cancellation of request. + err = KErrCancel; + iObserver.ReverseGeocodeComplete( err , *iAddressInfo ); + break; + case EHttpAuthFailed: + //On Cancellation of request. + err = KErrPermissionDenied; + iObserver.ReverseGeocodeComplete( err , *iAddressInfo ); + break; + } + LOG( "CInternalReverseGeocode::ClientEvent,end" ); + } + + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::ClientBodyReceived() +// callback through which the HTTP body data is recieved. +// ---------------------------------------------------------------------------- +void CInternalReverseGeocode::ClientBodyReceived( const TDesC8& aBodyData ) + { + LOG( "CInternalReverseGeocode::ClientBodyReceived" ); + //Dump the contents here + TPtr8 ptr = iXMLBuf->Des(); + ptr.Zero(); + ptr.Append( aBodyData ); + } + + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::GetLanguageForTheRequest() +// Gets the appropriate language based on the Phone language setting +// ---------------------------------------------------------------------------- +void CInternalReverseGeocode::GetLanguageForTheRequest( TDes8& aLanguage ) + { + LOG( "CInternalReverseGeocode::GetLanguageForTheRequest,begin" ); + //get the current phone langauge + TInt phoneLangIndex = User::Language(); + + // Get the converted language + if ( phoneLangIndex < sizeof( Marc_Table ) / sizeof( Marc_Table[ 0 ] ) ) + { + aLanguage = (const TUint8*) Marc_Table[ phoneLangIndex ]; + } + else + { + //By default language will be Eng + aLanguage.Copy( KDefaultLanguage ); + } + LOG( "CInternalReverseGeocode::GetLanguageForTheRequest,begin" ); + } + + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::CloseConnection() +// Closes the http connection and notifies the observer +// ---------------------------------------------------------------------------- +void CInternalReverseGeocode::CloseConnection() + { + LOG( "CInternalReverseGeocode::CloseConnection ,begin" ); + if(iClientEngine) + { + iClientEngine->CloseConnection(); + LOG( "Connection closed\n" ); + TInt err = KErrCouldNotConnect; + iObserver.ReverseGeocodeComplete( err , *iAddressInfo ); + } + LOG( "CInternalReverseGeocode::CloseConnection,end" ); + } + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::StartTimer() +// starts the timer +// ---------------------------------------------------------------------------- +void CInternalReverseGeocode::StartTimer() + { + LOG( "CInternalReverseGeocode::StartTimer ,begin" ); + if(iTimer) + { + iTimer->StartTimer( KInterval); + LOG( "Timer started" ); + } + LOG( "CInternalReverseGeocode::StartTimer,end" ); + } + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::HandleTimedoutEvent() +// Closes the connection once it times out +// ---------------------------------------------------------------------------- +void CInternalReverseGeocode::HandleTimedoutEvent(TInt aErrorCode) + { + LOG( "CInternalReverseGeocode::HandleTimedoutEvent" ); + ARG_USED(aErrorCode); + CloseConnection(); + } + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::SilentConnectionAllowed() +// Checks if a silent connection is allowed +// ---------------------------------------------------------------------------- +TBool CInternalReverseGeocode::SilentConnectionAllowed() + { + LOG( "CInternalReverseGeocode::SilentConnectionAllowed ,begin" ); + TBool retVal = EFalse; + if(iClientEngine) + { + retVal = iClientEngine->SilentConnectionAllowed(); + } + LOG1("Silent connection allowed ,end- %d", (TInt)retVal); + return retVal; + } + + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::GetCurrentRegisterNw() +// ---------------------------------------------------------------------------- +RMobilePhone::TMobilePhoneNetworkInfoV2& CInternalReverseGeocode::GetCurrentRegisterNw() + { + LOG( "CInternalReverseGeocode::GetCurrentRegisterNw ,begin" ); + return iObserver.GetCurrentRegisterNw(); + } + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::IsRegisteredAtHomeNetwork() +// ---------------------------------------------------------------------------- +TBool CInternalReverseGeocode::IsRegisteredAtHomeNetwork() + { + LOG( "CInternalReverseGeocode::IsRegisteredAtHomeNetwork" ); + return iObserver.IsRegisteredAtHomeNetwork(); + } + +// ---------------------------------------------------------------------------- +// CInternalReverseGeocode::GetHomeNetworkInfo() +// ---------------------------------------------------------------------------- +const RMobilePhone::TMobilePhoneNetworkInfoV1& + CInternalReverseGeocode::GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) + { + LOG( "CInternalReverseGeocode::GetHomeNetworkInfo" ); + return iObserver.GetHomeNetworkInfo(aHomeNwInfoAvailableFlag); + } + + +//end of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/src/reversegeocode.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/src/reversegeocode.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2006-2009 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: Implementation of exported interface class of reverse geo-code +*/ + +#include "reversegeocode.h" +#include "internalreversegeocode.h" +#include "locationmanagerdebug.h" + +// -------------------------------------------------------------------------- +// CReverseGeocode::NewL() +// factory class to create the instance +// -------------------------------------------------------------------------- + +EXPORT_C CReverseGeocode* CReverseGeocode::NewL( MReverseGeocodeObserver& aObserver ) + { + LOG("CReverseGeocode::NewL ,begin"); + CInternalReverseGeocode *self = CInternalReverseGeocode::NewL( aObserver ); + + return self; + } + +//End of file diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/ReverseGeocode/src/xmlhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/ReverseGeocode/src/xmlhandler.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,389 @@ +/* +* Copyright (c) 2006-2009 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: Implementation of the Parser +*/ + + + + +#include +#include "internaladdressinfo.h" +#include "xmlhandler.h" +#include "locationmanagerdebug.h" + +using namespace xmlhandler; + +// CONSTANTS +_LIT8( KXmlMimeType, "text/xml" ); +_LIT8( KCountry, "country" ); +_LIT8( KState, "state" ); +_LIT8( KDistrict, "district" ); +_LIT8( KCity, "city" ); +_LIT8( KPostalCode, "postCode" ); +_LIT8( KThoroughfare, "thoroughfare" ); +_LIT8( KNameTag, "name" ); +_LIT8( KNumberTag, "number" ); + +// METHODS DEFINITION + +// -------------------------------------------------------------------------- +// CXmlHandler::NewL +// -------------------------------------------------------------------------- +CXmlHandler* CXmlHandler::NewL( MXmlHandlerObserver& aObserver, CInternalAddressInfo *aAddressInfo ) + { + LOG("CXmlHandler::NewL ,begin"); + CXmlHandler* self = CXmlHandler::NewLC( aObserver, aAddressInfo ); + CleanupStack::Pop(); + return self; + } + +// -------------------------------------------------------------------------- +// CXmlHandler::NewLC +// -------------------------------------------------------------------------- + +CXmlHandler* CXmlHandler::NewLC( MXmlHandlerObserver& aObserver, CInternalAddressInfo *aAddressInfo ) + { + LOG("CXmlHandler::NewLC ,begin"); + CXmlHandler* self = new ( ELeave ) CXmlHandler( aObserver, aAddressInfo ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// -------------------------------------------------------------------------- +// CXmlHandler::~CXmlHandler +// -------------------------------------------------------------------------- +CXmlHandler::~CXmlHandler() + { + LOG("CXmlHandler::~CXmlHandler"); + delete iParser; + delete iBuffer; + } + +// -------------------------------------------------------------------------- +// CXmlHandler::CXmlHandler +// -------------------------------------------------------------------------- +CXmlHandler::CXmlHandler( MXmlHandlerObserver& aObserver, CInternalAddressInfo *aAddressInfo ): + iObserver( aObserver ), + iParser( NULL ), + iBuffer( NULL ), + iAddressInfo( aAddressInfo ), + iThoroughfare( EFalse ) + { + } + +// -------------------------------------------------------------------------- +// CXmlHandler::ConstructL +// -------------------------------------------------------------------------- +void CXmlHandler::ConstructL() + { + LOG("CXmlHandler::ConstructL ,begin"); + iParser = CParser::NewL( KXmlMimeType, *this ); + + } + +// -------------------------------------------------------------------------- +// CXmlHandler::StartParsingL() +// -------------------------------------------------------------------------- +void CXmlHandler::StartParsingL( HBufC8 *aBuf ) + { + LOG("CXmlHandler::StartParsingL ,begin"); + //Reset the address values before starting new content parsing + iAddressInfo->ResetAddressInfoL(); + + if( iBuffer ) + { + delete iBuffer; + iBuffer = NULL; + } + + iBuffer = HBufC8::NewL( aBuf->Size() ); + TPtr8 ptr = iBuffer->Des(); + ptr.Copy( aBuf->Ptr() , aBuf->Size() ); + + // Now, we have the whole file content in iBuffer. + // We are ready to parse the XML content. + iParser->ParseBeginL(); + iParser->ParseL( *iBuffer ); + + // Since we read the whole file contents within one-shot, + // we can call ParseEndL() right after calling ParseL(). + iParser->ParseEndL(); + LOG("CXmlHandler::StartParsingL ,end"); + } + +// -------------------------------------------------------------------------- +// CXmlHandler::OnStartDocumentL() +// -------------------------------------------------------------------------- +void CXmlHandler::OnStartDocumentL( const RDocumentParameters& /*aDocParam*/, + TInt aErrorCode ) + { + LOG1("CXmlHandler::OnStartDocumentL ,Error code - %d", aErrorCode); + if( KErrNone != aErrorCode ) + { + iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); + } + else + { + // Do nothing + } + LOG("CXmlHandler::OnStartDocumentL ,end"); + } + +// -------------------------------------------------------------------------- +// CXmlHandler::OnEndDocumentL() +// -------------------------------------------------------------------------- +void CXmlHandler::OnEndDocumentL( TInt aErrorCode ) + { + LOG1("CXmlHandler::OnEndDocumentL ,Errcode - %d", aErrorCode); + iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); + } + +// -------------------------------------------------------------------------- +// CXmlHandler::OnStartElementL() +// -------------------------------------------------------------------------- +void CXmlHandler::OnStartElementL( const RTagInfo& aElement, + const RAttributeArray& /*aAttributes*/, TInt aErrorCode ) + { + LOG1("CXmlHandler::OnStartElementL , Errorcode - %d", aErrorCode); + if ( KErrNone == aErrorCode ) + { + // If we find the start of an element, we write to the screen, + // for example: "" + + if( !aElement.LocalName().DesC().Compare( KCountry ) ) + { + iCurrentElement = ECountryName; + } + else if( !aElement.LocalName().DesC().Compare( KState ) ) + { + iCurrentElement = EState; + } + else if( !aElement.LocalName().DesC().Compare( KCity ) ) + { + iCurrentElement = ECity; + } + else if( !aElement.LocalName().DesC().Compare( KDistrict ) ) + { + iCurrentElement = EDistrict; + } + else if( !aElement.LocalName().DesC().Compare( KPostalCode ) ) + { + iCurrentElement = EPostalCode; + } + else if( !aElement.LocalName().DesC().Compare( KThoroughfare ) ) + { + iThoroughfare = ETrue; + } + else if( !aElement.LocalName().DesC().Compare( KNameTag ) && iThoroughfare ) + { + iCurrentElement = EThoroughfareName; + } + else if( !aElement.LocalName().DesC().Compare( KNumberTag ) && iThoroughfare ) + { + iCurrentElement = EThoroughfareNumber; + } + else + { + ///Do something + } + } + else + { + iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); + } + LOG("CXmlHandler::OnStartElementL ,end"); + } + +// -------------------------------------------------------------------------- +// CXmlHandler::OnEndElementL() +// -------------------------------------------------------------------------- +void CXmlHandler::OnEndElementL( const RTagInfo& /*aElement*/, TInt aErrorCode ) + { + LOG1("CXmlHandler::OnEndElementL ,Error code - %d", aErrorCode); + if( KErrNone == aErrorCode ) + { + // at the end of the tag + //Set it to ENone + iCurrentElement = ENone; + iThoroughfare = EFalse; + } + else + { + iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); + } + } + +// -------------------------------------------------------------------------- +// CXmlHandler::OnContentL() +// -------------------------------------------------------------------------- +void CXmlHandler::OnContentL( const TDesC8 &aBytes, TInt aErrorCode ) + { + LOG1("CXmlHandler::OnContentL ,Errorcode - %d", aErrorCode); + if( KErrNone == aErrorCode ) + { + + if( iCurrentElement == ENone ) + { + //ignore if the current element is not there + return; + } + + // convert the content to UCS-2 + // from UTF-8 + RBuf buffer; + buffer.CreateL( aBytes.Length() ); + CleanupClosePushL(buffer); + CnvUtfConverter::ConvertToUnicodeFromUtf8( buffer , aBytes ); + + if( iCurrentElement == ECountryName ) + { + iAddressInfo->SetCountryName( buffer ); + } + else if( iCurrentElement == EState ) + { + iAddressInfo->SetState( buffer ); + } + else if( iCurrentElement == EDistrict ) + { + iAddressInfo->SetDistrict( buffer ); + } + else if( iCurrentElement == ECity ) + { + iAddressInfo->SetCity( buffer ); + } + else if( iCurrentElement == EPostalCode ) + { + iAddressInfo->SetPincode( buffer ); + } + else if( iCurrentElement == EThoroughfareName ) + { + iAddressInfo->SetThoroughfareName( buffer ); + } + else if( iCurrentElement == EThoroughfareNumber ) + { + iAddressInfo->SetThoroughfareNumber( buffer ); + } + else + { + ///Do something + } + CleanupStack::PopAndDestroy(); // buffer + } + else + { + iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); + } + LOG("CXmlHandler::OnContentL ,end"); + } + +// -------------------------------------------------------------------------- +// CXmlHandler::OnStartPrefixMappingL() +// -------------------------------------------------------------------------- +void CXmlHandler::OnStartPrefixMappingL( const RString& /*aPrefix*/, + const RString& /*aUri*/, TInt aErrorCode ) + { + LOG1("CXmlHandler::OnStartPrefixMappingL ,Error code - %d", aErrorCode); + if( KErrNone != aErrorCode ) + { + iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); + } + else + { + // Do nothing + } + } + +// -------------------------------------------------------------------------- +// CXmlHandler::OnEndPrefixMappingL() +// -------------------------------------------------------------------------- +void CXmlHandler::OnEndPrefixMappingL( const RString& /*aPrefix*/, TInt aErrorCode ) + { + LOG1("CXmlHandler::OnEndPrefixMappingL ,Error code - %d", aErrorCode); + if( KErrNone != aErrorCode ) + { + iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); + } + else + { + // Do nothing + } + } + +// -------------------------------------------------------------------------- +// CXmlHandler::OnIgnorableWhiteSpaceL() +// -------------------------------------------------------------------------- +void CXmlHandler::OnIgnorableWhiteSpaceL( const TDesC8& /*aBytes*/,TInt aErrorCode ) + { + LOG1("CXmlHandler::OnIgnorableWhiteSpaceL ,Error code - %d", aErrorCode); + if( KErrNone != aErrorCode ) + { + iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); + } + else + { + // Do nothing + } + } + +// -------------------------------------------------------------------------- +// CXmlHandler::OnSkippedEntityL() +// -------------------------------------------------------------------------- +void CXmlHandler::OnSkippedEntityL( const RString& /*aName*/, TInt aErrorCode ) + { + LOG1("CXmlHandler::OnSkippedEntityL ,Error code - %d", aErrorCode); + if( KErrNone != aErrorCode ) + { + iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); + } + else + { + // Do nothing + } + } + +// -------------------------------------------------------------------------- +// CXmlHandler::OnProcessingInstructionL() +// -------------------------------------------------------------------------- +void CXmlHandler::OnProcessingInstructionL( const TDesC8& /*aTarget*/, const TDesC8& /*aData*/, TInt aErrorCode ) + { + LOG1("CXmlHandler::OnProcessingInstructionL ,Error code - %d", aErrorCode); + if( KErrNone != aErrorCode ) + { + iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ); + } + else + { + // Do nothing + } + } + +// -------------------------------------------------------------------------- +// CXmlHandler::OnError() +// -------------------------------------------------------------------------- +void CXmlHandler::OnError( TInt aErrorCode ) + { + LOG1("CXmlHandler::OnError ,Error code - %d", aErrorCode); + TRAP_IGNORE( iObserver.OnParseCompletedL( aErrorCode, *iAddressInfo ) ); + } + +// -------------------------------------------------------------------------- +// CXmlHandler::GetExtendedInterface() +// -------------------------------------------------------------------------- +TAny* CXmlHandler::GetExtendedInterface( const TInt32 /*aUid*/ ) + { + return 0; + } + +// End of File diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/client/bwincw/locationmanagerclientwinscw.def --- a/locationmanager/client/bwincw/locationmanagerclientwinscw.def Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/client/bwincw/locationmanagerclientwinscw.def Thu Jul 22 16:38:01 2010 +0100 @@ -29,4 +29,10 @@ ?StopTrackLog@RTrackLog@@QAEXXZ @ 28 NONAME ; void RTrackLog::StopTrackLog(void) ?TrackLogName@RTrackLog@@QAEHAAVTDes16@@@Z @ 29 NONAME ; int RTrackLog::TrackLogName(class TDes16 &) ?LocationSnapshot@RLocationObjectManipulator@@QAEHK@Z @ 30 NONAME ; int RLocationObjectManipulator::LocationSnapshot(unsigned long) + ?GeoTagStaus@RLocationGeoTagger@@QAEXAAVTRequestStatus@@AAW4TGeoTaggingSatus@@@Z @ 31 NONAME ; void RLocationGeoTagger::GeoTagStaus(class TRequestStatus &, enum TGeoTaggingSatus &) + ?CancelGeoTaggingRequest@RLocationGeoTagger@@QAEXXZ @ 32 NONAME ; void RLocationGeoTagger::CancelGeoTaggingRequest(void) + ?StartGeoTagging@RLocationGeoTagger@@QAEXAAVTRequestStatus@@W4TConnectionOption@@@Z @ 33 NONAME ; void RLocationGeoTagger::StartGeoTagging(class TRequestStatus &, enum TConnectionOption) + ??1RLocationGeoTagger@@QAE@XZ @ 34 NONAME ; RLocationGeoTagger::~RLocationGeoTagger(void) + ??0RLocationGeoTagger@@QAE@XZ @ 35 NONAME ; RLocationGeoTagger::RLocationGeoTagger(void) + ?CancelTagPendingRequest@RLocationGeoTagger@@QAEXXZ @ 36 NONAME ; void RLocationGeoTagger::CancelTagPendingRequest(void) diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/client/eabi/locationmanagerclientarm.def --- a/locationmanager/client/eabi/locationmanagerclientarm.def Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/client/eabi/locationmanagerclientarm.def Thu Jul 22 16:38:01 2010 +0100 @@ -35,4 +35,12 @@ _ZTI19CTrackLogObserverAO @ 34 NONAME ABSENT; ## _ZTV19CTrackLogObserverAO @ 35 NONAME ABSENT; ## _ZN26RLocationObjectManipulator16LocationSnapshotEm @ 36 NONAME + _ZN18RLocationGeoTagger11GeoTagStausER14TRequestStatusR16TGeoTaggingSatus @ 37 NONAME + _ZN18RLocationGeoTagger15StartGeoTaggingER14TRequestStatus17TConnectionOption @ 38 NONAME + _ZN18RLocationGeoTagger23CancelGeoTaggingRequestEv @ 39 NONAME + _ZN18RLocationGeoTagger23CancelTagPendingRequestEv @ 40 NONAME + _ZN18RLocationGeoTaggerC1Ev @ 41 NONAME + _ZN18RLocationGeoTaggerC2Ev @ 42 NONAME + _ZN18RLocationGeoTaggerD1Ev @ 43 NONAME + _ZN18RLocationGeoTaggerD2Ev @ 44 NONAME diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/client/group/locationmanagerclient.mmp --- a/locationmanager/client/group/locationmanagerclient.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/client/group/locationmanagerclient.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -40,9 +40,10 @@ SOURCEPATH ../src SOURCE rlocationmanager.cpp SOURCE rlocationtrail.cpp -SOURCE rlocationobjectmanipulator.cpp -SOURCE CTrackLogObserverAO.cpp -SOURCE rtracklog.cpp +SOURCE rlocationobjectmanipulator.cpp +SOURCE CTrackLogObserverAO.cpp +SOURCE rtracklog.cpp +SOURCE rlocationgeotagger.cpp MW_LAYER_SYSTEMINCLUDE @@ -51,7 +52,10 @@ LIBRARY lbs.lib LIBRARY mdccommon.lib +DEBUGLIBRARY flogger.lib PAGED BYTEPAIRCOMPRESSTARGET OPTION ARMCC -O3 -OTime +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/client/src/rlocationgeotagger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/client/src/rlocationgeotagger.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2009 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:An interface to Location Manager geo tagger +* +*/ + +#include +#include +#include + +#include +#include "rlocationgeotagger.h" +#include "locationmanagerdefs.h" +#include "locationmanagerdebug.h" + +EXPORT_C RLocationGeoTagger::RLocationGeoTagger() + : iTagPendingData (NULL) + { + } + +EXPORT_C RLocationGeoTagger::~RLocationGeoTagger() + { + delete iTagPendingData; + } + +// -------------------------------------------------------------------------- +// RLocationGeoTagger::IsTagPending +// -------------------------------------------------------------------------- +// +EXPORT_C void RLocationGeoTagger::GeoTagStaus( TRequestStatus& aStatus, + TGeoTaggingSatus& aTagPendingFlag ) + { + LOG( "RLocationGeoTagger::IsTagPending(), begin" ); + + delete iTagPendingData; + iTagPendingData = new TPckg( aTagPendingFlag); + + if ( iHandle && iTagPendingData ) + { + SendReceive( ELocManTagPending, TIpcArgs( iTagPendingData ), aStatus ); + } + else + { + if ( !iTagPendingData ) + { + CompleteRequest(aStatus, KErrNoMemory); + } + else + { + CompleteRequest(aStatus, KErrDisconnected); + } + } + LOG( "RLocationGeoTagger::IsTagPending(), end" ); + } + +// -------------------------------------------------------------------------- +// RLocationGeoTagger::StartGeoTagging +// -------------------------------------------------------------------------- +// +EXPORT_C void RLocationGeoTagger::StartGeoTagging + (TRequestStatus& aStatus, const TConnectionOption aConnectionOption ) + { + LOG( "RLocationGeoTagger::StartGeoTaggingL(), begin" ); + + if ( iHandle ) + { + SendReceive( ELocManStartGeoTaging, TIpcArgs( aConnectionOption ), aStatus); + } + LOG( "RLocationGeoTagger::StartGeoTaggingL(), end" ); + } + +// -------------------------------------------------------------------------- +// RLocationGeoTagger::CancelTagPendingRequest +// -------------------------------------------------------------------------- +// +EXPORT_C void RLocationGeoTagger::CancelTagPendingRequest() + { + LOG( "RLocationGeoTagger::CancelTagPendingRequest(), begin" ); + + if ( iHandle ) + { + SendReceive( ELocManCancelTagPendingReq); + } + LOG( "RLocationGeoTagger::CancelTagPendingRequest(), end" ); + } + + +// -------------------------------------------------------------------------- +// RLocationGeoTagger::CancelTagPendingRequest +// -------------------------------------------------------------------------- +// +EXPORT_C void RLocationGeoTagger::CancelGeoTaggingRequest() + { + LOG( "RLocationGeoTagger::CancelGeoTaggingRequest(), begin" ); + if ( iHandle ) + { + SendReceive( ELocManCancelGeoTaggingReq); + } + LOG( "RLocationGeoTagger::CancelGeoTaggingRequest(), end" ); + } + + +//End of File diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geoconverter/bwincw/geoconverterwinscw.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geoconverter/bwincw/geoconverterwinscw.def Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,5 @@ +EXPORTS + ?ConvertL@CGeoConverter@@QAEXABVTNetworkInfoV1@CTelephony@@@Z @ 1 NONAME ; void CGeoConverter::ConvertL(class CTelephony::TNetworkInfoV1 const &) + ??1CGeoConverter@@UAE@XZ @ 2 NONAME ; CGeoConverter::~CGeoConverter(void) + ?NewL@CGeoConverter@@SAPAV1@AAVMGeoConverterObserver@@@Z @ 3 NONAME ; class CGeoConverter * CGeoConverter::NewL(class MGeoConverterObserver &) + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geoconverter/eabi/geoconverterarm.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geoconverter/eabi/geoconverterarm.def Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,9 @@ +EXPORTS + _ZN13CGeoConverter4NewLER21MGeoConverterObserver @ 1 NONAME + _ZN13CGeoConverter8ConvertLERKN10CTelephony14TNetworkInfoV1E @ 2 NONAME + _ZN13CGeoConverterD0Ev @ 3 NONAME + _ZN13CGeoConverterD1Ev @ 4 NONAME + _ZN13CGeoConverterD2Ev @ 5 NONAME + _ZTI13CGeoConverter @ 6 NONAME + _ZTV13CGeoConverter @ 7 NONAME + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geoconverter/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geoconverter/group/bld.inf Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file +* +*/ + +PRJ_PLATFORMS + DEFAULT + + +PRJ_MMPFILES +geoconverter.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geoconverter/group/geoconverter.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geoconverter/group/geoconverter.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2005-2009 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: Project definition file +* +*/ + + +#include +#include + +VERSION 10.0 +TARGET geoconverter.dll +TARGETTYPE DLL +UID 0x1000008d 0x2002E6A1 + +VENDORID VID_DEFAULT +CAPABILITY CAP_GENERAL_DLL + + +#if defined(WINSCW) +deffile ../bwincw/geoconverterwinscw.def +#elif defined(ARMCC) +deffile ../eabi/geoconverterarm.def +#endif +nostrictdef + + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + +SYSTEMINCLUDE /epoc32/include/stdapis +SYSTEMINCLUDE /epoc32/include/platform/lbs +MW_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../src +SOURCE cgeoconverter.cpp + + +LIBRARY euser.lib +LIBRARY etel3rdparty.lib + +#include "../../inc/locplatsupport.mmh" +#ifdef _LOC_GEOTAGGING_CELLID +MACRO LOC_GEOTAGGING_CELLID +LIBRARY lbslocationinfoconverter.lib +LIBRARY lbslocationinfodatatypes.lib +#endif +LIBRARY lbs.lib +DEBUGLIBRARY flogger.lib +LIBRARY libc.lib + +PAGED +BYTEPAIRCOMPRESSTARGET +OPTION ARMCC -O3 -OTime + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geoconverter/inc/cgeoconverter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geoconverter/inc/cgeoconverter.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2009 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: A class for converting CGI Info to lat, long. +* +*/ + +#ifndef C_GEOCONVERTER_H +#define C_GEOCONVERTER_H + +/** + * + * @since S60 9.2 + */ +#ifdef LOC_GEOTAGGING_CELLID +#include +#include +#endif +#include +#include + +class MGeoConverterObserver + { +public: + /** + * This method is used for notifying completion of geotagging + * @param aError error code + * @param aPosition position (lat/lon) for the correcponding n/w info + */ + virtual void ConversionCompletedL( const TInt aError, TLocality& aPosition ) = 0; + + /** + * This method is used to handle any error during conversion + * @param aError the error code + */ + virtual void HandleConversionError(TInt aError) = 0; + }; + +// Class to handle conversion operations +class CGeoConverter : public CBase +#ifdef LOC_GEOTAGGING_CELLID + , public MLbsLocationInfoConverterObserver +#endif + { +public: + /** + * 2-phased constructor. + */ + IMPORT_C static CGeoConverter* NewL( MGeoConverterObserver& aObserver ); + /** + * C++ destructor. + */ + IMPORT_C virtual ~CGeoConverter(); + + IMPORT_C void ConvertL( const CTelephony::TNetworkInfoV1& aNetworkInfo ); + +protected: + // From MLbsLocationInfoConverterObserver + void OnConversionComplete( TInt aStatusCode ); + +private: + /** + * C++ constructor. + */ + CGeoConverter( MGeoConverterObserver& aObserver ); + /** + * 2nd phase constructor. + */ + void ConstructL(); + +private: + MGeoConverterObserver& iObserver; +#ifdef LOC_GEOTAGGING_CELLID + CLbsLocationInfoConverter* iLocConverter; + CLbsLocationInfo* iLocInfo; + CLbsGsmCellInfo* iGsmCellInfo; + CLbsWcdmaCellInfo* iWcdmaCellInfo; +#endif + }; + +#endif // C_GEOCONVERTER_H + +// End of file. diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geoconverter/src/cgeoconverter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geoconverter/src/cgeoconverter.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,205 @@ +/* +* Copyright (c) 2009 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: A class for creating country and city tags for media files +* +*/ + +//#include "locationmanagerdebug.h" +#include "cgeoconverter.h" +#include "locationmanagerdebug.h" + + + +// -------------------------------------------------------------------------- +// CGeoConverter::NewL +// -------------------------------------------------------------------------- +// +EXPORT_C CGeoConverter* CGeoConverter::NewL( MGeoConverterObserver& aObserver ) + { + LOG("CGeoConverter::NewL"); + CGeoConverter* self = new( ELeave ) CGeoConverter( aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +// -------------------------------------------------------------------------- +// CGeoConverter::CGeoConverter() +// -------------------------------------------------------------------------- +// +CGeoConverter::CGeoConverter( MGeoConverterObserver& aObserver ) + :iObserver( aObserver ) +#ifdef LOC_GEOTAGGING_CELLID + ,iLocConverter(NULL), + iLocInfo(NULL), + iGsmCellInfo(NULL), + iWcdmaCellInfo(NULL) +#endif + { + } + +// -------------------------------------------------------------------------- +// CGeoConverter::~CGeoConverter +// -------------------------------------------------------------------------- +// +EXPORT_C CGeoConverter::~CGeoConverter() + { + LOG("CGeoConverter::~CGeoConverter, begin"); +#ifdef LOC_GEOTAGGING_CELLID + delete iGsmCellInfo; + delete iWcdmaCellInfo; + delete iLocInfo; + delete iLocConverter; +#endif + LOG("CGeoConverter::~CGeoConverter, end"); + } + +// -------------------------------------------------------------------------- +// CGeoConverter::OnConversionComplete() +// -------------------------------------------------------------------------- +// +void CGeoConverter::OnConversionComplete( TInt aStatusCode ) + { + LOG("CGeoConverter::OnConversionComplete, begin"); +#ifdef LOC_GEOTAGGING_CELLID + //16. Retrieve position estimate that is updated by Location Monitor server + //after a conversion operation is completed successfully. + RLbsAreaInfoBaseArray posInfoList; + TLocality position; + + + LOG1("Status Code - %d",aStatusCode); + + if( KErrNone == aStatusCode ) + { + TRAP_IGNORE(iLocInfo->GetAreaInfoL( posInfoList, CLbsLocationInfo::ELbsPosInfo );) + + //Get geo-coordinates. + + LOG1("PposInfoList Count - %d",posInfoList.Count()); + if ( posInfoList.Count() ) + { + static_cast(posInfoList[0])->GetLocality(position); + } + else + { + aStatusCode = KErrNotFound; + } + } + TRAPD(err,iObserver.ConversionCompletedL( aStatusCode, position);) + if(err != KErrNone) + { + iObserver.HandleConversionError(err); + } + posInfoList.Close(); +#endif + LOG("CGeoConverter::OnConversionComplete, end"); + } + +// -------------------------------------------------------------------------- +// CGeoConverter::ConstructL() +// -------------------------------------------------------------------------- +// +void CGeoConverter::ConstructL() + { + LOG("CGeoConverter::ConstructL, begin"); +#ifdef LOC_GEOTAGGING_CELLID + iLocInfo = CLbsLocationInfo::NewL(); + TUid pluginUid = TUid::Uid( 0x20027011 ); + LOG("CGeoConverter::ConstructL"); + iLocConverter = CLbsLocationInfoConverter::NewL( *this, pluginUid ); +#endif + LOG("CGeoConverter::ConstructL, end"); + } + +// -------------------------------------------------------------------------- +// CGeoConverter::ConvertL() +// -------------------------------------------------------------------------- +// +EXPORT_C void CGeoConverter::ConvertL( const CTelephony::TNetworkInfoV1& aNetworkInfo ) + { + LOG("CGeoConverter::ConvertL, begin"); +#ifdef LOC_GEOTAGGING_CELLID + + //Set mobile country code + TLex lexer( aNetworkInfo.iCountryCode ); + TUint countryCode; + + User::LeaveIfError( lexer.Val( countryCode, EDecimal) ); + //Set mobile network code + lexer = aNetworkInfo.iNetworkId; + TUint networkCode; + User::LeaveIfError( lexer.Val( networkCode, EDecimal) ); + LOG1("Network mode - %d", aNetworkInfo.iMode); + CLbsAreaInfoBase* areaInfoBase = NULL; + switch(aNetworkInfo.iAccess) + { + case CTelephony::ENetworkAccessGsm: + case CTelephony::ENetworkAccessGsmCompact: + { + LOG("2G network."); + if(iGsmCellInfo == NULL) + { + iGsmCellInfo = CLbsGsmCellInfo::NewL(); + } + iGsmCellInfo->SetMobileCountryCode( countryCode ); + + iGsmCellInfo->SetMobileNetworkCode( networkCode ); + //Set cell id + iGsmCellInfo->SetCellId( aNetworkInfo.iCellId ); + + if(aNetworkInfo.iAreaKnown) + { + //Set location area code + iGsmCellInfo->SetLocationAreaCode( aNetworkInfo.iLocationAreaCode ); + } + + areaInfoBase = iGsmCellInfo; + } + break; + case CTelephony::ENetworkAccessUtran: + { + LOG("3G network."); + if(iWcdmaCellInfo == NULL) + { + iWcdmaCellInfo = CLbsWcdmaCellInfo::NewL(); + } + iWcdmaCellInfo->SetMobileCountryCode(countryCode); + iWcdmaCellInfo->SetMobileNetworkCode(networkCode); + iWcdmaCellInfo->SetUniqueCellId(aNetworkInfo.iCellId); + areaInfoBase = iWcdmaCellInfo; + } + break; + default: + LOG("Unknown network mode"); + User::Leave(KErrNotSupported); + break; + } + //Add the cell information to the location info class. This class + //would be sent to the Location Monitor server that would perform the + //requested conversion and update the position estimate + if(areaInfoBase != NULL) // self check + { + iLocInfo->AddAreaInfoL( areaInfoBase ); + //Request conversion of GSM cell information to corresponding coordinate information + iLocConverter->ConvertLocationInfoL( *iLocInfo, ELbsConversionSilent, + ELbsConversionOutputPosition ); + } +#endif + LOG("CGeoConverter::ConvertL, end"); + } + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geotagger/bwins/geotagger.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geotagger/bwins/geotagger.def Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,5 @@ +EXPORTS + ?NewL@CInternalGeoTagger@@SAPAV1@PAVCMdESession@@PAVMGeoTaggerObserver@@@Z @ 1 NONAME ; class CInternalGeoTagger * CInternalGeoTagger::NewL(class CMdESession *, class MGeoTaggerObserver *) + ?NewL@CGeoTagger@@SAPAV1@PAVMGeoTaggerObserver@@PAVCMdESession@@@Z @ 2 NONAME ; class CGeoTagger * CGeoTagger::NewL(class MGeoTaggerObserver *, class CMdESession *) + ??1CInternalGeoTagger@@UAE@XZ @ 3 NONAME ; CInternalGeoTagger::~CInternalGeoTagger(void) + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geotagger/eabi/geotaggerarm.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geotagger/eabi/geotaggerarm.def Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,6 @@ +EXPORTS + _ZN10CGeoTagger4NewLEP18MGeoTaggerObserverP11CMdESession @ 1 NONAME + _ZN18CInternalGeoTagger4NewLEP11CMdESessionP18MGeoTaggerObserver @ 2 NONAME + _ZTI18CInternalGeoTagger @ 3 NONAME + _ZTV18CInternalGeoTagger @ 4 NONAME + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geotagger/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geotagger/group/bld.inf Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005-2009 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: Build information file +* +*/ + +PRJ_PLATFORMS + DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +geotagger.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geotagger/group/geotagger.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geotagger/group/geotagger.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2005-2009 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: Project definition file +* +*/ + +#include +#include +#include "../../inc/locplatsupport.mmh" + +VERSION 10.0 +TARGET geotagger.dll +TARGETTYPE DLL +UID 0x1000008d 0x2002700E + +VENDORID VID_DEFAULT +CAPABILITY CAP_GENERAL_DLL + +#if defined(WINSCW) +#elif defined(ARMCC) +deffile ../eabi/geotaggerarm.def +#endif +nostrictdef + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc + + +USERINCLUDE ../../tagcreator/inc + +#ifdef _LOC_GEOTAGGING_CELLID +MACRO LOC_GEOTAGGING_CELLID +USERINCLUDE ../../geoconverter/inc +#endif + +USERINCLUDE ../../reversegeocode/inc +USERINCLUDE ../../reversegeocoderplugin/inc + + +SOURCEPATH ../src +SOURCE cgeotagger.cpp +SOURCE cinternalgeotagger.cpp + +MW_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/platform/lbs +SYSTEMINCLUDE /epoc32/include/stdapis + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY lbs.lib +LIBRARY mdeclient.lib +LIBRARY etel3rdparty.lib +LIBRARY estor.lib +LIBRARY platformenv.lib + +DEBUGLIBRARY flogger.lib +LIBRARY tagcreator.lib +LIBRARY ecom.lib +LIBRARY libc.lib + +LIBRARY reversegeocode.lib + + +#ifdef _LOC_GEOTAGGING_CELLID +LIBRARY geoconverter.lib +#endif + + +PAGED +BYTEPAIRCOMPRESSTARGET +OPTION ARMCC -O3 -OTime + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geotagger/inc/cinternalgeotagger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geotagger/inc/cinternalgeotagger.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,290 @@ +/* +* Copyright (c) 2009 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: A class responsible for geotagging of media files in background. +* +*/ + +#ifndef C_CINTERNALGEOTAGGER_H +#define C_CINTERNALGEOTAGGER_H + +#include +#include +#include +#include +#include + +#include "reversegeocode.h" +#include "mdccommon.h" +#include "mdesession.h" +#include "mdenamespacedef.h" +#include "mdeobjectdef.h" +#include "mdepropertydef.h" +#include "mderelation.h" +#include "mdequery.h" +#include "ctagcreator.h" + +#ifdef LOC_GEOTAGGING_CELLID +#include "cgeoconverter.h" +#endif + +class CReverseGeoCoderPlugin; + +/** + * GeoTagger converts a given cell ID(CGI Info) to geo-coordinates. + * Does reverse geocoding to get country and city name. + * Creates country and city tag for image/video files. + * @since S60 9.2 + */ + +class CInternalGeoTagger : public CGeoTagger, + public MMdESessionObserver, + public MMdEQueryObserver, + public MReverseGeocodeObserver +#ifdef LOC_GEOTAGGING_CELLID + ,public MGeoConverterObserver +#endif + { +public: + + /** + * 2-phased constructor. + * @param aMdeSession An instance of the CMdESession + * @param aObserver The observer that is to be notified when geotagging is over + */ + IMPORT_C static CInternalGeoTagger* NewL( CMdESession* aMdeSession, + MGeoTaggerObserver* aObserver ); + + /** + * C++ destructor. + */ + IMPORT_C virtual ~CInternalGeoTagger(); + + +public: //exported API + // CGeoTagger + /** + * Harvests location tags. + * @param aObserver, observer for geotagging. + * @return None. + */ + virtual void CreateGeoTagsL( const TConnectionOption = EInteractive ); + + /** + * Checks if there is any untagged photos with location info and tags them. + * @param aTagInProgress, boolean value to indicate if geotagging is in progress. + * @return None. + */ + virtual void PendingGeoTagsL( TBool aTagInProgress ); + +public: //observer methods + + // From MMdEQueryObserver + + /** + * @param aQuery the query type + * @param aFirstNewItemIndex The new item index + * @param aNewItemCount The new item count + */ + void HandleQueryNewResults(CMdEQuery& aQuery, TInt aFirstNewItemIndex, + TInt aNewItemCount); + + /** + * This method is called on completion of a query + * @param aQuery the query type + * @param aError Error if any + */ + void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError); + + //MReverseGeocodeObserver + + /** + * This method is called when reverse geocoding is completed + *@param aErrorcode Error if any + *@param aAddressInfo the reverse geocoded address + */ + void ReverseGeocodeComplete( TInt& aErrorcode, MAddressInfo& aAddressInfo ); + + /* + * Get registrer network country code + * + * @return current register n/w info + */ + RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw(); + + /* + * UE is registered to home network? + * + * @return ETrue if UE is registered at home network else EFalse + */ + TBool IsRegisteredAtHomeNetwork(); + + + /* + * Get home network country code + * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse + * @return user home n/w info + */ + const RMobilePhone::TMobilePhoneNetworkInfoV1& + GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag); + + + // From MMdESessionObserver + + /** + * Handles session opening + *@param aSession A reference of the CMdESession + *@param aError error if any + */ + void HandleSessionOpened(CMdESession& aSession, TInt aError); + + /** + * Handles any error in session opening + *@param aSession A reference of the CMdESession + *@param aError error if any + */ + void HandleSessionError(CMdESession& aSession, TInt aError); + +#ifdef LOC_GEOTAGGING_CELLID +public: // MGeoConverterObserver + /** + * This method is used for notifying completion of geotagging + * @param aError error code + * @param aPosition position (lat/lon) for the correcponding n/w info + */ + void ConversionCompletedL( const TInt aError, TLocality& aPosition ); + + + /** + * This method is used to handle the conversion error + * @param aError the error code + */ + void HandleConversionError(TInt aError); + +#endif +private: + + /** + * C++ constructor. + * @param aMdeSession An instance of the CMdESession + * @param aObserver The observer that is to be notified when geotagging is over + */ + CInternalGeoTagger( CMdESession* aMdeSession, MGeoTaggerObserver* aObserver ); + + /** + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * Get all relation objects associated with this location + * @param aLocID The locationId whose relation is to be fetched + */ + void GetRelationObjectsL(TItemId aLocID); + + /** + * get tags for this image + * @param aImageID The imageIs whose tag is to be fetched + */ + void GetTagsL( TItemId aImageID ); + + /** + * Get location objects, where lat, long not populated. + */ + void GetAllLocationsL( ); + + /** + * Get location objects, where lat, long not populated. + * @param aCountryTagId The country tagId + * @param aCityTagId The city tagId + */ + void AddressInfoL( const TItemId aCountryTagId, const TItemId aCityTagId ); + + /** + * checks if the session is ready + * @return ETrue If the session is ready + */ + TBool IsSessionReady(); + + /** + * Fetches the location information + */ + void GetLocationInfoL(); + + /** + * starts geotagging of objects + */ + void StartGeoTaggingL(); + + /** + * Checks if Location atg exists for an object + * @return ETrue if location tag is found + */ + TBool LocationTagExists(); + + /** + * Moves to the next location for reverse geocoding + */ + void IterateNextLocation(); + + /** + * @return ETrue if item had valid lat/lon else EFalse + */ + TBool GPSInfoExists(); +private: + /** + * A session to Metadata Engine for creating and manipulating location objects. + */ + CMdESession* iMdeSession; + + /** + * This query object is used to find existing locations + */ + CMdEObjectQuery* iLocationQuery; + /** @var iRelationQuery. */ + CMdERelationQuery* iRelationQuery; + CMdERelationQuery* iTagQuery; + + TInt iIndex; + + TBool iSessionReady; + + MGeoTaggerObserver* iObserver; + + TLocationData iLocationData; + + TItemId iLocationId; + + TConnectionOption iConnectionOption; + + CTagCreator* iTagCreator; + + /** + * An active scheduler wait loop for waiting a session to MdE to open. + */ + CActiveSchedulerWait* iASW; + TBool iMdeSessionOwnFlag; + TBool iTagPendingHandlerFlag; + CReverseGeoCoderPlugin* iRevGeocoderPlugin; + TUid iDtorKey; +#ifdef LOC_GEOTAGGING_CELLID + /* + * Geo converter + */ + CGeoConverter* iGeoConverter; +#endif + }; + +#endif // C_CGEOTAGGER_H + +// End of file. diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geotagger/src/cgeotagger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geotagger/src/cgeotagger.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2009 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: A class responsible for geotagging of media files in background. +* +*/ + +#include +#include "cinternalgeotagger.h" +#include "locationmanagerdebug.h" + + +// -------------------------------------------------------------------------- +// CGeoTagger::NewL +// -------------------------------------------------------------------------- +// +EXPORT_C CGeoTagger* CGeoTagger::NewL( MGeoTaggerObserver* aObserver, + CMdESession* aMdeSession) + { + LOG("CGeoTagger::NewL, begin"); + CInternalGeoTagger* self = CInternalGeoTagger::NewL( aMdeSession, aObserver ); + + return self; + } + + + +// End of file diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/geotagger/src/cinternalgeotagger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/geotagger/src/cinternalgeotagger.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,813 @@ +/* +* Copyright (c) 2009 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: A class responsible for geotagging of media files in background. +* +*/ + +#include +#include +#include +#include + +#include "locationmanagerdebug.h" +#include "mdeconstants.h" +#include "mdesession.h" +#include "cinternalgeotagger.h" +#include "reversegeocoderplugin.h" + +using namespace MdeConstants; + +_LIT ( KCountry, "country:"); // country:india +const TUid KReverseGeoCodeUid = {0x2002DD12}; + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::NewL +// -------------------------------------------------------------------------- +// +EXPORT_C CInternalGeoTagger* CInternalGeoTagger::NewL( CMdESession* aMdeSession, + MGeoTaggerObserver* aObserver ) + { + CInternalGeoTagger* self = + new (ELeave) CInternalGeoTagger( aMdeSession, aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::CInternalGeoTagger +// -------------------------------------------------------------------------- +// +CInternalGeoTagger::CInternalGeoTagger( CMdESession* aMdeSession, + MGeoTaggerObserver* aObserver ) + : iMdeSession(aMdeSession), + iLocationQuery(NULL), + iRelationQuery(NULL), + iTagQuery(NULL), + iIndex(0), + iSessionReady( EFalse ), + iObserver( aObserver ), + iTagCreator(NULL), + iASW(NULL), + iTagPendingHandlerFlag(EFalse), + iRevGeocoderPlugin(NULL) +#ifdef LOC_GEOTAGGING_CELLID + ,iGeoConverter(NULL) +#endif + { + iMdeSessionOwnFlag = (iMdeSession == NULL); + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::ConstructL +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::ConstructL() + { + LOG("CInternalGeoTagger::ConstructL ,begin"); + if(iMdeSession != NULL) + { + LOG("Not owning mds session"); + iMdeSessionOwnFlag = EFalse; + //object is not owning iMdeSession + iTagCreator = CTagCreator::NewL(); + iSessionReady = ETrue; + + iTagCreator->SetSession( iMdeSession ); + } + else + { + iMdeSessionOwnFlag = ETrue; + iASW = new (ELeave) CActiveSchedulerWait(); + iMdeSession = CMdESession::NewL( *this ); + //for creating tags + iTagCreator = CTagCreator::NewL(); + + iASW->Start(); + delete iASW; + iASW = NULL; + } + + //for reverse geocoding (geo-tagging) + + if (!iRevGeocoderPlugin) + { + + TRAP_IGNORE( + iRevGeocoderPlugin = reinterpret_cast( + REComSession::CreateImplementationL(KReverseGeoCodeUid, iDtorKey));) + + if(iRevGeocoderPlugin) + { + iRevGeocoderPlugin->AddObserverL(*this); + + } + + } + + LOG("CInternalGeoTagger::ConstructL ,end"); + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::~CInternalGeoTagger +// -------------------------------------------------------------------------- +// +CInternalGeoTagger::~CInternalGeoTagger() + { + LOG("CInternalGeoTagger::~CInternalGeoTagger ,begin"); +#ifdef LOC_GEOTAGGING_CELLID + if(iGeoConverter) + { + delete iGeoConverter; + iGeoConverter = NULL; + } +#endif + if(iRelationQuery) + { + iRelationQuery->RemoveObserver(*this); + iRelationQuery->Cancel(); + delete iRelationQuery; + } + if(iLocationQuery) + { + iLocationQuery->RemoveObserver(*this); + iLocationQuery->Cancel(); + delete iLocationQuery; + } + if(iTagQuery) + { + iTagQuery->RemoveObserver(*this); + iTagQuery->Cancel(); + delete iTagQuery; + } + delete iRevGeocoderPlugin; + iRevGeocoderPlugin = NULL; + REComSession::DestroyedImplementation(iDtorKey); + if(iMdeSessionOwnFlag) + { + delete iMdeSession; + delete iASW; + } + LOG("CInternalGeoTagger::~CInternalGeoTagger ,end"); + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::CreateGeoTags +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::CreateGeoTagsL( const TConnectionOption aOption ) + { + LOG("CInternalGeoTagger::CreateGeoTagsL ,begin"); + if ( !IsSessionReady() ) + { + User::Leave( KErrNotReady ); + } + + iConnectionOption = aOption; + iIndex = 0; + GetAllLocationsL(); + + LOG("CInternalGeoTagger::CreateGeoTagsL ,end"); + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::HandleSessionOpened +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::HandleSessionOpened(CMdESession& /*aSession*/, TInt aError) + { + LOG("CInternalGeoTagger::HandleSessionOpened ,begin"); + if ( iMdeSessionOwnFlag && iASW && iASW->IsStarted() ) + { + iASW->AsyncStop(); + } + + if ( KErrNone == aError ) + { + iSessionReady = ETrue; + + iTagCreator->SetSession( iMdeSession ); + } + else if(iMdeSessionOwnFlag) + { + delete iMdeSession; + iMdeSession = NULL; + } + LOG("CInternalGeoTagger::HandleSessionOpened ,end"); + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::HandleSessionError +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::HandleSessionError(CMdESession& /*aSession*/, TInt /*aError*/) + { + LOG("CInternalGeoTagger::HandleSessionError ,begin"); + if ( iMdeSessionOwnFlag && iASW && iASW->IsStarted() ) + { + iASW->AsyncStop(); + } + iSessionReady = EFalse; + if(iMdeSessionOwnFlag) + { + delete iMdeSession; + iMdeSession = NULL; + } + LOG("CInternalGeoTagger::HandleSessionError ,end"); + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::IsSessionReady +// -------------------------------------------------------------------------- +// +TBool CInternalGeoTagger::IsSessionReady() + { + return iSessionReady; + } + + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::GetRelationObjectsL() +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::GetRelationObjectsL(TItemId aLocID) + { + LOG("CInternalGeoTagger::GetRelationObjectsL ,begin"); + CMdENamespaceDef& namespaceDef = iMdeSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& imageObjDef = namespaceDef.GetObjectDefL( Image::KImageObject ); + + if(iRelationQuery) + { + iRelationQuery->RemoveObserver(*this); + iRelationQuery->Cancel(); + delete iRelationQuery; + iRelationQuery = NULL; + } + + iRelationQuery = iMdeSession->NewRelationQueryL( namespaceDef, this ); + User::LeaveIfNull( iRelationQuery ); + + iRelationQuery->SetResultMode( EQueryResultModeItem ); + + // both left and right condition must match + CMdERelationCondition& filterCond = iRelationQuery->Conditions(). + AddRelationConditionL( ERelationConditionSideRight ); + + // left one must be any image object. + filterCond.LeftL().AddObjectConditionL( imageObjDef ); + + // right one must be this location object + filterCond.RightL().AddObjectConditionL( aLocID ); + + iRelationQuery->FindL(); // results to a call to HandleQueryCompleted() + LOG("CInternalGeoTagger::GetRelationObjectsL ,end"); + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::HandleQueryNewResults() +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::HandleQueryNewResults(CMdEQuery& /*aQuery*/, TInt /*aFirstNewItemIndex*/, + TInt /*aNewItemCount*/) + { + LOG("CInternalGeoTagger::HandleQueryNewResults ,begin"); + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::HandleQueryCompleted() +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::HandleQueryCompleted(CMdEQuery& aQuery, TInt aError) + { + LOG("CInternalGeoTagger::HandleQueryCompleted ,begin"); + + TInt count = aQuery.Count(); + LOG1("CInternalGeoTagger::HandleQueryCompleted count: %d", count); + + if ( &aQuery == iLocationQuery ) + { + if ( count ) + { + iLocationId = iLocationQuery->ResultId( iIndex++ ); + TRAP_IGNORE( GetRelationObjectsL( iLocationId ) ); + } + else + { + iIndex = 0; + iObserver->GeoTaggingCompleted( aError ); + if(iTagPendingHandlerFlag) + { + iTagPendingHandlerFlag = EFalse; + iObserver->PendingGeoTagReqComplete(KErrNone); + } + } + } + else if ( &aQuery == iRelationQuery ) + { + //if it is a relation query, then update gps info of location object. + + if ( iRelationQuery->Count() ) + { + TInt err = KErrNone; + TRAP(err, StartGeoTaggingL( ) ); + if(err != KErrNone) + { + IterateNextLocation(); + } + } + else + { + IterateNextLocation(); + } + + } + + else if ( &aQuery == iTagQuery ) + { + + if ( LocationTagExists() ) //nothing to do for this location + { + IterateNextLocation(); //Go through next location + } + else //do reverse geocoding + { + if(iTagPendingHandlerFlag) + { + iIndex = 0; + iTagPendingHandlerFlag = EFalse; + iObserver->PendingGeoTagReqComplete(KErrNotFound); + return; + } + + //Find the address for this geo-coordinate + if(GPSInfoExists()) + { + // GPS info exist go for reverse geo coding. + if(iRevGeocoderPlugin) + { + TRAP_IGNORE( + iRevGeocoderPlugin->GetAddressByCoordinateL + ( iLocationData.iPosition, iConnectionOption ) ); + } + else + { + IterateNextLocation(); //Go through next location + } + } + else + { + if ( iLocationData.iNetworkInfo.iCellId > 0 && + iLocationData.iNetworkInfo.iLocationAreaCode > 0 && + iLocationData.iNetworkInfo.iCountryCode.Length() > 0 && + iLocationData.iNetworkInfo.iNetworkId.Length() > 0 ) + { + // valid n/w information.. go for cell id based geo coding. +#ifdef LOC_GEOTAGGING_CELLID + TInt err = KErrNone; + if(iGeoConverter == NULL) + { + TRAP(err, iGeoConverter = CGeoConverter::NewL(*this)); + } + + if(err == KErrNone && iGeoConverter != NULL) + { + TRAP(err, iGeoConverter->ConvertL(iLocationData.iNetworkInfo);) + } + if(err != KErrNone) + { + HandleConversionError(err); + } +#else + IterateNextLocation(); //Go through next location +#endif + } + else + { + IterateNextLocation(); //Go through next location + } + } + } + + } + + LOG("CInternalGeoTagger::HandleQueryCompleted ,end"); + } + + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::GPSInfoExists() +// -------------------------------------------------------------------------- +// +TBool CInternalGeoTagger::GPSInfoExists() + { + LOG("CInternalGeoTagger::GPSInfoExists"); + TBool gpsInfoExists = EFalse; + if ( !Math::IsNaN( iLocationData.iPosition.Latitude() ) && + !Math::IsNaN( iLocationData.iPosition.Longitude() )) //lat, long is there + { + + LOG("Valid lat/lon\n"); + gpsInfoExists = ETrue; + } + return gpsInfoExists; + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::StartGeoTagging() +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::StartGeoTaggingL( ) + { + LOG("CInternalGeoTagger::StartGeoTaggingL ,start"); + GetLocationInfoL(); + + CMdERelation& relation = iRelationQuery->Result( 0 ); + + GetTagsL( relation.LeftObjectId() ); + + LOG("CInternalGeoTagger::StartGeoTaggingL ,end"); + } +// -------------------------------------------------------------------------- +// CInternalGeoTagger::GetLocationInfoL() +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::GetLocationInfoL() + { + LOG("CInternalGeoTagger::GetLocationInfoL, begin"); + + CMdENamespaceDef& namespaceDef = iMdeSession->GetDefaultNamespaceDefL(); + + CMdEObjectDef& locationObjectDef = namespaceDef.GetObjectDefL( Location::KLocationObject ); + + CMdEPropertyDef& latitudeDef = locationObjectDef.GetPropertyDefL( + Location::KLatitudeProperty ); + CMdEPropertyDef& longitudeDef = locationObjectDef.GetPropertyDefL( + Location::KLongitudeProperty ); + CMdEPropertyDef& cellIdDef = locationObjectDef.GetPropertyDefL( + Location::KCellIdProperty ); + CMdEPropertyDef& lacCodeDef = locationObjectDef.GetPropertyDefL( + Location::KLocationAreaCodeProperty ); + CMdEPropertyDef& countryCodeDef = locationObjectDef.GetPropertyDefL( + Location::KCountryCodeProperty ); + CMdEPropertyDef& networkCodeDef = locationObjectDef.GetPropertyDefL( + Location::KNetworkCodeProperty ); + + CMdEObject* locationObject = NULL; + CMdEProperty* latProp = NULL; + CMdEProperty* lonProp = NULL; + CMdEProperty* cellProp = NULL; + CMdEProperty* lacProp = NULL; + CMdEProperty* countryProp = NULL; + CMdEProperty* networkProp = NULL; + + locationObject = iMdeSession->GetObjectL( iLocationId, locationObjectDef ); + + locationObject->Property( latitudeDef, latProp, 0 ); + locationObject->Property( longitudeDef, lonProp, 0 ); + if ( latProp && lonProp ) + { + iLocationData.iPosition.SetCoordinate( latProp->Real64ValueL(), + lonProp->Real64ValueL() ); + } + + locationObject->Property( cellIdDef, cellProp, 0 ); + locationObject->Property( lacCodeDef, lacProp, 0 ); + locationObject->Property( countryCodeDef, countryProp, 0 ); + locationObject->Property( networkCodeDef, networkProp, 0 ); + if ( cellProp && lacProp && countryProp && networkProp) + { + iLocationData.iNetworkInfo.iCellId = cellProp->Uint32ValueL(); + iLocationData.iNetworkInfo.iLocationAreaCode = lacProp->Uint32ValueL(); + iLocationData.iNetworkInfo.iCountryCode = countryProp->TextValueL(); + iLocationData.iNetworkInfo.iNetworkId = networkProp->TextValueL(); + + } + + LOG("CInternalGeoTagger::GetLocationInfoL ,end"); + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::LocationTagExists() +// -------------------------------------------------------------------------- +// +TBool CInternalGeoTagger::LocationTagExists() + { + LOG("CInternalGeoTagger::LocationTagExists ,begin"); + + TBool tagFound = EFalse; + TInt error = KErrNone; + const TInt count = iTagQuery->Count(); + + for ( TInt i = 0; i < count; i++ ) + { + CMdERelation& relation = static_cast( iTagQuery->ResultItem( i ) ); + + TItemId tagId = relation.RightObjectId(); + CMdEObject* object = NULL; + TRAP_IGNORE( object = iMdeSession->GetObjectL( tagId ) ); + + error = object->Uri().Find( KCountry ); + if ( error == KErrNone ) + { + i = count; + tagFound = ETrue; + } + } + + + LOG("CInternalGeoTagger::LocationTagExists ,end"); + return tagFound; + + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::AddressInfo() +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::AddressInfoL( const TItemId aCountryTagId, const TItemId aCityTagId ) + { + LOG("CInternalGeoTagger::AddressInfoL ,begin"); + + const TInt count = iRelationQuery->Count(); + + for ( TInt i = 0; i < count; i++ ) + { + CMdERelation& relation = iRelationQuery->Result( i ); + TItemId imageId = relation.LeftObjectId(); + + if ( !GPSInfoExists() ) //to update EXIF + { + // update relation timestamp, composer will then update exif data + TTime timestamp( 0 ); + timestamp.UniversalTime(); + relation.SetLastModifiedDate( timestamp ); + iMdeSession->UpdateRelationL( relation ); + } + + iTagCreator->AttachTagsL( imageId, aCountryTagId, aCityTagId ); + } + + LOG("CInternalGeoTagger::AddressInfoL ,end"); + } + + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::IterateNextLocation() +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::IterateNextLocation() + { + LOG("CInternalGeoTagger::IterateNextLocation ,begin"); + + if (iIndex < iLocationQuery->Count()) + { + iLocationId = iLocationQuery->ResultId( iIndex++ ); + TRAP_IGNORE( GetRelationObjectsL( iLocationId ) ); + } + else + { + if ( iObserver ) + { + iIndex = 0; + TInt error = KErrNone; + iObserver->GeoTaggingCompleted( error ); + if(iTagPendingHandlerFlag) + { + iTagPendingHandlerFlag = EFalse; + iObserver->PendingGeoTagReqComplete(KErrNone); + } + } + } + LOG("CInternalGeoTagger::IterateNextLocation ,end"); + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::GetAllLocationsL() +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::GetAllLocationsL() + { + LOG("CInternalGeoTagger::GetAllLocationsL ,begin"); + + CMdENamespaceDef& defaultNamespaceDef = iMdeSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& locObjDef = defaultNamespaceDef.GetObjectDefL( + MdeConstants::Location::KLocationObject ); + CMdEPropertyDef& cellIdPropDef = locObjDef.GetPropertyDefL( + MdeConstants::Location::KCellIdProperty ); + + if(iLocationQuery) + { + iLocationQuery->RemoveObserver(*this); + iLocationQuery->Cancel(); + delete iLocationQuery; + iLocationQuery = NULL; + } + // query objects with object definition "Image" + iLocationQuery = iMdeSession->NewObjectQueryL( defaultNamespaceDef, locObjDef, this ); + + //Define the result order + iLocationQuery->AppendOrderRuleL(TMdEOrderRule(cellIdPropDef, ESortAscending)); + + iLocationQuery->SetResultMode( EQueryResultModeId ); + iLocationQuery->FindL(); + + LOG("CInternalGeoTagger::GetAllLocationsL ,end"); + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::ReverseGeocodeComplete() +// Get address details like street, city, state, etc. +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::ReverseGeocodeComplete( TInt& aErrorcode, MAddressInfo& aAddressInfo ) + { + LOG("CInternalGeoTagger::ReverseGeocodeComplete ,begin"); + TItemId countryTagId(0); + TItemId cityTagId(0); + + // create country and city tags + if( aErrorcode == KErrNone ) + { + TPtrC countryPtr( aAddressInfo.GetCountryName() ); + TPtrC cityPtr( aAddressInfo.GetCity() ); + + TRAP_IGNORE( iTagCreator->CreateLocationTagsL( countryPtr, countryTagId, cityPtr, cityTagId ) ); + + TRAP_IGNORE(AddressInfoL( countryTagId, cityTagId )); + + IterateNextLocation(); + } + else + { + //handle error + if ( iObserver ) + { + iIndex = 0; + iObserver->GeoTaggingCompleted( aErrorcode ); + } + } + + + LOG("CInternalGeoTagger::ReverseGeocodeComplete ,end"); + } + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::GetTagsL() +// Get tags related to this image/video object +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::GetTagsL( TItemId aImageID ) + { + LOG("CInternalGeoTagger::GetTagsL ,begin"); + CMdENamespaceDef& namespaceDef = iMdeSession->GetDefaultNamespaceDefL(); + CMdEObjectDef& tagObjectDef = namespaceDef.GetObjectDefL( Tag::KTagObject ); + + if(iTagQuery) + { + iTagQuery->RemoveObserver(*this); + iTagQuery->Cancel(); + delete iTagQuery; + iTagQuery = NULL; + } + + iTagQuery = iMdeSession->NewRelationQueryL( namespaceDef, this ); + User::LeaveIfNull( iTagQuery ); + + iTagQuery->SetResultMode( EQueryResultModeItem ); + + // both left and right condition must match + CMdERelationCondition& filterCond = iTagQuery->Conditions(). + AddRelationConditionL( ERelationConditionSideRight ); + + // left one must be this image object. + filterCond.LeftL().AddObjectConditionL( aImageID ); + + // right one must be tag object + filterCond.RightL().AddObjectConditionL( tagObjectDef ); + + iTagQuery->FindL(); // results to a call to HandleQueryCompleted() + LOG("CInternalGeoTagger::GetTagsL ,end"); + } + +#ifdef LOC_GEOTAGGING_CELLID +// -------------------------------------------------------------------------- +// CInternalGeoTagger::ConversionCompletedL() +// -------------------------------------------------------------------------- +// + +void CInternalGeoTagger::ConversionCompletedL( const TInt aError, + TLocality& aPosition ) + { + LOG1("CInternalGeoTagger::ConversionCompletedL, begin. Error - %d", aError); + if(aError == KErrNone) + { + iLocationData.iPosition.SetCoordinate + ( aPosition.Latitude(), aPosition.Longitude()); + if(iRevGeocoderPlugin) + { + iRevGeocoderPlugin->GetAddressByCoordinateL + ( iLocationData.iPosition, iConnectionOption ) ; + } + else + { + IterateNextLocation(); //Go through next location + } + } + else + { + IterateNextLocation(); //Go through next location + } + LOG("CInternalGeoTagger::ConversionCompletedL, end"); + } + + +//----------------------------------------------------------------- +// CInternalGeoTagger::HandleConversionError +//------------------------------------------------------------------ +// +void CInternalGeoTagger::HandleConversionError(TInt aError) + { + LOG("CInternalGeoTagger::HandleConversionError, begin"); + ARG_USED(aError); + IterateNextLocation(); //Go through next location + LOG("CInternalGeoTagger::HandleConversionError, end"); + } + +#endif + +// -------------------------------------------------------------------------- +// CInternalGeoTagger::PendingGeoTagsL() +// Is there any untagged photos with location info?. +// -------------------------------------------------------------------------- +// +void CInternalGeoTagger::PendingGeoTagsL( TBool aTagInProgress ) + { + LOG("CInternalGeoTagger::PendingGeoTagsL ,begin"); + iIndex = 0; + if ( aTagInProgress ) + { + //Tagging is going through location trail, so photo does not need to do tagging now + LOG("Geo tagging in progress.\n"); + iObserver->PendingGeoTagReqComplete( KErrInUse ); + } + else + { + if(!iTagPendingHandlerFlag) + { + LOG("Processing the request.\n"); + // tag pending request is not going on + iTagPendingHandlerFlag = ETrue; + CreateGeoTagsL(); + } + else + { + // req osn progress, don't do anything. + LOG("Request in progress.\n"); + iObserver->PendingGeoTagReqComplete( KErrInUse ); + } + } + LOG("CInternalGeoTagger::PendingGeoTagsL ,end"); + } + +// ---------------------------------------------------------------------------- +// CInternalGeoTagger::GetCurrentRegisterNw() +// ---------------------------------------------------------------------------- +RMobilePhone::TMobilePhoneNetworkInfoV2& CInternalGeoTagger::GetCurrentRegisterNw() + { + LOG( "CInternalGeoTagger::GetCurrentRegisterNw ,begin" ); + return iObserver->GetCurrentRegisterNw(); + } + +// ---------------------------------------------------------------------------- +// CInternalGeoTagger::IsRegisteredAtHomeNetwork() +// ---------------------------------------------------------------------------- +TBool CInternalGeoTagger::IsRegisteredAtHomeNetwork() + { + LOG( "CInternalGeoTagger::IsRegisteredAtHomeNetwork" ); + return iObserver->IsRegisteredAtHomeNetwork(); + } + +// ---------------------------------------------------------------------------- +// CInternalGeoTagger::GetHomeNetworkInfo() +// ---------------------------------------------------------------------------- +const RMobilePhone::TMobilePhoneNetworkInfoV1& + CInternalGeoTagger::GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) + { + LOG( "CInternalReverseGeocode::GetHomeNetworkInfo" ); + return iObserver->GetHomeNetworkInfo(aHomeNwInfoAvailableFlag); + } + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/group/bld.inf --- a/locationmanager/group/bld.inf Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/group/bld.inf Thu Jul 22 16:38:01 2010 +0100 @@ -14,6 +14,19 @@ * Description: Build information file * */ +#include "../inc/locplatsupport.mmh" + +#ifdef _LOC_GEOTAGGING_CELLID +#include "../geoconverter/group/bld.inf" +#endif + +#ifdef _LOC_REVERSEGEOCODE +#include "../tagcreator/group/bld.inf" +#include "../ReverseGeocode/group/bld.inf" +#include "../ReverseGeoCoderPlugin/group/bld.inf" +#include "../geotagger/group/bld.inf" +#endif + #include "../locationtrail/group/bld.inf" #include "../server/group/bld.inf" diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/inc/locationmanagerdebug.h --- a/locationmanager/inc/locationmanagerdebug.h Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/inc/locationmanagerdebug.h Thu Jul 22 16:38:01 2010 +0100 @@ -39,6 +39,8 @@ #define __CLOGGING__ #endif +// Added to remove compilation warnings. +#define ARG_USED(a) (void)(a) // Then actual definitions depending on the diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/inc/locationmanagerdefs.h --- a/locationmanager/inc/locationmanagerdefs.h Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/inc/locationmanagerdefs.h Thu Jul 22 16:38:01 2010 +0100 @@ -51,7 +51,11 @@ ELocManTrackLogName, ELocManRegObserver, ELocManGetCaptureSetting, - ELocManCancelTrackLogNotify + ELocManCancelTrackLogNotify, + ELocManTagPending, + ELocManStartGeoTaging, + ELocManCancelTagPendingReq, + ELocManCancelGeoTaggingReq }; /** Message argument indices */ diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/inc/locplatsupport.mmh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/inc/locplatsupport.mmh Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009-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: Definition file for Location Manager. +* +*/ + +#ifndef __LOCPLATSUPPORT_MMH__ +#define __LOCPLATSUPPORT_MMH__ + +/* +* Define this flag when platform supports cellid based location. +*/ + +#define _LOC_GEOTAGGING_CELLID + +/* +* Define this flag when platform supports reverse geotagging. +*/ +//#define _LOC_REVERSEGEOCODE + + +#endif // __LOCPLATSUPPORT_MMH__ + +// End of file. + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/bwincw/locationtrailwinscw.def --- a/locationmanager/locationtrail/bwincw/locationtrailwinscw.def Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/bwincw/locationtrailwinscw.def Thu Jul 22 16:38:01 2010 +0100 @@ -15,7 +15,7 @@ ?GetTrackLogName@CTrackLog@@QAEXAAV?$TBuf@$0BAA@@@@Z @ 14 NONAME ; void CTrackLog::GetTrackLogName(class TBuf<256> &) ?IsRecording@CTrackLog@@QAEHXZ @ 15 NONAME ; int CTrackLog::IsRecording(void) ?LocationTrailState@CLocationRecord@@QAEXAAW4TTrailState@RLocationTrail@@@Z @ 16 NONAME ; void CLocationRecord::LocationTrailState(enum RLocationTrail::TTrailState &) - ?NewL@CLocationRecord@@SAPAV1@XZ @ 17 NONAME ; class CLocationRecord * CLocationRecord::NewL(void) + ?NewL@CLocationRecord@@SAPAV1@AAVMGeoTaggerObserver@@AAVRMobilePhone@@@Z @ 17 NONAME ; class CLocationRecord * CLocationRecord::NewL(class MGeoTaggerObserver &, class RMobilePhone &) ?NewL@CNetworkInfo@@SAPAV1@PAVMNetworkInfoObserver@@@Z @ 18 NONAME ; class CNetworkInfo * CNetworkInfo::NewL(class MNetworkInfoObserver *) ?NewL@CPositionInfo@@SAPAV1@PAVMPositionInfoObserver@@@Z @ 19 NONAME ; class CPositionInfo * CPositionInfo::NewL(class MPositionInfoObserver *) ?NewL@CTrackLog@@SAPAV1@XZ @ 20 NONAME ; class CTrackLog * CTrackLog::NewL(void) @@ -31,5 +31,12 @@ ?SetStateToStopping@CLocationRecord@@QAEXXZ @ 30 NONAME ; void CLocationRecord::SetStateToStopping(void) ?LocationSnapshotL@CLocationRecord@@QAEXABI@Z @ 31 NONAME ; void CLocationRecord::LocationSnapshotL(unsigned int const &) ?RemappingNeeded@CLocationRecord@@QAEHXZ @ 32 NONAME ; int CLocationRecord::RemappingNeeded(void) - ?IsLowBattery@CLocationRecord@@QAEHXZ @ 33 NONAME ; int CLocationRecord::IsLowBattery(void) + ?StartGeoTagging@CLocationRecord@@QAEHW4TConnectionOption@@@Z @ 33 NONAME ; int CLocationRecord::StartGeoTagging(enum TConnectionOption) + ?StartNwInfoChangeNotifier@CNetworkInfo@@QAEXXZ @ 34 NONAME ; void CNetworkInfo::StartNwInfoChangeNotifier(void) + ?StopNwInfoChangeNotifier@CNetworkInfo@@QAEXXZ @ 35 NONAME ; void CNetworkInfo::StopNwInfoChangeNotifier(void) + ?CancelGeoTagging@CLocationRecord@@QAEXXZ @ 36 NONAME ; void CLocationRecord::CancelGeoTagging(void) + ?TaggingInProgress@CLocationRecord@@QAEHXZ @ 37 NONAME ; int CLocationRecord::TaggingInProgress(void) + ?MapNetworkInfo@CNetworkInfo@@SAXPAVTNetworkInfoV1@CTelephony@@PAVTMobilePhoneNetworkInfoV2@RMobilePhone@@PAVTMobilePhoneLocationAreaV1@5@@Z @ 38 NONAME ; void CNetworkInfo::MapNetworkInfo(class CTelephony::TNetworkInfoV1 *, class RMobilePhone::TMobilePhoneNetworkInfoV2 *, class RMobilePhone::TMobilePhoneLocationAreaV1 *) + ?GetCurrentRegisteredNw@CLocationRecord@@QAEAAVTMobilePhoneNetworkInfoV2@RMobilePhone@@XZ @ 39 NONAME ; class RMobilePhone::TMobilePhoneNetworkInfoV2 & CLocationRecord::GetCurrentRegisteredNw(void) + ?IsLowBattery@CLocationRecord@@QAEHXZ @ 40 NONAME ; int CLocationRecord::IsLowBattery(void) diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/eabi/locationtrailarm.def --- a/locationmanager/locationtrail/eabi/locationtrailarm.def Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/eabi/locationtrailarm.def Thu Jul 22 16:38:01 2010 +0100 @@ -10,7 +10,7 @@ _ZN15CLocationRecord18LocationTrailStateERN14RLocationTrail11TTrailStateE @ 9 NONAME _ZN15CLocationRecord21CancelLocationRequestEv @ 10 NONAME _E32Dll @ 11 NONAME ABSENT - _ZN15CLocationRecord4NewLEv @ 12 NONAME + _ZN15CLocationRecord4NewLER18MGeoTaggerObserverR12RMobilePhone @ 12 NONAME _ZN15CLocationRecord4StopEv @ 13 NONAME _ZN15CLocationRecord6StartLEN14RLocationTrail20TTrailCaptureSettingE @ 14 NONAME _ZN9CTrackLog11IsRecordingEv @ 15 NONAME @@ -53,5 +53,12 @@ _ZN9CTrackLogD0Ev @ 52 NONAME _ZN9CTrackLogD1Ev @ 53 NONAME _ZN9CTrackLogD2Ev @ 54 NONAME - _ZN15CLocationRecord12IsLowBatteryEv @ 55 NONAME + _ZN12CNetworkInfo24StopNwInfoChangeNotifierEv @ 55 NONAME + _ZN12CNetworkInfo25StartNwInfoChangeNotifierEv @ 56 NONAME + _ZN15CLocationRecord15StartGeoTaggingE17TConnectionOption @ 57 NONAME + _ZN15CLocationRecord16CancelGeoTaggingEv @ 58 NONAME + _ZN15CLocationRecord17TaggingInProgressEv @ 59 NONAME + _ZN12CNetworkInfo14MapNetworkInfoEPN10CTelephony14TNetworkInfoV1EPN12RMobilePhone25TMobilePhoneNetworkInfoV2EPNS3_26TMobilePhoneLocationAreaV1E @ 60 NONAME + _ZN15CLocationRecord22GetCurrentRegisteredNwEv @ 61 NONAME + _ZN15CLocationRecord12IsLowBatteryEv @ 62 NONAME diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/group/locationtrail.mmp --- a/locationmanager/locationtrail/group/locationtrail.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/group/locationtrail.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -17,6 +17,7 @@ #include #include +#include "../../inc/locplatsupport.mmh" VERSION 10.0 TARGET LocationTrail.dll @@ -37,6 +38,24 @@ USERINCLUDE ../../inc USERINCLUDE ../../../inc +#ifdef _LOC_REVERSEGEOCODE +MACRO LOC_REVERSEGEOCODE +USERINCLUDE ../../tagcreator/inc +USERINCLUDE ../../ReverseGeocode/inc +USERINCLUDE ../../ReverseGeoCoderPlugin/inc +#endif + +#ifdef _LOC_GEOTAGGING_CELLID +MACRO LOC_GEOTAGGING_CELLID +USERINCLUDE ../../geoconverter/inc +#endif + +SYSTEMINCLUDE /epoc32/include/stdapis +SYSTEMINCLUDE /epoc32/include/ecom +SYSTEMINCLUDE /epoc32/include/platform/lbs + +MW_LAYER_SYSTEMINCLUDE + SOURCEPATH ../src SOURCE clocationrecord.cpp SOURCE cnetworkinfo.cpp @@ -45,19 +64,36 @@ SOURCE cgpxconverterao.cpp SOURCE locationremappingao.cpp -MW_LAYER_SYSTEMINCLUDE - LIBRARY euser.lib LIBRARY efsrv.lib LIBRARY lbs.lib LIBRARY etel3rdparty.lib -LIBRARY mdeclient.lib +LIBRARY etel.lib +LIBRARY etelmm.lib +LIBRARY mdeclient.lib LIBRARY estor.lib -LIBRARY PlatformEnv.lib -LIBRARY centralrepository.lib +LIBRARY PlatformEnv.lib +LIBRARY centralrepository.lib +LIBRARY ecom.lib +LIBRARY commsdat.lib + + +DEBUGLIBRARY flogger.lib +LIBRARY libc.lib +#ifdef _LOC_REVERSEGEOCODE +LIBRARY reversegeocode.lib +LIBRARY tagcreator.lib +LIBRARY geotagger.lib +#endif + +#ifdef _LOC_GEOTAGGING_CELLID +LIBRARY geoconverter.lib +#endif + PAGED BYTEPAIRCOMPRESSTARGET OPTION ARMCC -O3 -OTime - +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/inc/cgpxconverterao.h --- a/locationmanager/locationtrail/inc/cgpxconverterao.h Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/inc/cgpxconverterao.h Thu Jul 22 16:38:01 2010 +0100 @@ -100,11 +100,14 @@ /** * Adds temp-file and possible pre-calculated boundaries * into processing queue + * @param aFileName The temp file name + * @param aBoundaries The pre-calculated boundaries */ void AddToQueueL( const TDesC& aFileName, TBoundaries* aBoundaries = NULL ); /** * Adds observer for GPX file creation notifications + * @param aObserver The observer that recieves the file creation notifications */ void AddObserver( MGpxConversionObserver* aObserver ); @@ -122,11 +125,13 @@ /** * Set next state for RunL + * @param aState The next processing state */ void SetState( TProcessingState aState ); /** * Resolve where to save tracklog file + * aFileName The name of the file */ void GetTrackLogPathL( TDes& aFileName ); diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/inc/clocationrecord.h --- a/locationmanager/locationtrail/inc/clocationrecord.h Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/inc/clocationrecord.h Thu Jul 22 16:38:01 2010 +0100 @@ -22,6 +22,11 @@ #include #include + +#include +#include +#include + #include "rlocationtrail.h" #include "locationdatatype.h" #include "cnetworkinfo.h" @@ -37,6 +42,17 @@ #include "mdequery.h" #include "locationremappingao.h" +#ifdef LOC_GEOTAGGING_CELLID +#include "cgeoconverter.h" +#endif + +#ifdef LOC_REVERSEGEOCODE +#include +#include "ctagcreator.h" +#include "reversegeocode.h" +class CReverseGeoCoderPlugin; +#endif + typedef RLocationTrail::TTrailState TLocTrailState; class CTelephony; @@ -55,11 +71,22 @@ * This method is used to notify about location trail state changes. */ virtual void LocationTrailStateChange() = 0; - + + /** + * This method is used to fetch the current location + * @param aSatelliteInfo The satellite information + * @param aNetworkInfo The network informatiom + * @param aError ErrCode if any + */ virtual void CurrentLocation( const TPositionSatelliteInfo& aSatelliteInfo, const CTelephony::TNetworkInfoV1& aNetworkInfo, const TInt aError ) = 0; - + + + /** + * This method is used to notify about GPS signal quality changes. + * @param aSatelliteInfo The satellite information + */ virtual void GPSSignalQualityChanged( const TPositionSatelliteInfo& aSatelliteInfo ) = 0; /** @@ -86,6 +113,21 @@ TLocTrailState iTrailState; // Trail state for this item. }; +/** +* Location snap shot item class. +*/ +class TLocationSnapshotItem + { + public: + TLocationData iLocationData; // Location info & network info + TItemId iObjectId; // current media object id. + TItemId iLocationId; + TUint iFlag; //indicator for various scenarios +#ifdef LOC_REVERSEGEOCODE + TItemId iCountryTagId; + TItemId iCityTagId; +#endif + }; class MLocationAddObserver { public: @@ -107,14 +149,21 @@ public MNetworkInfoObserver, public MPositionInfoObserver, public MMdEQueryObserver +#ifdef LOC_GEOTAGGING_CELLID + ,public MGeoConverterObserver +#endif +#ifdef LOC_REVERSEGEOCODE + ,public MReverseGeocodeObserver +#endif { public: /** * 2-phased constructor. + * @param aGeoTaggerObserver The observer that is notified after geotagging * @since S60 3.1 */ - IMPORT_C static CLocationRecord* NewL(); - + IMPORT_C static CLocationRecord* NewL(MGeoTaggerObserver& aGeoTaggerObserver, RMobilePhone& aPhone); + /** * C++ destructor. * @since S60 3.1 @@ -195,66 +244,178 @@ /** * Set observer (TrackLog) for notifying new locations in location trail + * @param aObserver, An observer for location changes */ IMPORT_C void SetAddObserver( MLocationAddObserver* aObserver ); - + + + /** + * Update network information + * + */ static TInt UpdateNetworkInfo( TAny* aAny ); + + /* + * creates a location object from the given location data and objectId + * @param aLocationData the location data + * @param aObjectId the object Id + */ IMPORT_C void CreateLocationObjectL( const TLocationData& aLocationData, const TUint& aObjectId ); - + + + /** + * Handle the photos taken by phone camera. + * @param aObjectId Object id + */ IMPORT_C void LocationSnapshotL( const TUint& aObjectId ); - + + /** + * Creates a location object with given location data + * @param aLocationData The location data + * @return The locationId + */ TItemId DoCreateLocationL( const TLocationData& aLocationData ); - + + /** + * Creates a "contains" relation for the given ObjectId and LocationId and adds it to the iMdeSession + * @param aObjectId Object id + * @param aLocationId location id + * @return item id + */ TItemId CreateRelationL( const TUint& aObjectId, const TUint& aLocationId ); - + /** + * Sets the CMdESession for tagcreation + * @param aSession The CMdESession object + */ IMPORT_C void SetMdeSession( CMdESession* aSession ); + /** + * Sets the current location trail state to Stop + */ IMPORT_C void SetStateToStopping(); + /** + * returns the timevalue of the CMdEObject corresponding to a given ObjectId + * @param aObjectId the objectId + * @return the timevalue associated with given object + */ TTime GetMdeObjectTimeL( TItemId aObjectId ); - + + /** + * Checks if Remapping is needed + * @return Boolean to indicate if remapping is needed or not + */ IMPORT_C TBool RemappingNeeded(); - + + IMPORT_C TBool IsLowBattery(); + /** + * Checks if geotagging is in progress + * @return Boolean to indicate if geotagging is in progress + */ + IMPORT_C TBool TaggingInProgress(); + + + /** + * Initiates geotagging + * @param aConnectionOption connection option,silent or not + * @return Etrue if geotagging is started + */ + IMPORT_C TBool StartGeoTagging(const TConnectionOption aConnectionOption); + + /** + * Cancels the geotagging + */ + IMPORT_C void CancelGeoTagging(); + public: // from MNetworkInfoObserver. /** * + * NetworkInfo + * This method is used for setting the network cell id to the * @since S60 3.1 - * @param - * @return + * @param aNetworkInfo N/W info + * @param aError Error code */ void NetworkInfo( const CTelephony::TNetworkInfoV1 &aNetworkInfo, TInt aError ); + + /** + * Get mobile phone object for network info object + * @return mobile phone object + */ + RMobilePhone& GetMobilePhone4NwInfo(); public: // from MPositionInfoObserver /** - * + * This method is used for setting the position info to the + * location trail. * @since S60 3.1 - * @param - * @return + * @param aPositionInfo the position information + * @param aError Captures the errcode if any */ void Position( const TPositionInfo& aPositionInfo, const TInt aError ); public: // From MMdEQueryObserver + /** + * Handle query new results + * @param aQuery Query object + * @param aFirstNewItemIndex new item index + * @param aNewItemCount item count + */ void HandleQueryNewResults(CMdEQuery& aQuery, TInt aFirstNewItemIndex, TInt aNewItemCount); - + + + /* + * This method is called when any of the location/image/tag query is completed + * @param aQuery The Query type + * @param aError Indicates if the query was completed successfully or with any err + * + */ void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError); + +#ifdef LOC_GEOTAGGING_CELLID +public: // MGeoConverterObserver + /** + * This method is used for notifying completion of geotagging + * @param aError error code + * @param aPosition position (lat/lon) for the correcponding n/w info + */ + void ConversionCompletedL( const TInt aError, TLocality& aPosition ); + + /** + * This method is used to handle the conversion error + * @param aError the error code + */ + void HandleConversionError(TInt aError); -private: +#endif +public: + + /* + * Get registrer network country code + * + * @return current register n/w info + */ + IMPORT_C RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisteredNw(); + + +private: /** * Stores the location info into the array. + * @param aSatelliteInfo Satellite information */ - void StoreLocation( /*const TPosition& aPosition, const TCourse& aCourse,*/ - const TPositionSatelliteInfo& aSatelliteInfo ); + void StoreLocation( const TPositionSatelliteInfo& aSatelliteInfo ); /** * Changes the current state. New state is published in P&S and * possible observer is notified. + * @param aState The location trail state that is to be set */ void SetCurrentState( TLocTrailState aState ); @@ -262,15 +423,18 @@ * Returns the requested location via callback method, if the location * is valid. Otherwise new location value is requested until the value * is succesful, or the time out limit has been reached. + * @param aSatelliteInfo The satelliteInfo object + * @param aError Indicates any error in handling the location request * */ void HandleLocationRequest( const TPositionSatelliteInfo& aSatelliteInfo /*TLocality& aPosition*/, const TInt aError ); /** * C++ constructor. + * @param aGeoTaggerObserver The observer that is to be notified when geotagging completes */ - CLocationRecord(); - + CLocationRecord(MGeoTaggerObserver& aGeoTaggerObserver, RMobilePhone& aPhone); + /** * 2nd phase constructor. */ @@ -282,12 +446,157 @@ * @param aValue, Read value */ void ReadCenRepValueL(TInt aKey, TInt& aValue); - + + /** + * Validates the lat lon values recieved + * @param aSatelliteInfo The satelliteInfo object + * @return ETrue if the lat=lon are valid + */ TBool CheckGPSFix( const TPositionSatelliteInfo& aSatelliteInfo ); - + + + /** + * Starts the network info timer + */ void StartTimerL(); + + /** + * Fetches the location info from the db + */ + + void FindLocationFromDBL(); + + + /** + * Find location entry + * @param aQuery query type for the tag + * @param aLocationId Location Id + */ + void FindAnyLocationMatchesL( CMdEQuery& aQuery, TUint& aLocationId ); + + /** + * Remaps the location objects when GPS is available + * @param aGPSInfoAvailable Boolean value to indicate if GPS is available + */ + void RemapObjectsL( TBool aGPSInfoAvailable ); + + /** + * Check any location object already exists with same network info + */ + void FindLocationWithSameNetInfoL(); + + /** + * Initialises the location object definitions + */ + void InitialiseL(); + + /** + * handle network location related query on complete + * @param aQuery the query type + */ + void HandleNetLocationQueryL( CMdEQuery& aQuery ); + + + /** + * handle the location query on location query complete + * @param aQuery the query type + */ + void HandleLocationQueryL( CMdEQuery& aQuery ); + + /** + * Callback method on geotagging complete + */ + void GeoTaggingCompleted(); + +#ifdef LOC_REVERSEGEOCODE + /** + * Get any imagefor this location object + * @param aLocID, location object Id + */ + void GetRelatedImageL( TItemId aLocID ); + + /** + * Get tags for this image + * @param aImageID, image object Id + */ + void GetTagsL( TItemId aImageID ); + + /** + * handle the tag query on complete + * @param aQuery the query type + */ + void HandleTagQueryL( CMdEQuery& aQuery ); + + + // MReverseGeocodeObserver + //from reverse-geocode observer + /* + * Call back method from reverse geo coder with address details like country, city.. + * @param aErrorcode Indicates any error in Reverse geocoding + * aAddressInfo address info + */ + void ReverseGeocodeComplete( TInt& aErrorcode, MAddressInfo& aAddressInfo ); + + /* + * Get registrer network country code + * + * @return current register n/w info + */ + RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw(); + + /* + * UE is registered to home network? + * + * @return ETrue if UE is registered at home network else EFalse + */ + TBool IsRegisteredAtHomeNetwork(); + + + /* + * Get home network country code + * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse + * @return user home n/w info + */ + const RMobilePhone::TMobilePhoneNetworkInfoV1& + GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag); + + /** + * Find country & city tags id + * @param aQuery query type for the tag + * @param aCountryTagId country tag Id + * @param aCityTagId city tag Id + */ + void FindCountryAndCityTagL( CMdEQuery& aQuery, TItemId& aCountryTagId, TItemId& aCityTagId ); + +#endif // LOC_REVERSEGEOCODE + + /** + * Handle n/w related information on taken photograph + * + */ + void NetworkInfoSnapshotL(); + + /** + * Find location from DB within the non leaving method + */ + void HandleFindLocationFromDB(); + + /** + * handle MDS query failure sceenario + */ + void HandleQueryFailure(); + + private: + enum TRemapState + { + ERemapProgressNone = 0x00, + ERemapRevGeoCodeInProgress, + ERemapRevGeoCodePending, + ERemapNwGeoConverterInProgress, + ERemapNwGeoConverterPending + }; /** * A session to Metadata Engine for creating and manipulating location objects. */ @@ -309,7 +618,7 @@ * An array to collect location values. * Own. */ - RArray iTrail; + RPointerArray iTrail; /** * P&S key property. @@ -321,7 +630,7 @@ * Active class to get network information. * Own. */ - CNetworkInfo* iNetworkInfo; + CNetworkInfo* iNetworkInfoChangeListener; /** * Active class to get position information. @@ -357,14 +666,10 @@ TBool iRequestCurrentLoc; TBool iTrailStarted; - TUint iLastNumberOfSatellitesUsed; - TReal32 iLastHDOP; - TReal32 iLastVDOP; TBool iLastGPSFixState; TInt iLocationDelta; TLocationData iLastLocation; - TItemId iLastLocationId; TItemId iObjectId; TLocationData iLocationData; @@ -373,6 +678,78 @@ * This query object is used to find existing locations */ CMdEObjectQuery* iLocationQuery; + + + /** + * Net location query + */ + CMdEObjectQuery* iNetLocationQuery; + + + TRemapState iRemapState; + + + /** + * Database definitions. + */ + CMdENamespaceDef* iNamespaceDef; + CMdEObjectDef* iLocationObjectDef; + CMdEPropertyDef* iLatitudeDef; + CMdEPropertyDef* iLongitudeDef; + CMdEPropertyDef* iAltitudeDef; + + /** + * An array to collect downloaded object + * and its location details. + */ + RPointerArray iMediaItems; + + TLocationSnapshotItem iLastMediaItem; + + TInt iMediaHandlingFlag; + RMobilePhone& iPhone; + + /* + * Flag to track GPS data availability to update camera location icon. + */ + TBool iGpsDataAvailableFlag; + + MGeoTaggerObserver& iGeoTaggerObserver; + +#ifdef LOC_GEOTAGGING_CELLID + /* + * Geo converter + */ + CGeoConverter* iGeoConverter; + TBool iConvertRetry; +#endif + +#ifdef LOC_REVERSEGEOCODE + + TConnectionOption iConnectionOption; + + /** + * query object for getting an image/video object + */ + CMdERelationQuery* iImageQuery; + /** + * query object for getting country and city tags + */ + CMdERelationQuery* iTagQuery; + TLocationSnapshotItem iLastLocationItem; + RPointerArray iLocationItems; + /** + * to create/attach tags + */ + CTagCreator *iTagCreator; + /* + * Reverse geo coder plugin object + */ + CReverseGeoCoderPlugin* iRevGeocoderPlugin; + TUid iDtorKey; + +#endif + }; #endif // C_CLOCATIONRECORD_H diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/inc/cnetworkinfo.h --- a/locationmanager/locationtrail/inc/cnetworkinfo.h Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/inc/cnetworkinfo.h Thu Jul 22 16:38:01 2010 +0100 @@ -20,6 +20,8 @@ #define C_CNETWORKINFO_H #include +#include +#include /** * An observer interface, which is used for getting current network cell id. @@ -34,6 +36,12 @@ * location trail. */ virtual void NetworkInfo( const CTelephony::TNetworkInfoV1 &aNetworkInfo, const TInt aError ) = 0; + + /** + * Get mobile phone object for network info object + * @return mobile phone object + */ + virtual RMobilePhone& GetMobilePhone4NwInfo() = 0; }; /** @@ -55,6 +63,33 @@ */ IMPORT_C virtual ~CNetworkInfo(); + /** + * Listen to n/w info change + * @since S60 9.2 + */ + IMPORT_C void StartNwInfoChangeNotifier(); + + /** + * Stop n/w info change listener + * @since S60 9.2 + */ + IMPORT_C void StopNwInfoChangeNotifier(); + + /** + * Map etel to ctelephony + * @since S60 9.2 + */ + IMPORT_C static void MapNetworkInfo(CTelephony::TNetworkInfoV1* aISVNetworkInfo, + RMobilePhone::TMobilePhoneNetworkInfoV2* aMMNetworkInfo, + RMobilePhone::TMobilePhoneLocationAreaV1* aMMArea); + + /* + * Get registrer network country code + * + * @return current register n/w info + */ + RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw(); + protected: /** * Run error implementation in case of RunL leaving. @@ -85,6 +120,13 @@ void RunL(); private: + typedef enum + { + ENetworkInfoNoOptState = 0x00, + ENetworkInfoOptGetState, + ENetworkInfoOptNotifyState + }TNetworkInfoOptState; + /** * An observer interface to set current cell id to the location trail. * Not own. @@ -92,18 +134,23 @@ MNetworkInfoObserver* iTrail; /** - * Flag to indicate that we retrieve network info for the first time. + * phone object to retrieve modem parameters */ - TBool iFirstTime; - + RMobilePhone& iMobilePhone; + /** - * Interface to phone's telephony system to get Cell Id. - * Own. - */ - CTelephony* iTelephony; - + * Maintain the operation state. + */ + TNetworkInfoOptState iState; + + /* + * Retained this object just to give backward compatibility + */ CTelephony::TNetworkInfoV1 iNetworkInfoV1; - CTelephony::TNetworkInfoV1Pckg iNetworkInfoV1Pckg; + + RMobilePhone::TMobilePhoneNetworkInfoV2 iMMNetworkInfo; + RMobilePhone::TMobilePhoneNetworkInfoV2Pckg iMMNetworkInfoPckg; + RMobilePhone::TMobilePhoneLocationAreaV1 iMMArea; }; #endif // C_CNETWORKINFO_H diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/inc/cpositioninfo.h --- a/locationmanager/locationtrail/inc/cpositioninfo.h Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/inc/cpositioninfo.h Thu Jul 22 16:38:01 2010 +0100 @@ -82,7 +82,12 @@ * @return None. */ void Stop(); - + + /** + * Handle remap completed event + * @since S60 9.2 + */ + void HandleRemapComplete(); protected: /** * Run error implementation in case of RunL leaving. @@ -113,6 +118,12 @@ void RunL(); private: + typedef enum + { + EPositionOptStateNone = 0x00, + EPositionOptStateGetLastKnownPosition, + EPositionOptStateNotifyUpdate + }TPositionOptState; /** * An observer interface to set current position to the location trail. * Not own. @@ -137,7 +148,8 @@ TInt iUpdateInterval; - TBool iFirstInterval; + TPositionOptState iState; + TBool iConnectedPositionServer; }; #endif // C_CPOSITIONINFO_H diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/inc/locationremappingao.h --- a/locationmanager/locationtrail/inc/locationremappingao.h Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/inc/locationremappingao.h Thu Jul 22 16:38:01 2010 +0100 @@ -28,7 +28,9 @@ #include "rlocationtrail.h" #include "locationmanagerdebug.h" #include "locationtraildefs.h" - +#ifdef LOC_REVERSEGEOCODE +#include "ctagcreator.h" +#endif class TRemapItem { @@ -128,6 +130,19 @@ * @param aLocationId, locationId for relations */ void UpdateRelationsL( TItemId aLocationId ); + +#ifdef LOC_REVERSEGEOCODE + /** + * AttachGeoTagsL + * Attaches the country and city tags to all objects + * @param aTagCreator An instance of the tag creator + * @param aCountryTagId country tagId + * @param aCityTagId city tag Id + */ + void AttachGeoTagsL( CTagCreator *aTagCreator, + const TItemId aCountryTagId, + const TItemId aCityTagId ); +#endif private: /** @@ -245,3 +260,5 @@ #endif /*LOCATIONREMAPPINGAO_H_*/ + +// End of file diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/src/cgpxconverterao.cpp --- a/locationmanager/locationtrail/src/cgpxconverterao.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/src/cgpxconverterao.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -22,6 +22,7 @@ #include "locationmanagerdebug.h" // --------------------------------------------------------------------------- +// CGpxConverterAO::CGpxConverterAO() // Default constructor. // --------------------------------------------------------------------------- // @@ -32,6 +33,7 @@ } // --------------------------------------------------------------------------- +// CGpxConverterAO::NewL // Standard NewL for first phase construction. // --------------------------------------------------------------------------- // @@ -46,18 +48,19 @@ } // --------------------------------------------------------------------------- +// CGpxConverterAO::ConstructL // 2nd phase construction. // --------------------------------------------------------------------------- // void CGpxConverterAO::ConstructL() { - LOG( "CGpxConverterAO::ConstructL" ); + LOG( "CGpxConverterAO::ConstructL ,begin" ); CActiveScheduler::Add( this ); User::LeaveIfError( iFs.Connect() ); iWriteBuf = HBufC8::NewL( KWriteBufSize ); iFormatBuf = HBufC::NewL( KWriteBufSize ); - + LOG( "CGpxConverterAO::ConstructL ,end" ); } // --------------------------------------------------------------------------- @@ -66,7 +69,7 @@ // CGpxConverterAO::~CGpxConverterAO() { - LOG( "CGpxConverterAO::~CGpxConverterAO" ); // DEBUG INFO + LOG( "CGpxConverterAO::~CGpxConverterAO ,begin" ); Cancel(); iFs.Close(); @@ -83,9 +86,12 @@ delete iWriteBuf; delete iFormatBuf; + + LOG( "CGpxConverterAO::~CGpxConverterAO ,end" ); } // --------------------------------------------------------------------------- +// CGpxConverterAO::RunError // From CActive. // --------------------------------------------------------------------------- // @@ -100,6 +106,7 @@ } // --------------------------------------------------------------------------- +// CGpxConverterAO::DoCancel // From CActive. // --------------------------------------------------------------------------- // @@ -108,13 +115,15 @@ LOG( "CGpxConverterAO::DoCancel" ); } -/** - * Adds temp-file and possible pre-calculated boundaries - * into processing queue - */ +// --------------------------------------------------------------------------- +// CGpxConverterAO::AddToQueueL +// Adds temp-file and possible pre-calculated boundaries +// into processing queue +// --------------------------------------------------------------------------- +// void CGpxConverterAO::AddToQueueL( const TDesC& aFileName, TBoundaries* aBoundaries ) { - LOG("CGpxConverterAO::AddToQueueL"); + LOG("CGpxConverterAO::AddToQueueL ,begin"); TFileName *filename = new (ELeave) TFileName(aFileName); CleanupStack::PushL( filename ); iFileQueue.AppendL( filename ); @@ -125,11 +134,15 @@ { SetState( ENextFile ); } + + LOG("CGpxConverterAO::AddToQueueL ,end"); } -/** - * Set next state for RunL - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::SetState + // Set next state for RunL + // --------------------------------------------------------------------------- void CGpxConverterAO::SetState( TProcessingState aState ) { LOG1( "CGpxConverterAO::SetState: %d", aState ); @@ -141,11 +154,13 @@ TRequestStatus* ptrStatus = &iStatus; User::RequestComplete( ptrStatus, KErrNone ); } + LOG("CGpxConverterAO::SetState ,end"); } -/** - * RunL - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::RunL() + // --------------------------------------------------------------------------- void CGpxConverterAO::RunL() { switch( iState ) @@ -310,12 +325,14 @@ } } -/** - * Read Tag Id from temp-file - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::ReadTagIdL + // Read Tag Id from temp-file + // --------------------------------------------------------------------------- void CGpxConverterAO::ReadTagIdL() { - LOG("CGpxConverterAO::ReadTagIdL"); + LOG("CGpxConverterAO::ReadTagIdL ,begin"); TUint32 low( 0 ); TUint32 high( 0 ); @@ -323,11 +340,15 @@ high = iReader.ReadUint32L(); iTagId = MAKE_TINT64( high, low ); + + LOG("CGpxConverterAO::ReadTagIdL ,end"); } -/** - * Calculate min and max coordinates for tracklog - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::CalculateBoundaries + // Calculate min and max coordinates for tracklog + // --------------------------------------------------------------------------- void CGpxConverterAO::CalculateBoundaries() { LOG("CGpxConverterAO::CalculateBoundaries start"); @@ -372,11 +393,14 @@ LOG("CGpxConverterAO::CalculateBoundaries end"); } -/** - * Writes header tags for GPX file - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::WriteStartingTags + // Writes header tags for GPX file + // --------------------------------------------------------------------------- void CGpxConverterAO::WriteStartingTags() { + LOG("CGpxConverterAO::WriteStartingTags ,begin"); TPtr8 writePtr = iWriteBuf->Des(); TPtr formatter = iFormatBuf->Des(); @@ -411,13 +435,17 @@ writePtr.Copy( KTagTrackStart ); iGpxFile.Write( writePtr ); + LOG("CGpxConverterAO::WriteStartingTags ,end"); } -/** - * Writes single trackpoint to GPX file - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::WriteItemToFile + // Writes single trackpoint to GPX file + // --------------------------------------------------------------------------- void CGpxConverterAO::WriteItemToFile() { + LOG("CGpxConverterAO::WriteItemToFile ,begin"); TTime timeStamp; TPtr8 writePtr = iWriteBuf->Des(); @@ -503,14 +531,16 @@ writePtr.Copy( KTagTrkPointEnd ); iGpxFile.Write( writePtr ); } - + LOG("CGpxConverterAO::WriteItemToFile ,end"); } -/** - * Close GPX file - */ + // --------------------------------------------------------------------------- + // CGpxConverterAO::WriteClosingTags + // Close GPX file + // --------------------------------------------------------------------------- void CGpxConverterAO::WriteClosingTags() { + LOG("CGpxConverterAO::WriteClosingTags ,begin"); TPtr8 writePtr = iWriteBuf->Des(); // end segment @@ -525,11 +555,14 @@ writePtr.Append( KTagGpxEnd ); iGpxFile.Write( writePtr ); + LOG("CGpxConverterAO::WriteClosingTags ,end"); } -/** - * Resolve where to save tracklog file - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::GetTrackLogPathL + // Resolve where to save tracklog file + // --------------------------------------------------------------------------- void CGpxConverterAO::GetTrackLogPathL( TDes& aFileName ) { LOG("CGpxConverterAO::GetTrackLogPathL start"); @@ -560,11 +593,15 @@ LOG("CGpxConverterAO::GetTrackLogPathL end"); } -/** - * Adds observer for GPX file creation notifications - */ + + // --------------------------------------------------------------------------- + // CGpxConverterAO::AddObserver + // Adds observer for GPX file creation notifications + // --------------------------------------------------------------------------- void CGpxConverterAO::AddObserver( MGpxConversionObserver* aObserver ) { iObservers.Append( aObserver ); } + +//End of File diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/src/clocationrecord.cpp --- a/locationmanager/locationtrail/src/clocationrecord.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/src/clocationrecord.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -18,6 +18,9 @@ #include #include #include +#include +#include +#include #include "rlocationtrail.h" #include "clocationrecord.h" @@ -26,30 +29,50 @@ #include "locationtraildefs.h" #include "locationtrailpskeys.h" #include "mdeconstants.h" -#include -#include +#ifdef LOC_REVERSEGEOCODE +#include "reversegeocoderplugin.h" +const TUid KReverseGeoCodeUid = {0x2002DD12}; +#endif using namespace MdeConstants; +const TUint KNetQueryBit = 1; // 1 bit +const TUint KDownloadMediaFile = 2; // 2 bit +const TUint KSnapMediaFile = 4; // 3 bit +const TUint KLocationQueryInProgress = 1; // 1 bit +#ifdef LOC_REVERSEGEOCODE +const TUint KReverseGeoCodingInProgress = 2; // 2 bit +_LIT ( KCountry, "country:"); // country:india +_LIT ( KCity, "city:"); // city:bangalore|country:india +#endif +const TUint KSnapGeoConvertInProgress = 4; // 3 bit +#ifdef LOC_GEOTAGGING_CELLID +const TUint KSnapGeoConvertInPendingState = 8; // 4 bit +#endif + + + // -------------------------------------------------------------------------- // CLocationRecord::NewL // -------------------------------------------------------------------------- // -EXPORT_C CLocationRecord* CLocationRecord::NewL() +EXPORT_C CLocationRecord* CLocationRecord::NewL(MGeoTaggerObserver& aGeoTaggerObserver, + RMobilePhone& aPhone) { - CLocationRecord* self = new (ELeave) CLocationRecord(); + CLocationRecord* self = new (ELeave) CLocationRecord(aGeoTaggerObserver, aPhone); CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); return self; } - + // -------------------------------------------------------------------------- // CLocationRecord::CLocationRecord // -------------------------------------------------------------------------- // -CLocationRecord::CLocationRecord() +CLocationRecord::CLocationRecord(MGeoTaggerObserver& aGeoTaggerObserver, + RMobilePhone& aPhone) : iNetworkInfoTimer( NULL ), iState( RLocationTrail::ETrailStopped ), iTrailCaptureSetting( RLocationTrail::ECaptureAll ), @@ -57,7 +80,29 @@ iRequestCurrentLoc( EFalse ), iTrailStarted( EFalse ), iLastGPSFixState( EFalse ), - iLastLocationId( 0 ) + iLocationQuery(NULL), + iNetLocationQuery(NULL), + iRemapState( ERemapProgressNone), + iNamespaceDef(NULL), + iLocationObjectDef(NULL), + iLatitudeDef(NULL), + iLongitudeDef(NULL), + iAltitudeDef(NULL), + iMediaHandlingFlag(0), + iPhone(aPhone), + iGpsDataAvailableFlag(EFalse), + iGeoTaggerObserver(aGeoTaggerObserver) +#ifdef LOC_GEOTAGGING_CELLID + ,iGeoConverter(NULL) + , iConvertRetry(ETrue) +#endif +#ifdef LOC_REVERSEGEOCODE + ,iConnectionOption(ESilent) + ,iImageQuery(NULL) + ,iTagQuery(NULL) + ,iTagCreator( NULL ) + ,iRevGeocoderPlugin( NULL ) +#endif { iMaxTrailSize = KMaxTrailLength / KUpdateInterval; } @@ -68,6 +113,7 @@ // void CLocationRecord::ConstructL() { + LOG( "CLocationRecord::ConstructL(), begin" ); const TInt KMillion = 1000000; TInt err = iProperty.Define( KPSUidLocationTrail, KLocationTrailState, RProperty::EInt ); if ( err != KErrNone && err != KErrAlreadyExists ) @@ -77,18 +123,36 @@ User::LeaveIfError( iProperty.Set( KPSUidLocationTrail, KLocationTrailState, (TInt) RLocationTrail::ETrailStopped ) ); - iNetworkInfo = CNetworkInfo::NewL( this ); + + iNetworkInfoChangeListener = CNetworkInfo::NewL( this ); iPositionInfo = CPositionInfo::NewL( this ); iRemapper = CLocationRemappingAO::NewL(); iNetworkInfoTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - + +#ifdef LOC_REVERSEGEOCODE + iTagCreator = CTagCreator::NewL(); + + + if (!iRevGeocoderPlugin) + { + iRevGeocoderPlugin = reinterpret_cast( + REComSession::CreateImplementationL(KReverseGeoCodeUid,iDtorKey)); + if(iRevGeocoderPlugin) + { + iRevGeocoderPlugin->AddObserverL(*this); + } + } + + #endif + + TInt interval( 0 ); TRAP(err, ReadCenRepValueL(KIntervalKey, interval)); - LOG1("CLocationManagerServer::ConstructL, cenrep interval value:%d", interval); + LOG1("Cenrep interval value:%d", interval); if (interval == 0 || err != KErrNone ) { - LOG1("CLocationManagerServer::ConstructL, cenrep interval err:%d", err); + LOG1("Cenrep interval err:%d", err); iInterval = KUpdateInterval; } else @@ -97,14 +161,25 @@ } TRAP(err, ReadCenRepValueL(KLocationDeltaKey, iLocationDelta)); - LOG1("CLocationManagerServer::ConstructL, location delta value:%d", iLocationDelta); + LOG1("Location delta value:%d", iLocationDelta); if (iLocationDelta == 0) { - LOG1("CLocationManagerServer::ConstructL, location delta err:%d", err); + LOG1("Location delta err:%d", err); iLocationDelta = KLocationDelta; } + iLastMediaItem.iFlag = 0; + iLastMediaItem.iLocationId = 0; +#ifdef LOC_REVERSEGEOCODE + iLastMediaItem.iCityTagId= 0; + iLastMediaItem.iCountryTagId = 0; + iLastLocationItem.iFlag = 0; + iLastLocationItem.iCityTagId= 0; + iLastLocationItem.iCountryTagId = 0; + iLastLocationItem.iLocationId = 0; +#endif + LOG( "CLocationRecord::ConstructL(), end" ); } // -------------------------------------------------------------------------- @@ -113,19 +188,72 @@ // EXPORT_C CLocationRecord::~CLocationRecord() { + LOG( "CLocationRecord::~CLocationRecord(), begin" ); Stop(); iProperty.Delete( KPSUidLocationTrail, KLocationTrailState ); iProperty.Close(); + iTrail.ResetAndDestroy(); iTrail.Close(); - - delete iNetworkInfo; + iMediaItems.ResetAndDestroy(); + iMediaItems.Close(); +#ifdef LOC_REVERSEGEOCODE + iLocationItems.ResetAndDestroy(); + iLocationItems.Close(); +#endif + delete iNetworkInfoChangeListener; delete iPositionInfo; delete iNetworkInfoTimer; - if (iRemapper) +#ifdef LOC_GEOTAGGING_CELLID + if(iGeoConverter) + { + delete iGeoConverter; + iGeoConverter = NULL; + } +#endif + if (iRemapper) { iRemapper->StopRemapping(); delete iRemapper; } + if(iLocationQuery) + { + iLocationQuery->RemoveObserver(*this); + iLocationQuery->Cancel(); + delete iLocationQuery; + iLocationQuery = NULL; + } + +if(iNetLocationQuery) + { + iNetLocationQuery->RemoveObserver(*this); + iNetLocationQuery->Cancel(); + delete iNetLocationQuery; + iNetLocationQuery = NULL; + } + + +#ifdef LOC_REVERSEGEOCODE + if(iImageQuery) + { + iImageQuery->RemoveObserver(*this); + iImageQuery->Cancel(); + delete iImageQuery; + iImageQuery = NULL; + } + if(iTagQuery) + { + iTagQuery->RemoveObserver(*this); + iTagQuery->Cancel(); + delete iTagQuery; + iTagQuery = NULL; + } + delete iTagCreator; + // set the pointer to NULL, ECOM will destroy object. + delete iRevGeocoderPlugin; + iRevGeocoderPlugin = NULL; + REComSession::DestroyedImplementation(iDtorKey); +#endif + LOG( "CLocationRecord::~CLocationRecord(), end" ); } // -------------------------------------------------------------------------- @@ -145,12 +273,17 @@ { LOG( "CLocationRecord::StartL(), begin" ); iTrailCaptureSetting = aCaptureSetting; + iGpsDataAvailableFlag = EFalse; if ( aCaptureSetting == RLocationTrail::ECaptureAll && !iPositionInfo->IsActive() ) { if( iState == RLocationTrail::ETrailStopped ) { - iTrail.Reset(); + iTrail.ResetAndDestroy(); } + // Capture at least one location with n/w info else we wouldn't be able to tag the immediate taken photograph + // incase LBS didn't provide any valid position data. Without this there may be a leave from GetLocationByTimeL + // method while calling this from LocationSnapshotL method + UpdateNetworkInfo( this ); iPositionInfo->StartL( aCaptureSetting, iInterval ); } else if ( aCaptureSetting == RLocationTrail::ECaptureNetworkInfo ) @@ -167,11 +300,9 @@ StartTimerL(); } - iLastLocationId = 0; - + iTrailStarted = ETrue; SetCurrentState( RLocationTrail::ETrailStarting ); - iTrailStarted = ETrue; LOG( "CLocationRecord::StartL(), end" ); } @@ -183,8 +314,8 @@ { LOG( "CLocationRecord::StopL(), begin" ); iPositionInfo->Stop(); + iGpsDataAvailableFlag = EFalse; iTrailStarted = EFalse; - if ( iNetworkInfoTimer && iNetworkInfoTimer->IsActive() ) { iNetworkInfoTimer->Cancel(); @@ -224,22 +355,22 @@ LOG1( "CLocationRecord::GetLocationByTimeL - aTime: %Ld", aTime.Int64() ); TBuf str1; aTime.FormatL( str1, KDateTimeFormat ); - LOG1( "CLocationRecord::GetLocationByTimeL - aTime: %S", &str1 ); + // LOG1( "CLocationRecord::GetLocationByTimeL - aTime: %S", &str1 ); #endif TTimeIntervalSeconds interval; TTimeIntervalSeconds nextInterval; for ( TInt i(iTrail.Count()-1) ; i >= 0 && !posFound ; i-- ) { - TInt err = iTrail[i].iTimeStamp.SecondsFrom( aTime, interval ); + TInt err = iTrail[i]->iTimeStamp.SecondsFrom( aTime, interval ); TInt timeDiff = Abs( interval.Int() ); #ifdef _DEBUG - LOG1( "CLocationRecord::GetLocationByTimeL - Trail timestamp: %Ld", iTrail[i].iTimeStamp.Int64() ); + LOG1( "CLocationRecord::GetLocationByTimeL - Trail timestamp: %Ld", iTrail[i]->iTimeStamp.Int64() ); TBuf str; - iTrail[i].iTimeStamp.FormatL( str, KDateTimeFormat ); - LOG1( "CLocationRecord::GetLocationByTimeL - Trail timestamp: %S", &str ); + iTrail[i]->iTimeStamp.FormatL( str, KDateTimeFormat ); + //LOG1( "CLocationRecord::GetLocationByTimeL - Trail timestamp: %S", &str ); LOG1( "CLocationRecord::GetLocationByTimeL - timeDiff: %d", timeDiff ); #endif @@ -248,25 +379,25 @@ // The nearest time is in iTrail[i] or in iTrail[i-1]. if ( i > 0 ) { - iTrail[i-1].iTimeStamp.SecondsFrom( aTime, nextInterval ); + iTrail[i-1]->iTimeStamp.SecondsFrom( aTime, nextInterval ); TInt nextDiff = Abs( nextInterval.Int() ); if ( nextDiff < timeDiff ) { - aLocationData = iTrail[i-1].iLocationData; - aState = iTrail[i-1].iTrailState; + aLocationData = iTrail[i-1]->iLocationData; + aState = iTrail[i-1]->iTrailState; } else { - aLocationData = iTrail[i].iLocationData; - aState = iTrail[i].iTrailState; + aLocationData = iTrail[i]->iLocationData; + aState = iTrail[i]->iTrailState; } } else { - aLocationData = iTrail[i].iLocationData; - aState = iTrail[i].iTrailState; + aLocationData = iTrail[i]->iLocationData; + aState = iTrail[i]->iTrailState; } posFound = ETrue; } @@ -284,11 +415,15 @@ // EXPORT_C void CLocationRecord::RequestLocationL() { + LOG( "CLocationRecord::RequestLocationL(), begin" ); iRequestCurrentLoc = ETrue; if ( iTrailCaptureSetting != RLocationTrail::ECaptureNetworkInfo && !iPositionInfo->IsActive() ) { iPositionInfo->StartL( iTrailCaptureSetting, iInterval ); + SetCurrentState( RLocationTrail::ETrailStarting ); + + iTrailStarted = ETrue; } else if ( iTrailCaptureSetting == RLocationTrail::ECaptureNetworkInfo ) { @@ -298,6 +433,7 @@ iObserver->CurrentLocation( posInfo, network, KErrNone ); iRequestCurrentLoc = EFalse; } + LOG( "CLocationRecord::RequestLocationL(), end" ); } // -------------------------------------------------------------------------- @@ -306,11 +442,14 @@ // EXPORT_C void CLocationRecord::CancelLocationRequest() { + LOG( "CLocationRecord::CancelLocationRequest(), begin" ); iRequestCurrentLoc = EFalse; if ( !iTrailStarted ) { + iGpsDataAvailableFlag = EFalse; iPositionInfo->Stop(); } + LOG( "CLocationRecord::CancelLocationRequest(), end" ); } @@ -351,6 +490,7 @@ void CLocationRecord::Position( const TPositionInfo& aPositionInfo, const TInt aError ) { + LOG( "CLocationRecord::Position(), begin" ); const TPositionSatelliteInfo& positionSatelliteInfo = static_cast(aPositionInfo); @@ -358,56 +498,59 @@ { HandleLocationRequest( positionSatelliteInfo, aError ); } - if( iState == RLocationTrail::ETrailStopped ) - { - LOG("CLocationRecord::Position - trail stopped"); - return; - } + + iGpsDataAvailableFlag = EFalse; - if ( !iTrailStarted ) + if ( !iTrailStarted || iState == RLocationTrail::ETrailStopped) { - iPositionInfo->NextPosition(); + LOG("trail not started/stopped"); + iPositionInfo->Stop(); return; } + // all cases store the location.. + StoreLocation( positionSatelliteInfo ); + + if ( RemappingNeeded() ) + { + //either network or gps signal is available + if ( ( iNetwork.iCellId != 0 && + iNetwork.iCountryCode.Length() != 0 && + iNetwork.iNetworkId.Length() != 0 ) || ( aError == KErrNone ) ) + { + //no error means gps info available + TRAP_IGNORE( RemapObjectsL( aError == KErrNone ) ); + } + } switch ( aError ) { case KPositionPartialUpdate: // fall through case KPositionQualityLoss: { // Location is stored, even if it may not be valid. - StoreLocation( positionSatelliteInfo ); - LOG("CLocationRecord::Position - partial update"); + LOG("Partial update"); if ( iState != RLocationTrail::EWaitingGPSData && iState != RLocationTrail::ETrailStopping ) { SetCurrentState( RLocationTrail::EWaitingGPSData ); - LOG("CLocationRecord::Position trail waiting for gps"); + LOG("Trail waiting for gps"); } break; } case KErrNone: { - StoreLocation( positionSatelliteInfo ); - LOG("CLocationRecord::Position - good GPS coordinates"); + LOG("Good GPS coordinates"); + iGpsDataAvailableFlag = ETrue; if ( iState != RLocationTrail::ETrailStarted ) { if ( iRemapper ) { - LOG("CLocationRecord::Position start remapping"); - iLastLocationId = 0; - TBool createLocation = iRemapper->CheckQueue(); - if( createLocation ) - { - TRAP_IGNORE( - TItemId locationId = DoCreateLocationL( iNewItem.iLocationData ); - iRemapper->UpdateRelationsL( locationId ); - ) - } + LOG("Start remapping"); iRemapper->StartRemappingObjects( iNewItem.iLocationData ); if( iObserver->WaitForPositioningStopTimeout() && !RemappingNeeded() ) { iObserver->RemapedCompleted(); + iPositionInfo->HandleRemapComplete(); return; } @@ -415,47 +558,135 @@ if ( iState != RLocationTrail::ETrailStopping ) { SetCurrentState( RLocationTrail::ETrailStarted ); - LOG("CLocationRecord::Position trail started"); + LOG("Trail started"); } } break; } default: { - StoreLocation( positionSatelliteInfo ); - LOG1("CLocationRecord::Position - searching GPS, aError %d", aError ); + LOG1("Searching GPS, aError %d", aError ); if ( iState != RLocationTrail::ESearchingGPS && iState != RLocationTrail::ETrailStopping ) { SetCurrentState( RLocationTrail::ESearchingGPS ); - LOG("CLocationRecord::Position trail searching gps"); + LOG("Trail searching gps"); } break; } } TBool fixState = CheckGPSFix( positionSatelliteInfo ); - LOG1( "CLocationRecord::Position fixState %d", fixState ); - LOG1( "CLocationRecord::Position iLastGPSFixState %d", iLastGPSFixState ); + LOG1( "fixState %d", fixState ); + LOG1( "iLastGPSFixState %d", iLastGPSFixState ); if ( iObserver && iLastGPSFixState != fixState ) { - LOG("CLocationRecord::Position quality changed"); + LOG("Quality changed"); iObserver->GPSSignalQualityChanged( positionSatelliteInfo ); } iLastGPSFixState = fixState; - iPositionInfo->NextPosition(); + LOG( "CLocationRecord::Position(), end" ); + } + + +// -------------------------------------------------------------------------- +// CLocationRecord::RemapObjectsL +// Remaps the location objects when GPS is available +// -------------------------------------------------------------------------- +// +void CLocationRecord::RemapObjectsL( TBool aGPSInfoAvailable ) + { + LOG( "CLocationRecord::RemapObjectsL(), begin" ); + TBool createLocation = EFalse; + + if (iRemapper) + { + createLocation = iRemapper->CheckQueue(); + } + + if ( !createLocation || iRemapper == NULL) + { + return; + } + + + if ( aGPSInfoAvailable ) + { + TItemId locationId = DoCreateLocationL( iNewItem.iLocationData ); + iRemapper->UpdateRelationsL( locationId ); +#ifdef LOC_REVERSEGEOCODE + if(!(iMediaHandlingFlag & KReverseGeoCodingInProgress)) + { + iRemapState = ERemapRevGeoCodeInProgress; + //Find the address by coordinate, results a call to ReverseGeocodeComplete() + iMediaHandlingFlag |= KReverseGeoCodingInProgress; + + if(iRevGeocoderPlugin) + { + iRevGeocoderPlugin->GetAddressByCoordinateL( iNewItem.iLocationData.iPosition, iConnectionOption ); + } + } + else + { + // make this as pending state so that on rev geo code complete + // it will take the priority over the next item within the location + // item in location queue. + iRemapState = ERemapRevGeoCodePending; + } +#endif //LOC_REVERSEGEOCODE + } + else + { + //call location m/w API to convert cell ID to lat, long +#ifdef LOC_GEOTAGGING_CELLID + if((iMediaHandlingFlag & KSnapGeoConvertInProgress) > 0) + { + iRemapState = ERemapNwGeoConverterPending; + } + else + { + // go for cell id based geo coding. + iRemapState = ERemapNwGeoConverterInProgress; + if(iGeoConverter == NULL) + { + iGeoConverter = CGeoConverter::NewL(*this); + } + iGeoConverter->ConvertL(iNewItem.iLocationData.iNetworkInfo); + iMediaHandlingFlag |= KSnapGeoConvertInProgress; + } +#endif + } +#ifdef LOC_REVERSEGEOCODE + if((iMediaHandlingFlag & KSnapGeoConvertInProgress) > 0 || + (iMediaHandlingFlag & KReverseGeoCodingInProgress) > 0) +#else + if((iMediaHandlingFlag & KSnapGeoConvertInProgress) > 0 ) +#endif //LOC_REVERSEGEOCODE + { + // stop n/w info change listener, since device may connect to n/w + // and local trail will receive so many call backs on current n/w info change. + iNetworkInfoChangeListener->StopNwInfoChangeNotifier(); + } + else + { + iNetworkInfoChangeListener->StartNwInfoChangeNotifier(); + } + LOG( "CLocationRecord::RemapObjectsL(), end" ); + } TBool CLocationRecord::CheckGPSFix( const TPositionSatelliteInfo& aSatelliteInfo ) { + LOG("CLocationRecord::CheckGPSFix, begin"); TPosition position; aSatelliteInfo.GetPosition( position ); - LOG1( "CLocationRecord::CheckGPSFix latitude %f", position.Latitude() ); - LOG1( "CLocationRecord::CheckGPSFix longitude %f", position.Longitude() ); + LOG1( "latitude %f", position.Latitude() ); + LOG1( "longitude %f", position.Longitude() ); TBool ret = ( Math::IsNaN(position.Latitude()) || Math::IsNaN(position.Longitude()) ) ? EFalse : ETrue; + LOG1("CLocationRecord::CheckGPSFix, end. Ret - %d", ret); return ret; } @@ -467,7 +698,7 @@ void CLocationRecord::NetworkInfo( const CTelephony::TNetworkInfoV1 &aNetworkInfo, const TInt aError ) { - LOG("CLocationRecord::NetworkInfo"); + LOG("CLocationRecord::NetworkInfo, begin"); if ( aError == KErrNone ) { LOG("CLocationRecord::NetworkInfo - KErrNone"); @@ -492,6 +723,17 @@ iNetwork.iCountryCode.Zero(); iNetwork.iNetworkId.Zero(); } + LOG( "CLocationRecord::NetworkInfo(), end" ); + } + +// -------------------------------------------------------------------------- +// CLocationRecord::GetMobilePhone4NwInfo +// -------------------------------------------------------------------------- +// +RMobilePhone& CLocationRecord::GetMobilePhone4NwInfo() + { + LOG( "CLocationRecord::GetMobilePhone4NwInfo()" ); + return iPhone; } // -------------------------------------------------------------------------- @@ -500,6 +742,7 @@ // void CLocationRecord::StoreLocation( const TPositionSatelliteInfo& aSatelliteInfo ) { + LOG( "CLocationRecord::StoreLocation(), begin" ); aSatelliteInfo.GetPosition( iNewItem.iLocationData.iPosition ); aSatelliteInfo.GetCourse( iNewItem.iLocationData.iCourse ); iNewItem.iLocationData.iSatellites = aSatelliteInfo.NumSatellitesUsed(); @@ -511,7 +754,13 @@ iNewItem.iTimeStamp.UniversalTime(); iNewItem.iTrailState = iState; - TInt error = iTrail.Append( iNewItem ); + TLocationTrailItem *item = new TLocationTrailItem(); + TInt error = KErrNone; + if(item != NULL) + { + *item = iNewItem; + error = iTrail.Append( item ); + } // If appending an item to the trail fails because of OOM, remove oldest trail items // until the new item fits or there's only one item left in the trail. @@ -519,18 +768,22 @@ { LOG("CLocationRecord::StoreLocation - Out of memory! Shortening trail!"); iTrail.Remove( 0 ); - error = iTrail.Append( iNewItem ); + error = iTrail.Append( item ); } if ( iTrail.Count() > iMaxTrailSize ) { + item = iTrail[0]; iTrail.Remove( 0 ); + iTrail.Compress(); + delete item; } if( iAddObserver ) { iAddObserver->LocationAdded( iNewItem, aSatelliteInfo ); } + LOG( "CLocationRecord::StoreLocation(), end" ); } // -------------------------------------------------------------------------- @@ -541,7 +794,33 @@ { LOG1( "CLocationRecord::SetCurrentState(), begin, state:%d", aState ); iState = aState; - iProperty.Set( KPSUidLocationTrail, KLocationTrailState, (TInt) aState ); + if( iTrailStarted ) + { + // Set the property only when trail is started to avoid icon flickering and wrong icon update in UI + if( iGpsDataAvailableFlag || + iNetwork.iCellId > 0 && + ((iNetwork.iLocationAreaCode == 0 && iNetwork.iAccess == CTelephony::ENetworkAccessUtran) || // 3G + (iNetwork.iLocationAreaCode > 0 && (iNetwork.iAccess == CTelephony::ENetworkAccessGsm || // 2G + iNetwork.iAccess == CTelephony::ENetworkAccessGsmCompact))) && + iNetwork.iCountryCode.Length() > 0 && + iNetwork.iNetworkId.Length() > 0 ) + { + // set the value 3 to have Geo tag available icon else not available. + iProperty.Set( KPSUidLocationTrail, KLocationTrailState, + (TInt) RLocationTrail::ETrailStarted ); + } + else + { + iProperty.Set( KPSUidLocationTrail, KLocationTrailState, + (TInt) RLocationTrail::ETrailStopped ); + } + } + else + { + iProperty.Set( KPSUidLocationTrail, KLocationTrailState, + (TInt) RLocationTrail::ETrailStopped ); + } + if ( iObserver ) { iObserver->LocationTrailStateChange(); @@ -556,6 +835,7 @@ void CLocationRecord::HandleLocationRequest( const TPositionSatelliteInfo& aSatelliteInfo, const TInt aError ) { + LOG( "CLocationRecord::HandleLocationRequest(), begin" ); CTelephony::TNetworkInfoV1 network = CTelephony::TNetworkInfoV1(); if ( aError == KErrNone ) { @@ -564,6 +844,7 @@ iRequestCurrentLoc = EFalse; if ( !iTrailStarted ) { + iGpsDataAvailableFlag = EFalse; iPositionInfo->Stop(); } } @@ -577,12 +858,19 @@ iLocationCounter = 0; if ( !iTrailStarted ) { + iGpsDataAvailableFlag = EFalse; iPositionInfo->Stop(); } } - } + } + LOG( "CLocationRecord::HandleLocationRequest(), end" ); } + +// -------------------------------------------------------------------------- +// CLocationRecord::UpdateNetworkInfo +// -------------------------------------------------------------------------- +// TInt CLocationRecord::UpdateNetworkInfo( TAny* aAny ) { TPositionSatelliteInfo nullPositionInfo; @@ -595,124 +883,167 @@ EXPORT_C void CLocationRecord::CreateLocationObjectL( const TLocationData& aLocationData, const TUint& aObjectId ) { - TItemId locationId = DoCreateLocationL( aLocationData ); - CreateRelationL( aObjectId, locationId ); + LOG( "CLocationRecord::CreateLocationObjectL(), begin" ); + TLocationSnapshotItem* newItem = new (ELeave) TLocationSnapshotItem; + newItem->iObjectId = aObjectId; + newItem->iLocationData = aLocationData; + + // for downloaded files, network informations are not valid. + // Do location handling only based on lat/lon + // all all n/w information to invalid value. + newItem->iLocationData.iNetworkInfo.iCellId = 0; + newItem->iLocationData.iNetworkInfo.iAccess = CTelephony::ENetworkAccessUnknown; + newItem->iLocationData.iNetworkInfo.iLocationAreaCode = 0; + newItem->iLocationData.iNetworkInfo.iCountryCode.Zero(); + newItem->iLocationData.iNetworkInfo.iNetworkId.Zero(); + newItem->iFlag = KDownloadMediaFile; + + iMediaItems.Append( newItem ); + FindLocationFromDBL(); + GeoTaggingCompleted(); + LOG( "CLocationRecord::CreateLocationObjectL(), end" ); + } - +// -------------------------------------------------------------------------- +// CLocationRecord::LocationSnapshotL +// -------------------------------------------------------------------------- +// EXPORT_C void CLocationRecord::LocationSnapshotL( const TUint& aObjectId ) { - LOG("CLocationRecord::LocationSnapshotL"); - + LOG( "CLocationRecord::LocationSnapshotL(), begin" ); TBool previousMatch = EFalse; - CMdENamespaceDef& namespaceDef = iMdeSession->GetDefaultNamespaceDefL(); // get locationdata from trail with object time TTime timestamp = GetMdeObjectTimeL( aObjectId ); TLocationData locationData; TLocTrailState state; - GetLocationByTimeL( timestamp, locationData, state ); - - iObjectId = aObjectId; - iLocationData = locationData; + TRAPD(err, GetLocationByTimeL( timestamp, locationData, state )); + if(err != KErrNone && iTrailStarted) + { + // Execution shouldn't come over here. + // Handling error case in worst sceenario.. + StartL(iTrailCaptureSetting); + // this case may apprear, when cache data is not within the delta limit because someone call stop trail. + // sceenario, take photograph, then stop taking for sometime, again take photograph. + // during this time, if there is no change in position (because someone stop trail) and n/w, then cache has old value. + // go with the n/w based. + LOG( "Old trail cache. go for n/w based." ); + UpdateNetworkInfo( this ); + // again read the location. + GetLocationByTimeL( timestamp, locationData, state ); + } + TLocationSnapshotItem* newItem = new (ELeave) TLocationSnapshotItem; + newItem->iObjectId = aObjectId; + newItem->iLocationData = locationData; + newItem->iFlag = KSnapMediaFile; + + iMediaItems.Append( newItem ); + TItemId lastLocationId = 0; + if ( (iLastMediaItem.iFlag & KSnapMediaFile) > 0) + { + lastLocationId = iLastMediaItem.iLocationId; + } + + CTelephony::TNetworkInfoV1* net = &locationData.iNetworkInfo; // capture only network data if ( iTrailCaptureSetting == RLocationTrail::ECaptureNetworkInfo ) { - CTelephony::TNetworkInfoV1* net = &locationData.iNetworkInfo; + if ( net->iCellId == 0 && + net->iLocationAreaCode == 0 && + net->iCountryCode.Length() == 0 && + net->iNetworkId.Length() == 0 ) + { + // no n/w info... put it into remap. + // remove the last appended element. + LOG("No network info (offline mode + no GPS fix), keep for remapping"); + TRemapItem remapItem; + remapItem.iObjectId = aObjectId; + remapItem.iTime = timestamp; + iRemapper->Append( remapItem ); + TLocationSnapshotItem* firstPtr = iMediaItems[iMediaItems.Count() - 1]; + iMediaItems.Remove(iMediaItems.Count() - 1); + iMediaItems.Compress(); + delete firstPtr; + } + else + { + // n/w info available + NetworkInfoSnapshotL(); + } + } + else if ( Math::IsNaN( locationData.iPosition.Latitude() ) && + Math::IsNaN( locationData.iPosition.Longitude() )) + { + // coordinates empty, with or without cellular info + if ( net->iCellId == 0 && net->iLocationAreaCode == 0 && net->iCountryCode.Length() == 0 && net->iNetworkId.Length() == 0 ) { - // nothing to do - LOG("CLocationRecord::LocationSnapshotL - no network info available"); - } - else if ( iLastLocationId != 0 ) - { - CTelephony::TNetworkInfoV1* lastnet = &iLastLocation.iNetworkInfo; - - // compare to previous network info - TItemId locationId = iLastLocationId; - if ( lastnet->iCellId != net->iCellId || - lastnet->iLocationAreaCode != net->iLocationAreaCode || - lastnet->iCountryCode != net->iCountryCode || - lastnet->iNetworkId != net->iNetworkId ) - { - LOG("CLocationRecord::LocationSnapshotL - network info changed"); - locationId = DoCreateLocationL( locationData ); - } - CreateRelationL( aObjectId, locationId ); - } - else - { - // new location - TItemId locationId = DoCreateLocationL( locationData ); - CreateRelationL( aObjectId, locationId ); - } - return; - } - - // coordinates empty (will be remapped) - if ( Math::IsNaN( locationData.iPosition.Latitude() ) && - Math::IsNaN( locationData.iPosition.Longitude() )) - { - TRemapItem remapItem; - remapItem.iObjectId = aObjectId; - remapItem.iTime = timestamp; + LOG("No network info (offline mode + no GPS fix), keep for remapping"); + TRemapItem remapItem; + remapItem.iObjectId = aObjectId; + remapItem.iTime = timestamp; + iRemapper->Append( remapItem ); - CTelephony::TNetworkInfoV1* net = &locationData.iNetworkInfo; - - // no network info (offline mode + no GPS fix) - if ( net->iCellId == 0 && - net->iLocationAreaCode == 0 && - net->iCountryCode.Length() == 0 && - net->iNetworkId.Length() == 0 ) - { - LOG("CLocationRecord::LocationSnapshotL - empty remap item created"); + TLocationSnapshotItem* firstPtr = iMediaItems[iMediaItems.Count() - 1]; + iMediaItems.Remove(iMediaItems.Count() - 1); + iMediaItems.Compress(); + delete firstPtr; } // check match for last created locationobject - else if ( iLastLocationId != 0 ) +#ifdef LOC_REVERSEGEOCODE + else if ( (iLastMediaItem.iFlag & KSnapMediaFile) > 0 && + iLastMediaItem.iCountryTagId > 0) +#else + else if ( (iLastMediaItem.iFlag & KSnapMediaFile) > 0) +#endif //LOC_REVERSEGEOCODE { - TItemId locationId; - CTelephony::TNetworkInfoV1* lastnet = &iLastLocation.iNetworkInfo; + TLocationData lastLocationData = iLastMediaItem.iLocationData; + CTelephony::TNetworkInfoV1* lastnet = &lastLocationData.iNetworkInfo; // networkinfo changed from last location - if ( lastnet->iCellId != net->iCellId || - lastnet->iLocationAreaCode != net->iLocationAreaCode || - lastnet->iCountryCode != net->iCountryCode || - lastnet->iNetworkId != net->iNetworkId ) + if ( lastnet->iCellId == net->iCellId && + lastnet->iLocationAreaCode == net->iLocationAreaCode && + lastnet->iCountryCode == net->iCountryCode && + lastnet->iNetworkId == net->iNetworkId ) { - LOG("CLocationRecord::LocationSnapshotL - remap with new network info"); - locationId = DoCreateLocationL( locationData ); - } - else - { - LOG("CLocationRecord::LocationSnapshotL - remap with previous network info"); - locationId = iLastLocationId; + // same network. + previousMatch = ETrue; + CreateRelationL( aObjectId, lastLocationId ); + // attach same tags associated to last location +#ifdef LOC_REVERSEGEOCODE + if ( iLastMediaItem.iCountryTagId ) //found from DB last time + { + iTagCreator->AttachTagsL( aObjectId, + iLastMediaItem.iCountryTagId, iLastMediaItem.iCityTagId ); + } +#endif //LOC_REVERSEGEOCODE + // remove the current item. + TLocationSnapshotItem* firstPtr = iMediaItems[iMediaItems.Count() - 1]; + iMediaItems.Remove(iMediaItems.Count() - 1); + iMediaItems.Compress(); + delete firstPtr; } - TItemId relationId = CreateRelationL( aObjectId, locationId ); - remapItem.iLocationId = locationId; - remapItem.iRelationId = relationId; } - else - { - // new location with only network data - TItemId locationId = DoCreateLocationL( locationData ); - TItemId relationId = CreateRelationL( aObjectId, locationId ); - remapItem.iLocationId = locationId; - remapItem.iRelationId = relationId; - } - iRemapper->Append( remapItem ); - return; + + if ( !previousMatch ) + { + // go for n/w based + newItem->iFlag |= KNetQueryBit; + } } - + // valid coordinates found - if ( iLastLocationId != 0 ) + else if ( lastLocationId != 0 && + ((iLastMediaItem.iFlag & KSnapMediaFile) > 0)) { - CTelephony::TNetworkInfoV1* net = &locationData.iNetworkInfo; - CTelephony::TNetworkInfoV1* lastnet = &iLastLocation.iNetworkInfo; + TLocationData lastLocationData = iLastMediaItem.iLocationData; + CTelephony::TNetworkInfoV1* lastnet = &lastLocationData.iNetworkInfo; // first check if networkinfo matches last created location if ( lastnet->iCellId == net->iCellId && @@ -720,23 +1051,60 @@ lastnet->iCountryCode == net->iCountryCode && lastnet->iNetworkId == net->iNetworkId ) { - LOG("CLocationRecord::LocationSnapshotL - network info matches"); // if both locations have valid coordinates, calculate distance between points - if ( !Math::IsNaN( iLastLocation.iPosition.Latitude() ) && - !Math::IsNaN( iLastLocation.iPosition.Longitude() ) && + if ( !Math::IsNaN( lastLocationData.iPosition.Latitude() ) && + !Math::IsNaN( lastLocationData.iPosition.Longitude() ) && !Math::IsNaN( locationData.iPosition.Latitude() ) && !Math::IsNaN( locationData.iPosition.Longitude() )) { TReal32 distance; - TInt err = locationData.iPosition.Distance(iLastLocation.iPosition, distance); + TInt err = locationData.iPosition.Distance(lastLocationData.iPosition, distance); if ( distance < iLocationDelta ) { - LOG("CLocationRecord::LocationSnapshotL - location close to the previous one"); + LOG("location close to the previous one"); previousMatch = ETrue; - CreateRelationL( aObjectId, iLastLocationId ); - LOG("CLocationRecord::CreateLocationObjectL - last location matched"); + CreateRelationL( aObjectId, lastLocationId ); + +#ifdef LOC_REVERSEGEOCODE + // attach same tags associated to last location + if ( iLastMediaItem.iCountryTagId ) + { + iTagCreator->AttachTagsL( + aObjectId, iLastMediaItem.iCountryTagId, iLastMediaItem.iCityTagId ); + TLocationSnapshotItem* firstPtr = iMediaItems[iMediaItems.Count() - 1]; + iMediaItems.Remove(iMediaItems.Count() - 1); + iMediaItems.Compress(); + delete firstPtr; + } + else + { + // country tag not found.. go for reverse geocoding.. + newItem->iLocationId = lastLocationId; + iLocationItems.Append( newItem ); + iMediaItems.Remove(iMediaItems.Count() - 1); + iMediaItems.Compress(); + + if(!(iMediaHandlingFlag & KReverseGeoCodingInProgress)) + { + iMediaHandlingFlag |= KReverseGeoCodingInProgress; + if(iRevGeocoderPlugin) + { + iRevGeocoderPlugin->GetAddressByCoordinateL + ( iLocationItems[0]->iLocationData.iPosition, + iConnectionOption); + } + } + } +#else + // remove from the queue + TLocationSnapshotItem* firstPtr = iMediaItems[iMediaItems.Count() - 1]; + iMediaItems.Remove(iMediaItems.Count() - 1); + iMediaItems.Compress(); + delete firstPtr; + +#endif //LOC_REVERSEGEOCODE } } } @@ -745,109 +1113,194 @@ // last location did not match, find existing one from DB if( !previousMatch ) { - LOG("CLocationRecord::LocationSnapshotL - query location"); - const TReal64 KMeterInDegrees = 0.000009; - const TReal64 KPi = 3.14159265358979; - const TReal32 K180Degrees = 180.0; - - TReal64 latitude = locationData.iPosition.Latitude(); - TReal64 longitude = locationData.iPosition.Longitude(); - // calculate distance in degrees - TReal64 cosine; - Math::Cos(cosine, locationData.iPosition.Latitude() * KPi / K180Degrees ); - TReal64 latDelta = iLocationDelta * KMeterInDegrees; - TReal64 lonDelta = latDelta * cosine; - - CMdEObjectDef& locationObjectDef = namespaceDef.GetObjectDefL( Location::KLocationObject ); - - CMdEPropertyDef& latitudeDef = locationObjectDef.GetPropertyDefL( - Location::KLatitudeProperty ); - CMdEPropertyDef& longitudeDef = locationObjectDef.GetPropertyDefL( - Location::KLongitudeProperty ); - CMdEPropertyDef& cellIdDef = locationObjectDef.GetPropertyDefL( - Location::KCellIdProperty ); - CMdEPropertyDef& locationCodeDef = locationObjectDef.GetPropertyDefL( - Location::KLocationAreaCodeProperty ); - CMdEPropertyDef& countryCodeDef = locationObjectDef.GetPropertyDefL( - Location::KCountryCodeProperty ); - CMdEPropertyDef& networkCodeDef = locationObjectDef.GetPropertyDefL( - Location::KNetworkCodeProperty ); - - iLocationQuery = iMdeSession->NewObjectQueryL( namespaceDef, locationObjectDef, this ); - CMdELogicCondition& cond = iLocationQuery->Conditions(); - cond.SetOperator( ELogicConditionOperatorAnd ); - - LOG1( "CLocationRecord::LocationSnapshotL latitude: %f", latitude); - LOG1( "CLocationRecord::LocationSnapshotL latdelta: %f", latDelta); - LOG1( "CLocationRecord::LocationSnapshotL longitude: %f", longitude); - LOG1( "CLocationRecord::LocationSnapshotL londelta: %f", lonDelta); - - cond.AddPropertyConditionL( latitudeDef, - TMdERealBetween( latitude - latDelta, latitude + latDelta )); - cond.AddPropertyConditionL( longitudeDef, - TMdERealBetween( longitude - lonDelta, longitude + lonDelta )); - cond.AddPropertyConditionL( cellIdDef, - TMdEUintEqual( locationData.iNetworkInfo.iCellId) ); - cond.AddPropertyConditionL( locationCodeDef, - TMdEUintEqual( locationData.iNetworkInfo.iLocationAreaCode) ); - cond.AddPropertyConditionL( countryCodeDef, ETextPropertyConditionCompareEquals, - locationData.iNetworkInfo.iCountryCode ); - cond.AddPropertyConditionL( networkCodeDef, ETextPropertyConditionCompareEquals, - locationData.iNetworkInfo.iNetworkId ); - - iLocationQuery->FindL(); + FindLocationFromDBL(); } + LOG( "CLocationRecord::LocationSnapshotL(), end" ); } - -TItemId CLocationRecord::DoCreateLocationL( const TLocationData& aLocationData ) + +// -------------------------------------------------------------------------- +// CLocationRecord::NetworkInfoSnapshotL +// -------------------------------------------------------------------------- +// +void CLocationRecord::NetworkInfoSnapshotL() + { + LOG( "CLocationRecord::NetworkInfoSnapshotL(), begin" ); + // n/w info available.. always act on last element within the queue + TInt lastItemIndex = iMediaItems.Count() - 1; + if ( lastItemIndex >= 0 && + (iMediaItems[lastItemIndex]->iFlag & KSnapMediaFile) > 0 ) + { + CTelephony::TNetworkInfoV1* net = &iMediaItems[lastItemIndex]->iLocationData.iNetworkInfo; + //only for snap item. + if ( (iLastMediaItem.iFlag & KSnapMediaFile) > 0 ) + { + CTelephony::TNetworkInfoV1* lastnet = &iLastMediaItem.iLocationData.iNetworkInfo; + + // compare to previous network info + TItemId locationId = iLastMediaItem.iLocationId; + if ( lastnet->iCellId != net->iCellId || + lastnet->iLocationAreaCode != net->iLocationAreaCode || + lastnet->iCountryCode != net->iCountryCode || + lastnet->iNetworkId != net->iNetworkId ) + { + // last one is not matching. + // let's check the database of any existing etry. + iMediaItems[lastItemIndex]->iFlag |= KNetQueryBit; + } + else + { + // matching with the last entry. Just create a relation. + CreateRelationL( iMediaItems[lastItemIndex]->iObjectId, locationId ); + TLocationSnapshotItem* firstPtr = iMediaItems[lastItemIndex]; + iMediaItems.Remove(lastItemIndex); + delete firstPtr; + } + } + else + { + // let's check the database of any existing etry. + iMediaItems[lastItemIndex]->iFlag |= KNetQueryBit; + } + } + LOG( "CLocationRecord::NetworkInfoSnapshotL(), end" ); + } + + +// -------------------------------------------------------------------------- +// CLocationRecord::FindLocationFromDBL +// -------------------------------------------------------------------------- +// +void CLocationRecord::FindLocationFromDBL() + { + LOG( "CLocationRecord::FindLocationFromDBL(), begin" ); + if(((iMediaHandlingFlag & KLocationQueryInProgress)> 0) + || (iMediaItems.Count() <= 0)) + { + // query is in progress or queue is empty + LOG1( "query is in progress or queue is empty. Count - %d", iMediaItems.Count() ); + return; + } + if ( (iMediaItems[0]->iFlag & KNetQueryBit) > 0 ) + { + // n/w based. + FindLocationWithSameNetInfoL(); + return; + } + + const TReal64 KMeterInDegrees = 0.000009; + const TReal64 KPi = 3.14159265358979; + const TReal32 K180Degrees = 180.0; + + //TLocationData locationData = iMediaItems[0].iLocationData; + + TReal64 latitude = iMediaItems[0]->iLocationData.iPosition.Latitude(); + TReal64 longitude = iMediaItems[0]->iLocationData.iPosition.Longitude(); + // calculate distance in degrees + TReal64 cosine; + Math::Cos(cosine, latitude * KPi / K180Degrees ); + TReal64 latDelta = iLocationDelta * KMeterInDegrees; + TReal64 lonDelta = latDelta * cosine; + + //get network related defs + CMdEPropertyDef& cellIdDef = iLocationObjectDef->GetPropertyDefL( + Location::KCellIdProperty ); + CMdEPropertyDef& locationCodeDef = iLocationObjectDef->GetPropertyDefL( + Location::KLocationAreaCodeProperty ); + CMdEPropertyDef& countryCodeDef = iLocationObjectDef->GetPropertyDefL( + Location::KCountryCodeProperty ); + CMdEPropertyDef& networkCodeDef = iLocationObjectDef->GetPropertyDefL( + Location::KNetworkCodeProperty ); + if(iLocationQuery) + { + iLocationQuery->RemoveObserver(*this); + iLocationQuery->Cancel(); + delete iLocationQuery; + iLocationQuery = NULL; + } + iLocationQuery = iMdeSession->NewObjectQueryL( *iNamespaceDef, *iLocationObjectDef, this ); + + CMdELogicCondition& cond = iLocationQuery->Conditions(); + cond.SetOperator( ELogicConditionOperatorAnd ); + + LOG1( "latitude: %f", latitude); + LOG1( "latdelta: %f", latDelta); + LOG1( "longitude: %f", longitude); + LOG1( "londelta: %f", lonDelta); + + cond.AddPropertyConditionL( *iLatitudeDef, + TMdERealBetween( latitude - latDelta, latitude + latDelta )); + cond.AddPropertyConditionL( *iLongitudeDef, + TMdERealBetween( longitude - lonDelta, longitude + lonDelta )); + + if ( iMediaItems[0]->iLocationData.iNetworkInfo.iCellId > 0 ) + { + cond.AddPropertyConditionL( cellIdDef, + TMdEUintEqual( iMediaItems[0]->iLocationData.iNetworkInfo.iCellId) ); + } + if ( iMediaItems[0]->iLocationData.iNetworkInfo.iLocationAreaCode > 0 ) + { + cond.AddPropertyConditionL( locationCodeDef, + TMdEUintEqual( iMediaItems[0]->iLocationData.iNetworkInfo.iLocationAreaCode) ); + } + if ( iMediaItems[0]->iLocationData.iNetworkInfo.iCountryCode.Length() > 0 ) + { + cond.AddPropertyConditionL( countryCodeDef, ETextPropertyConditionCompareEquals, + iMediaItems[0]->iLocationData.iNetworkInfo.iCountryCode ); + } + if ( iMediaItems[0]->iLocationData.iNetworkInfo.iNetworkId.Length() > 0 ) + { + cond.AddPropertyConditionL( networkCodeDef, ETextPropertyConditionCompareEquals, + iMediaItems[0]->iLocationData.iNetworkInfo.iNetworkId ); + } + iMediaHandlingFlag |= KLocationQueryInProgress; + iLocationQuery->FindL(); + + LOG( "CLocationRecord::FindLocationFromDBL(), end" ); + } + + +// -------------------------------------------------------------------------- +// CLocationRecord::DoCreateLocationL +// -------------------------------------------------------------------------- +// +TItemId CLocationRecord::DoCreateLocationL( const TLocationData& aLocationData ) { - LOG("CLocationRecord::DoCreateLocationL - start"); + LOG( "CLocationRecord::DoCreateLocationL(), begin" ); TItemId locationObjectId; - CMdENamespaceDef& namespaceDef = iMdeSession->GetDefaultNamespaceDefL(); - - CMdEObjectDef& locationObjectDef = namespaceDef.GetObjectDefL( Location::KLocationObject ); - // required object properties - CMdEPropertyDef& creationDef = locationObjectDef.GetPropertyDefL( + CMdEPropertyDef& creationDef = iLocationObjectDef->GetPropertyDefL( Object::KCreationDateProperty ); - CMdEPropertyDef& modifiedDef = locationObjectDef.GetPropertyDefL( + CMdEPropertyDef& modifiedDef = iLocationObjectDef->GetPropertyDefL( Object::KLastModifiedDateProperty ); - CMdEPropertyDef& sizeDef = locationObjectDef.GetPropertyDefL( + CMdEPropertyDef& sizeDef = iLocationObjectDef->GetPropertyDefL( Object::KSizeProperty ); - CMdEPropertyDef& itemTypeDef = locationObjectDef.GetPropertyDefL( + CMdEPropertyDef& itemTypeDef = iLocationObjectDef->GetPropertyDefL( Object::KItemTypeProperty ); - CMdEPropertyDef& offSetDef = locationObjectDef.GetPropertyDefL( + CMdEPropertyDef& offSetDef = iLocationObjectDef->GetPropertyDefL( Object::KTimeOffsetProperty ); // location related properties - CMdEPropertyDef& cellIdDef = locationObjectDef.GetPropertyDefL( + CMdEPropertyDef& cellIdDef = iLocationObjectDef->GetPropertyDefL( Location::KCellIdProperty ); - CMdEPropertyDef& latitudeDef = locationObjectDef.GetPropertyDefL( - Location::KLatitudeProperty ); - CMdEPropertyDef& longitudeDef = locationObjectDef.GetPropertyDefL( - Location::KLongitudeProperty ); - CMdEPropertyDef& altitudeDef = locationObjectDef.GetPropertyDefL( - Location::KAltitudeProperty ); - - CMdEPropertyDef& directionDef = locationObjectDef.GetPropertyDefL( + CMdEPropertyDef& directionDef = iLocationObjectDef->GetPropertyDefL( Location::KDirectionProperty ); - CMdEPropertyDef& speedDef = locationObjectDef.GetPropertyDefL( + CMdEPropertyDef& speedDef = iLocationObjectDef->GetPropertyDefL( Location::KSpeedProperty ); - CMdEPropertyDef& locationCodeDef = locationObjectDef.GetPropertyDefL( + CMdEPropertyDef& locationCodeDef = iLocationObjectDef->GetPropertyDefL( Location::KLocationAreaCodeProperty ); - CMdEPropertyDef& countryCodeDef = locationObjectDef.GetPropertyDefL( + CMdEPropertyDef& countryCodeDef = iLocationObjectDef->GetPropertyDefL( Location::KCountryCodeProperty ); - CMdEPropertyDef& networkCodeDef = locationObjectDef.GetPropertyDefL( + CMdEPropertyDef& networkCodeDef = iLocationObjectDef->GetPropertyDefL( Location::KNetworkCodeProperty ); - CMdEPropertyDef& qualityDef = locationObjectDef.GetPropertyDefL( + CMdEPropertyDef& qualityDef = iLocationObjectDef->GetPropertyDefL( Location::KQualityProperty ); // location object CMdEObject* locationObject = NULL; - locationObject = iMdeSession->NewObjectL( locationObjectDef, Object::KAutomaticUri ); + locationObject = iMdeSession->NewObjectL( *iLocationObjectDef, Object::KAutomaticUri ); CleanupStack::PushL( locationObject ); TTime timestamp( 0 ); @@ -863,18 +1316,19 @@ locationObject->AddTextPropertyL( itemTypeDef, Location::KLocationItemType ); locationObject->AddInt16PropertyL( offSetDef, timeOffset.Int() / 60 ); - LOG1( "CLocationRecord::DoCreateLocationL - location created with stamp: %Ld", timestamp.Int64() ); + LOG1( "Location created with stamp: %Ld", timestamp.Int64() ); // location related properties if ( !Math::IsNaN( aLocationData.iPosition.Latitude() ) && !Math::IsNaN( aLocationData.iPosition.Longitude() )) { - locationObject->AddReal64PropertyL( latitudeDef, aLocationData.iPosition.Latitude() ); - locationObject->AddReal64PropertyL( longitudeDef, aLocationData.iPosition.Longitude() ); + locationObject->AddReal64PropertyL( *iLatitudeDef, aLocationData.iPosition.Latitude() ); + locationObject->AddReal64PropertyL( *iLongitudeDef, aLocationData.iPosition.Longitude() ); + } if ( !Math::IsNaN( aLocationData.iPosition.Altitude() ) ) { - locationObject->AddReal64PropertyL( altitudeDef, aLocationData.iPosition.Altitude() ); + locationObject->AddReal64PropertyL( *iAltitudeDef, aLocationData.iPosition.Altitude() ); } if ( !Math::IsNaN( aLocationData.iCourse.Course() ) ) { @@ -916,21 +1370,20 @@ } } - + // Add the location object to the database. locationObjectId = iMdeSession->AddObjectL( *locationObject ); - iLastLocationId = locationObjectId; - iLastLocation = aLocationData; + CleanupStack::PopAndDestroy( locationObject ); + LOG( "CLocationRecord::DoCreateLocationL(), end" ); - CleanupStack::PopAndDestroy( locationObject ); - - LOG("CLocationRecord::DoCreateLocationL - end"); - return locationObjectId; } - +// -------------------------------------------------------------------------- +// CLocationRecord::CreateRelationL +// -------------------------------------------------------------------------- +// TItemId CLocationRecord::CreateRelationL( const TUint& aObjectId, const TUint& aLocationId ) { LOG("CLocationRecord::CreateRelationL - start"); @@ -968,131 +1421,715 @@ LOG( "CLocationRecord::::ReadCenRepValueL(), end" ); } + +// -------------------------------------------------------------------------- +// CLocationRecord::HandleQueryNewResults +// -------------------------------------------------------------------------- +// void CLocationRecord::HandleQueryNewResults(CMdEQuery& /*aQuery*/, TInt /*aFirstNewItemIndex*/, TInt /*aNewItemCount*/) { } + +// -------------------------------------------------------------------------- +// CLocationRecord::HandleQueryCompleted +// -------------------------------------------------------------------------- +// void CLocationRecord::HandleQueryCompleted(CMdEQuery& aQuery, TInt aError) { LOG("CLocationRecord::HandleQueryCompleted - start"); const TInt count = aQuery.Count(); LOG1("CLocationRecord::HandleQueryCompleted count: %d", count); - - CMdENamespaceDef* namespaceDef = NULL; + + if ( aError != KErrNone ) + { + HandleQueryFailure(); + } + + else if ( &aQuery == iLocationQuery ) + { + + TRAPD(err,HandleLocationQueryL( aQuery )); + if(err != KErrNone) + { + // unable to process the first node.. + // remove this and process the next. - TRAP_IGNORE( namespaceDef = &iMdeSession->GetDefaultNamespaceDefL() ); - if ( namespaceDef ) + // reset the flag + HandleQueryFailure(); + } + + } + else if ( &aQuery == iNetLocationQuery ) { - CMdEObjectDef* locationObjectDef = NULL; + TRAPD(err,HandleNetLocationQueryL( aQuery )); + if(err != KErrNone) + { + // unable to process the first node.. + // remove this and process the next. + HandleQueryFailure(); + } + + } - TRAP_IGNORE( locationObjectDef = &namespaceDef->GetObjectDefL( Location::KLocationObject ) ); - if ( locationObjectDef ) - { - CMdEPropertyDef* latitudeDef = NULL; - CMdEPropertyDef* longitudeDef = NULL; - CMdEPropertyDef* altitudeDef = NULL; - - TRAP_IGNORE( - latitudeDef = &locationObjectDef->GetPropertyDefL( - Location::KLatitudeProperty ); - longitudeDef = &locationObjectDef->GetPropertyDefL( - Location::KLongitudeProperty ); - altitudeDef = &locationObjectDef->GetPropertyDefL( - Location::KAltitudeProperty ); - ); +#ifdef LOC_REVERSEGEOCODE + else if ( &aQuery == iImageQuery ) + { + if(aQuery.Count() > 0) + { + + CMdERelation& relation = static_cast( aQuery.ResultItem( 0 ) ); + + TItemId imageId = relation.LeftObjectId(); + + TRAPD(err, GetTagsL( imageId ) ); + if(err != KErrNone) + { + // unable to process the first node.. + // remove this and process the next. + + // reset the flag + HandleQueryFailure(); + } + } + else + { + HandleQueryFailure(); + } + } + + else if ( &aQuery == iTagQuery ) + { + TRAPD(err, HandleTagQueryL( aQuery ) ); + + GeoTaggingCompleted(); + if(err != KErrNone) + { + // unable to process the first node.. + // remove this and process the next. + + // reset the flag + HandleQueryFailure(); + } + } +#endif //LOC_REVERSEGEOCODE + else + { + // execution should not come over here...still take recovery action. + HandleQueryFailure(); + } + GeoTaggingCompleted(); + LOG( "CLocationRecord::HandleQueryCompleted(), end" ); + } - if( latitudeDef && longitudeDef && altitudeDef ) - { - TBool created = EFalse; - for ( TInt i = 0; i < count; i++ ) - { - LOG1("CLocationRecord::HandleQueryCompleted check item: %d", i); - CMdEItem& item = aQuery.ResultItem(i); - CMdEObject& locationObject = static_cast(item); - - CMdEProperty* latProp = NULL; - CMdEProperty* lonProp = NULL; - CMdEProperty* altProp = NULL; - - locationObject.Property( *latitudeDef, latProp, 0 ); - locationObject.Property( *longitudeDef, lonProp, 0 ); - locationObject.Property( *altitudeDef, altProp, 0 ); - - if ( latProp && lonProp ) - { - TReal32 distance; - TCoordinate newCoords; - if ( altProp ) - { - TRAP_IGNORE( newCoords = TCoordinate( latProp->Real64ValueL(), lonProp->Real64ValueL(), (TReal32)altProp->Real64ValueL() ) ); - } - else - { - TRAP_IGNORE( newCoords = TCoordinate( latProp->Real64ValueL(), lonProp->Real64ValueL() ) ); - } - - const TInt err = iLocationData.iPosition.Distance(newCoords, distance); - - if ( distance < iLocationDelta ) - { - LOG("CLocationRecord::HandleQueryCompleted - match found in db"); - TRAPD( err, CreateRelationL( iObjectId, locationObject.Id() ) ); - if( err == KErrNone) - { - created = ETrue; - i = count; - } - else - { - aError = err; - } - } - } - } +// -------------------------------------------------------------------------- +// CLocationRecord::HandleQueryFailure() +// handle MDS query sceenario +// -------------------------------------------------------------------------- +// +void CLocationRecord::HandleQueryFailure() + { + LOG( "CLocationRecord::HandleQueryFailure(), begin" ); + iMediaHandlingFlag &= ~KLocationQueryInProgress; + if ( iMediaItems.Count() > 0 ) + { + TLocationSnapshotItem* firstPtr = iMediaItems[0]; + iMediaItems.Remove(0); + delete firstPtr; + iMediaItems.Compress(); + HandleFindLocationFromDB(); + } + LOG( "CLocationRecord::HandleQueryFailure(), end" ); + } - if ( !created && aError == KErrNone ) - { - LOG("CLocationRecord::HandleQueryCompleted - no match found in db, create new"); - TInt locationId( 0 ); - TRAPD( err, locationId = DoCreateLocationL( iLocationData ) ); - LOG1("CLocationRecord::HandleQueryCompleted - DoCreateLocationL err: %d", err); - if( err == KErrNone ) - { - TRAP( err, CreateRelationL( iObjectId, locationId )); - LOG1("CLocationRecord::HandleQueryCompleted - CreateRelationL err: %d", err); - } - } - } +// -------------------------------------------------------------------------- +// CLocationRecord::HandleFindLocationFromDB() +// handle find location from DB within the non leaving method +// -------------------------------------------------------------------------- +// +void CLocationRecord::HandleFindLocationFromDB() + { + LOG( "CLocationRecord::HandleFindLocationFromDB(), begin" ); + if ( iMediaItems.Count() > 0 ) + { + //TODO: by module owner + TInt trapErr = KErrNone; + TRAP(trapErr,FindLocationFromDBL()); + // no memory, don't proceed further + // other error sceenario, we can move the node to the end and process the next + if(trapErr != KErrNoMemory && trapErr != KErrNone) + { + // other than no memory + TInt numberOfNodes = iMediaItems.Count(); + LOG1("media count - %d\n", numberOfNodes); + while(--numberOfNodes >= 0 && + trapErr != KErrNoMemory && + trapErr != KErrNone) + { + // first remove the node + TLocationSnapshotItem* firstPtr = iMediaItems[0]; + iMediaItems.Remove(0); + // move this to last + iMediaItems.Append(firstPtr); + iMediaItems.Compress(); + trapErr = KErrNone; + // process for the next till we reached the last node. + TRAP(trapErr,FindLocationFromDBL()); + } + } + } + LOG( "CLocationRecord::HandleFindLocationFromDB(), end" ); + } + + +// -------------------------------------------------------------------------- +// CLocationRecord::HandleLocationQuery() +// handle if only gps info available +// -------------------------------------------------------------------------- +// +void CLocationRecord::HandleLocationQueryL( CMdEQuery& aQuery ) + { + LOG( "CLocationRecord::HandleLocationQueryL(), begin" ); + TInt error = KErrNone; + TUint locationId( 0 ); + if ( iMediaItems.Count() <= 0 ) + { + LOG("CLocationRecord::HandleLocationQueryL. No media items to process"); + return; + } + + TLocationData locationData = iMediaItems[0]->iLocationData; + + const TInt count = aQuery.Count(); + //find any location matches + for ( TInt i = 0; i < count; i++ ) + { + LOG1("CLocationRecord::HandleLocationQueryL check item: %d", i); + CMdEItem& item = aQuery.ResultItem(i); + CMdEObject& locationObject = static_cast(item); + + CMdEProperty* latProp = NULL; + CMdEProperty* lonProp = NULL; + CMdEProperty* altProp = NULL; + + locationObject.Property( *iLatitudeDef, latProp, 0 ); + locationObject.Property( *iLongitudeDef, lonProp, 0 ); + locationObject.Property( *iAltitudeDef, altProp, 0 ); + + if ( latProp && lonProp ) + { + TReal32 distance; + TCoordinate newCoords; + + TReal64 lat = latProp->Real64ValueL(); + TReal64 lon = lonProp->Real64ValueL(); + if ( altProp ) + { + TReal32 alt = (TReal32)altProp->Real64ValueL(); + newCoords = TCoordinate( lat, lon, alt ); + } + else + { + newCoords = TCoordinate( lat, lon ); + } + + locationData.iPosition.Distance(newCoords, distance); + + if ( distance < iLocationDelta ) + { + i = count; + locationId = locationObject.Id(); + iMediaItems[0]->iLocationId = locationId; + break; + } } } + + + if ( locationId ) + { + TRAP( error, CreateRelationL( iMediaItems[0]->iObjectId, locationId ) ); + +#ifdef LOC_REVERSEGEOCODE + if( error == KErrNone) + { + //find out if image for this location is tagged already + GetRelatedImageL( locationId ); + } +#else + TLocationSnapshotItem* firstPtr = iMediaItems[0]; + iMediaItems.Remove(0); + delete firstPtr; + iMediaItems.Compress(); + iMediaHandlingFlag &= ~KLocationQueryInProgress; + if ( iMediaItems.Count() > 0 ) + { + FindLocationFromDBL(); + } +#endif //LOC_REVERSEGEOCODE + } + else + { + + if((iMediaItems[0]->iFlag & KDownloadMediaFile) > 0) + { + locationData.iNetworkInfo.iCellId = 0; + locationData.iNetworkInfo.iAccess = CTelephony::ENetworkAccessUnknown; + locationData.iNetworkInfo.iLocationAreaCode = 0; + locationData.iNetworkInfo.iCountryCode.Zero(); + locationData.iNetworkInfo.iNetworkId.Zero(); + } + TRAP( error, locationId = DoCreateLocationL( locationData ) ); - LOG("CLocationRecord::HandleQueryCompleted - end"); + if ( error == KErrNone ) + { + iMediaItems[0]->iLocationId = locationId; + TRAP( error, CreateRelationL( iMediaItems[0]->iObjectId, locationId )); + } + + TLocationSnapshotItem* item = iMediaItems[0]; + if((iMediaItems[0]->iFlag & KSnapMediaFile) > 0) + { + iLastMediaItem = *(iMediaItems[0]); + } + iMediaItems.Remove(0); + iMediaItems.Compress(); + iMediaHandlingFlag &= ~KLocationQueryInProgress; + if ( error == KErrNone ) + { + //Find the address by coordinate, results a call to ReverseGeocodeComplete() +#ifdef LOC_REVERSEGEOCODE + iLocationItems.Append( item ); + if(!(iMediaHandlingFlag & KReverseGeoCodingInProgress)) + { + iMediaHandlingFlag |= KReverseGeoCodingInProgress; + + if(iRevGeocoderPlugin) + { + iRevGeocoderPlugin->GetAddressByCoordinateL + ( iLocationItems[0]->iLocationData.iPosition, + iConnectionOption); + } + } +#else + // free resources + delete item; +#endif //LOC_REVERSEGEOCODE + } + else + { + // free resources + delete item; + } + + if ( iMediaItems.Count() > 0 ) + { + FindLocationFromDBL(); + } + } + LOG( "CLocationRecord::HandleLocationQueryL(), end" ); + } +// -------------------------------------------------------------------------- +// CLocationRecord::HandleNetLocationQuery() +// handle if only network info available +// -------------------------------------------------------------------------- +// +void CLocationRecord::HandleNetLocationQueryL( CMdEQuery& aQuery ) + { + LOG( "CLocationRecord::HandleNetLocationQueryL(), begin" ); + TInt error = KErrNone; + TUint locationId( 0 ); + if ( iMediaItems.Count() <= 0 ) + { + LOG("CLocationRecord::HandleNetLocationQueryL(), End. No media items to process\n"); + return; + } + if( aQuery.Count() ) + { + CMdEItem& item = aQuery.ResultItem(0); + CMdEObject& locationObject = static_cast(item); + locationId = locationObject.Id(); + + TRAP( error, CreateRelationL( iMediaItems[0]->iObjectId, locationId ) ); +#ifdef LOC_REVERSEGEOCODE + //check if found location object has lat, long + CMdEProperty* latProp = NULL; + CMdEProperty* lonProp = NULL; + CMdEProperty* cellIdProp = NULL; + CMdEProperty* areadCodeProp = NULL; + CMdEProperty* countryProp = NULL; + CMdEProperty* networkCodeProp = NULL; + if ( error == KErrNone ) + { + + CMdEPropertyDef& cellIdDef = iLocationObjectDef->GetPropertyDefL( + Location::KCellIdProperty ); + CMdEPropertyDef& locationAreadCodeDef = iLocationObjectDef->GetPropertyDefL( + Location::KLocationAreaCodeProperty ); + CMdEPropertyDef& countryCodeDef = iLocationObjectDef->GetPropertyDefL( + Location::KCountryCodeProperty ); + CMdEPropertyDef& networkCodeDef = iLocationObjectDef->GetPropertyDefL( + Location::KNetworkCodeProperty ); + + locationObject.Property( *iLatitudeDef, latProp, 0 ); + locationObject.Property( *iLongitudeDef, lonProp, 0 ); + + locationObject.Property( cellIdDef, cellIdProp, 0 ); + locationObject.Property( locationAreadCodeDef, areadCodeProp, 0 ); + locationObject.Property( countryCodeDef, countryProp, 0 ); + locationObject.Property( networkCodeDef, networkCodeProp, 0 ); + } + + if( (latProp && lonProp) + || (cellIdProp && areadCodeProp && countryProp && networkCodeProp) ) + { + //find out if image for this location is tagged already + GetRelatedImageL( locationId ); + } + else +#endif //LOC_REVERSEGEOCODE + { + // no geo info.. remove the item and proceed for the next. + TLocationSnapshotItem* firstPtr = iMediaItems[0]; + iMediaItems.Remove(0); + delete firstPtr; + iMediaItems.Compress(); + iMediaHandlingFlag &= ~KLocationQueryInProgress; + if ( iMediaItems.Count() > 0 ) + { + FindLocationFromDBL(); + } + } + } + else + { +#ifdef LOC_GEOTAGGING_CELLID + LOG1("Media handling flag = %d", iMediaHandlingFlag); + if((iMediaHandlingFlag & KSnapGeoConvertInProgress) > 0) + { + iMediaHandlingFlag |= KSnapGeoConvertInPendingState; + } + else + { + // go for cell id based geo coding. + if(iGeoConverter == NULL) + { + iGeoConverter = CGeoConverter::NewL(*this); + } + iGeoConverter->ConvertL(iMediaItems[0]->iLocationData.iNetworkInfo); + iMediaHandlingFlag |= KSnapGeoConvertInProgress; + iMediaHandlingFlag &= ~KSnapGeoConvertInPendingState; + } +#else + locationId = DoCreateLocationL( iMediaItems[0]->iLocationData ); + iMediaItems[0]->iLocationId = locationId; + CreateRelationL( iMediaItems[0]->iObjectId, locationId ); + TLocationSnapshotItem* firstPtr = iMediaItems[0]; + iMediaItems.Remove(0); + delete firstPtr; + iMediaItems.Compress(); + iMediaHandlingFlag &= ~KLocationQueryInProgress; + if ( iMediaItems.Count() > 0 ) + { + FindLocationFromDBL(); + } +#endif + } +#ifdef LOC_REVERSEGEOCODE + if((iMediaHandlingFlag & KSnapGeoConvertInProgress) > 0 || + (iMediaHandlingFlag & KReverseGeoCodingInProgress) > 0) +#else + if((iMediaHandlingFlag & KSnapGeoConvertInProgress) > 0) +#endif //LOC_REVERSEGEOCODE + { + // stop n/w info change listener, since device may connect to n/w + // and local trail will receive so many call backs on current n/w info change. + iNetworkInfoChangeListener->StopNwInfoChangeNotifier(); + } + else + { + iNetworkInfoChangeListener->StartNwInfoChangeNotifier(); + } + LOG( "CLocationRecord::HandleNetLocationQueryL(), end" ); + + } + + +#ifdef LOC_GEOTAGGING_CELLID +// -------------------------------------------------------------------------- +// CLocationRecord::ConversionCompletedL() +// -------------------------------------------------------------------------- +// +void CLocationRecord::ConversionCompletedL( const TInt aError, TLocality& aPosition ) + { + + LOG1("CLocationRecord::ConversionCompletedL, begin. Error - %d", aError); + // reset the flag first + iMediaHandlingFlag &= ~KSnapGeoConvertInProgress; + LOG1("iRemapState - %d", iRemapState); + if(aError == KErrNone) + { + iConvertRetry = ETrue; + LOG("Conversion completed successfully"); + if(iRemapState == ERemapNwGeoConverterInProgress) + { + iNewItem.iLocationData.iPosition.SetCoordinate + ( aPosition.Latitude(), aPosition.Longitude(), aPosition.Altitude()); + iNewItem.iLocationData.iQuality = aPosition.HorizontalAccuracy(); + TItemId locationId = DoCreateLocationL( iNewItem.iLocationData ); + iRemapper->UpdateRelationsL( locationId ); + // TODO: remap. +#ifdef LOC_REVERSEGEOCODE + if(!(iMediaHandlingFlag & KReverseGeoCodingInProgress)) + { + iRemapState = ERemapRevGeoCodeInProgress; + //Find the address by coordinate, results a call to ReverseGeocodeComplete() + iMediaHandlingFlag |= KReverseGeoCodingInProgress; + + if(iRevGeocoderPlugin) + { + iRevGeocoderPlugin->GetAddressByCoordinateL + ( iNewItem.iLocationData.iPosition, iConnectionOption ); + } + } + else + { + // remap in reverse geocoding pending state. + iRemapState = ERemapRevGeoCodePending; + } +#endif //LOC_REVERSEGEOCODE + } + else if ( iMediaItems.Count() > 0 ) + { + + iMediaItems[0]->iLocationData.iPosition.SetCoordinate + ( aPosition.Latitude(), aPosition.Longitude(), aPosition.Altitude()); + iMediaItems[0]->iLocationData.iQuality = aPosition.HorizontalAccuracy(); + TLocationSnapshotItem* item = iMediaItems[0]; + TItemId locationId = DoCreateLocationL( iMediaItems[0]->iLocationData ); + iMediaItems[0]->iLocationId = locationId; + CreateRelationL( iMediaItems[0]->iObjectId, locationId ); + if((iMediaItems[0]->iFlag & KSnapMediaFile) > 0) + { + iLastMediaItem = *(iMediaItems[0]); + } + iMediaItems.Remove(0); + iMediaItems.Compress(); + iMediaHandlingFlag &= ~KLocationQueryInProgress; +#ifdef LOC_REVERSEGEOCODE + iLocationItems.Append( item ); +#else + // free resource + delete item; +#endif + } + } + else + { + LOG1("Conversion error - %d", aError); + if(iConvertRetry) + { + LOG("Retry once"); + iConvertRetry = EFalse; + if(iRemapState == ERemapNwGeoConverterInProgress) + { + iRemapState = ERemapNwGeoConverterPending; + } + else if ( iMediaItems.Count() > 0 ) + { + iMediaHandlingFlag |= KSnapGeoConvertInPendingState; + } + } + else + { + if(iRemapState == ERemapNwGeoConverterInProgress) + { + iRemapState = ERemapProgressNone; + } + else if ( iMediaItems.Count() > 0 ) + { + TLocationSnapshotItem* item = iMediaItems[0]; + iMediaItems.Remove(0); + iMediaItems.Compress(); + iMediaHandlingFlag &= ~KLocationQueryInProgress; + delete item; + } + } + + } + + // check the remap item first. + if(iRemapState == ERemapNwGeoConverterPending) + { + // go for cell id based geo coding. + iRemapState = ERemapNwGeoConverterInProgress; + iGeoConverter->ConvertL(iNewItem.iLocationData.iNetworkInfo); + iMediaHandlingFlag |= KSnapGeoConvertInProgress; + } + //check for media queue pending request. + else if((iMediaHandlingFlag & KSnapGeoConvertInPendingState) > 0) + { + // previous media queue geo convert is in pending state. + // go for cell id based geo coding. + iGeoConverter->ConvertL(iMediaItems[0]->iLocationData.iNetworkInfo); + iMediaHandlingFlag |= KSnapGeoConvertInProgress; + iMediaHandlingFlag &= ~KSnapGeoConvertInPendingState; + } + // let's not use multiple access point. +#ifdef LOC_REVERSEGEOCODE + else if(!(iMediaHandlingFlag & KReverseGeoCodingInProgress) && + iLocationItems.Count() > 0) + { + iMediaHandlingFlag |= KReverseGeoCodingInProgress; + + if(iRevGeocoderPlugin) + { + iRevGeocoderPlugin->GetAddressByCoordinateL + ( iLocationItems[0]->iLocationData.iPosition, + iConnectionOption); + } + } + if((iMediaHandlingFlag & KSnapGeoConvertInProgress) > 0 || + (iMediaHandlingFlag & KReverseGeoCodingInProgress) > 0) +#else + if((iMediaHandlingFlag & KSnapGeoConvertInProgress) > 0) +#endif //LOC_REVERSEGEOCODE + { + // stop n/w info change listener, since device may connect to n/w + // and local trail will receive so many call backs on current n/w info change. + iNetworkInfoChangeListener->StopNwInfoChangeNotifier(); + } + else + { + iNetworkInfoChangeListener->StartNwInfoChangeNotifier(); + } + FindLocationFromDBL(); + GeoTaggingCompleted(); + LOG("CLocationRecord::ConversionCompletedL, end"); + } + + +//------------------------------------------------------------------------ +// CLocationRecord::HandleConversionError +//------------------------------------------------------------------------ +// +void CLocationRecord::HandleConversionError(TInt aError) + { + LOG( "CLocationRecord::HandleConversionError(), begin" ); + ARG_USED(aError); + if(iRemapState == ERemapNwGeoConverterInProgress) + { + iRemapState = ERemapProgressNone; + } + else if ( iMediaItems.Count() > 0 ) + { + TLocationSnapshotItem* item = iMediaItems[0]; + iMediaItems.Remove(0); + iMediaItems.Compress(); + iMediaHandlingFlag &= ~KLocationQueryInProgress; + delete item; + } + // let's not use multiple access point. +#ifdef LOC_REVERSEGEOCODE + if(!(iMediaHandlingFlag & KReverseGeoCodingInProgress) && + iLocationItems.Count() > 0) + { + iMediaHandlingFlag |= KReverseGeoCodingInProgress; + + if(iRevGeocoderPlugin) + { + TRAP_IGNORE(iRevGeocoderPlugin->GetAddressByCoordinateL + ( iLocationItems[0]->iLocationData.iPosition, + iConnectionOption)); + } + } + if((iMediaHandlingFlag & KSnapGeoConvertInProgress) > 0 || + (iMediaHandlingFlag & KReverseGeoCodingInProgress) > 0) +#else + if((iMediaHandlingFlag & KSnapGeoConvertInProgress) > 0) +#endif //LOC_REVERSEGEOCODE + { + // stop n/w info change listener, since device may connect to n/w + // and local trail will receive so many call backs on current n/w info change. + iNetworkInfoChangeListener->StopNwInfoChangeNotifier(); + } + else + { + iNetworkInfoChangeListener->StartNwInfoChangeNotifier(); + } + TRAP_IGNORE(FindLocationFromDBL()); + GeoTaggingCompleted(); + LOG( "CLocationRecord::HandleConversionError(), end" ); + } + +#endif // LOC_GEOTAGGING_CELLID + +// -------------------------------------------------------------------------- +// CLocationRecord::SetMdeSession +// -------------------------------------------------------------------------- +// EXPORT_C void CLocationRecord::SetMdeSession( CMdESession* aSession ) { + LOG( "CLocationRecord::SetMdeSession(), begin" ); iMdeSession = aSession; +#ifdef LOC_REVERSEGEOCODE + iTagCreator->SetSession( aSession ); +#endif TRAPD(err, iRemapper->InitialiseL( aSession )); if( err != KErrNone ) { delete iRemapper; iRemapper = NULL; } + TRAP(err, InitialiseL() ); + LOG( "CLocationRecord::SetMdeSession(), end" ); } +// -------------------------------------------------------------------------- +// CLocationRecord::InitialiseL +// -------------------------------------------------------------------------- +// +void CLocationRecord::InitialiseL() + { + LOG( "CLocationRecord::InitialiseL(), begin" ); + // namespace defaults + iNamespaceDef = &iMdeSession->GetDefaultNamespaceDefL(); + + // location object definitions + iLocationObjectDef = &iNamespaceDef->GetObjectDefL( Location::KLocationObject ); + iLatitudeDef = &iLocationObjectDef->GetPropertyDefL( Location::KLatitudeProperty ); + iLongitudeDef = &iLocationObjectDef->GetPropertyDefL( Location::KLongitudeProperty ); + iAltitudeDef = &iLocationObjectDef->GetPropertyDefL( Location::KAltitudeProperty ); + LOG( "CLocationRecord::InitialiseL(), end" ); + } + + +// -------------------------------------------------------------------------- +// CLocationRecord::StartTimerL +// -------------------------------------------------------------------------- +// void CLocationRecord::StartTimerL() { - LOG("CLocationRecord::StartTimerL"); + LOG("CLocationRecord::StartTimerL,begin"); if( !iNetworkInfoTimer->IsActive() ) { iNetworkInfoTimer->Start( iInterval, iInterval, TCallBack( UpdateNetworkInfo, this ) ); } + LOG( "CLocationRecord::StartL(), end" ); } + +// -------------------------------------------------------------------------- +// CLocationRecord::GetMdeObjectTimeL +// -------------------------------------------------------------------------- +// TTime CLocationRecord::GetMdeObjectTimeL( TItemId aObjectId ) { + LOG( "CLocationRecord::GetMdeObjectTimeL(), begin" ); CMdENamespaceDef& namespaceDef = iMdeSession->GetDefaultNamespaceDefL(); CMdEObjectDef& objectDef = namespaceDef.GetObjectDefL( Object::KBaseObject ); @@ -1114,11 +2151,79 @@ return timeValue; } + + +// -------------------------------------------------------------------------- +// CLocationRecord::RemappingNeeded +// -------------------------------------------------------------------------- +// EXPORT_C TBool CLocationRecord::RemappingNeeded() { - return iRemapper->ItemsInQueue(); + return ( iRemapper->ItemsInQueue() + && (iRemapState == ERemapProgressNone)); } + + + +// -------------------------------------------------------------------------- +// CLocationRecord::FindLocationWithSameNetInfoL() +// check any location object already exists with same network info +// -------------------------------------------------------------------------- +// +void CLocationRecord::FindLocationWithSameNetInfoL() + { + LOG( "CLocationRecord::FindLocationWithSameNetInfoL(), begin" ); + if(iMediaItems[0]->iLocationData.iNetworkInfo.iCellId > 0 && + iMediaItems[0]->iLocationData.iNetworkInfo.iCountryCode.Length() > 0 && + iMediaItems[0]->iLocationData.iNetworkInfo.iNetworkId.Length() > 0) + { + CMdEPropertyDef& cellIdDef = iLocationObjectDef->GetPropertyDefL( + Location::KCellIdProperty ); + CMdEPropertyDef& locationCodeDef = iLocationObjectDef->GetPropertyDefL( + Location::KLocationAreaCodeProperty ); + CMdEPropertyDef& countryCodeDef = iLocationObjectDef->GetPropertyDefL( + Location::KCountryCodeProperty ); + CMdEPropertyDef& networkCodeDef = iLocationObjectDef->GetPropertyDefL( + Location::KNetworkCodeProperty ); + + if(iNetLocationQuery) + { + iNetLocationQuery->RemoveObserver(*this); + iNetLocationQuery->Cancel(); + delete iNetLocationQuery; + iNetLocationQuery = NULL; + } + iNetLocationQuery = iMdeSession->NewObjectQueryL( *iNamespaceDef, *iLocationObjectDef, this ); + CMdELogicCondition& cond = iNetLocationQuery->Conditions(); + cond.SetOperator( ELogicConditionOperatorAnd ); + + cond.AddPropertyConditionL( cellIdDef, + TMdEUintEqual( iMediaItems[0]->iLocationData.iNetworkInfo.iCellId) ); + cond.AddPropertyConditionL( locationCodeDef, + TMdEUintEqual( iMediaItems[0]->iLocationData.iNetworkInfo.iLocationAreaCode) ); + cond.AddPropertyConditionL( countryCodeDef, ETextPropertyConditionCompareEquals, + iMediaItems[0]->iLocationData.iNetworkInfo.iCountryCode ); + cond.AddPropertyConditionL( networkCodeDef, ETextPropertyConditionCompareEquals, + iMediaItems[0]->iLocationData.iNetworkInfo.iNetworkId ); + + iNetLocationQuery->FindL(1, 1); + iMediaHandlingFlag |= KLocationQueryInProgress; + // iMediaHandlingFlag |= KNetQueryInProgress; + } + else + { + TLocationSnapshotItem* firstPtr = iMediaItems[0]; + iMediaItems.Remove(0); + delete firstPtr; + iMediaItems.Compress(); + iMediaHandlingFlag &= ~KLocationQueryInProgress; + FindLocationFromDBL(); + } + LOG( "CLocationRecord::FindLocationWithSameNetInfoL(), end" ); + + } + EXPORT_C TBool CLocationRecord::IsLowBattery() { LOG("CLocationRecord::IsLowBattery()"); @@ -1135,7 +2240,526 @@ { return ETrue; } + } + +// -------------------------------------------------------------------------- +// CLocationRecord::GeoTaggingCompleted +// -------------------------------------------------------------------------- +// +void CLocationRecord::GeoTaggingCompleted() + { + LOG( "CLocationRecord::GeoTaggingCompleted(), begin" ); + if((iMediaItems.Count() == 0) +#ifdef LOC_REVERSEGEOCODE + && (iLocationItems.Count() == 0) +#endif //LOC_REVERSEGEOCODE + ) + { + LOG("Geo tagging completed"); + iGeoTaggerObserver.GeoTaggingCompleted(KErrNone); + // fallback to silent +#ifdef LOC_REVERSEGEOCODE + iConnectionOption = ESilent; +#endif //LOC_REVERSEGEOCODE + } + LOG( "CLocationRecord::GeoTaggingCompleted(), end" ); + } + + + + +// -------------------------------------------------------------------------- +// CLocationRecord::TaggingInProgress +// -------------------------------------------------------------------------- +// +EXPORT_C TBool CLocationRecord::TaggingInProgress() + { + LOG( "CLocationRecord::TaggingInProgress(), begin" ); + TBool retVal = EFalse; +#ifdef LOC_REVERSEGEOCODE + if( ((iMediaItems.Count() > 0) || (iLocationItems.Count() > 0) ) + && (iRevGeocoderPlugin && iRevGeocoderPlugin->SilentConnectionAllowed())) +#else + if( iMediaItems.Count() > 0 ) + +#endif //LOC_REVERSEGEOCODE + { +#ifdef LOC_REVERSEGEOCODE + if(!(iMediaHandlingFlag & KReverseGeoCodingInProgress)) + { + // start geocoding + + if (iLocationItems.Count() > 0 ) + { + iMediaHandlingFlag |= KReverseGeoCodingInProgress; + + TRAP_IGNORE( iRevGeocoderPlugin->GetAddressByCoordinateL( + iLocationItems[0]->iLocationData.iPosition, + iConnectionOption) ); + + retVal = ETrue; + } + } + else + { + retVal = ETrue; + } +#endif //LOC_REVERSEGEOCODE + if(!(iMediaHandlingFlag & KLocationQueryInProgress)) + { + if(iMediaItems.Count() > 0) + { + HandleFindLocationFromDB(); + retVal = ETrue; + } + } + else + { + retVal = ETrue; + } + } + else + { + // Flash the array to avoid double tagging by photos & localrail. + } + LOG( "CLocationRecord::TaggingInProgress(), end" ); + return retVal; + } + + +// ---------------------------------------------------------------------------- +// CLocationRecord::GetCurrentRegisteredNw() +// ---------------------------------------------------------------------------- +EXPORT_C RMobilePhone::TMobilePhoneNetworkInfoV2& CLocationRecord::GetCurrentRegisteredNw() + { + LOG( "CLocationRecord::GetCurrentRegisteredNw ,begin" ); + return iNetworkInfoChangeListener->GetCurrentRegisterNw(); + } + +// -------------------------------------------------------------------------- +// CLocationRecord::StartGeoTagging +// -------------------------------------------------------------------------- +// +EXPORT_C TBool CLocationRecord::StartGeoTagging(const TConnectionOption aConnectionOption) + { + LOG( "CLocationRecord::StartGeoTagging(), begin" ); + TBool retVal = EFalse; + ARG_USED(aConnectionOption); + if((iMediaItems.Count() > 0) +#ifdef LOC_REVERSEGEOCODE + || (iLocationItems.Count() > 0) +#endif //LOC_REVERSEGEOCODE + ) + { +#ifdef LOC_REVERSEGEOCODE + iConnectionOption = aConnectionOption; + if(!(iMediaHandlingFlag & KReverseGeoCodingInProgress)) + { + // start geocoding + if (iLocationItems.Count() > 0 ) + { + iMediaHandlingFlag |= KReverseGeoCodingInProgress; + if(iRevGeocoderPlugin) + { + TRAP_IGNORE( iRevGeocoderPlugin->GetAddressByCoordinateL( + iLocationItems[0]->iLocationData.iPosition, + iConnectionOption) ); + } + retVal = ETrue; + } + } + else + { + retVal = ETrue; + } +#endif //LOC_REVERSEGEOCODE + if(!(iMediaHandlingFlag & KLocationQueryInProgress)) + { + if(iMediaItems.Count() > 0) + { + HandleFindLocationFromDB(); + retVal = ETrue; + } + } + else + { + retVal = ETrue; + } + } + LOG( "CLocationRecord::StartGeoTagging(), end" ); + return retVal; + } + + +// -------------------------------------------------------------------------- +// CLocationRecord::CancelGeoTagging +// -------------------------------------------------------------------------- +// +EXPORT_C void CLocationRecord::CancelGeoTagging() + { +#ifdef LOC_REVERSEGEOCODE + LOG1( "CLocationRecord::CancelGeoTagging(), Connetion opt - %d", + iConnectionOption ); + // set this to default connection. + iConnectionOption = ESilent; +#endif //LOC_REVERSEGEOCODE + } + + +#ifdef LOC_REVERSEGEOCODE + +// -------------------------------------------------------------------------- +// CLocationManagerServer::GetRelatedImages() +// Find any image, already related to this location object +// -------------------------------------------------------------------------- +// +void CLocationRecord::GetRelatedImageL(TItemId aLocID) + { + LOG( "CLocationRecord::GetRelatedImageL(), begin" ); + CMdEObjectDef& imageObjDef = iNamespaceDef->GetObjectDefL( Image::KImageObject ); + if(iImageQuery) + { + iImageQuery->RemoveObserver(*this); + iImageQuery->Cancel(); + delete iImageQuery; + iImageQuery = NULL; + } + + iImageQuery = iMdeSession->NewRelationQueryL( *iNamespaceDef, this ); + User::LeaveIfNull( iImageQuery ); + + iImageQuery->SetResultMode( EQueryResultModeItem ); + + // both left and right condition must match + CMdERelationCondition& filterCond = iImageQuery->Conditions(). + AddRelationConditionL( ERelationConditionSideRight ); + + // left one must be any image object. + filterCond.LeftL().AddObjectConditionL( imageObjDef ); + + // right one must be this location object + filterCond.RightL().AddObjectConditionL( aLocID ); + + iImageQuery->FindL(1, 1); // results to a call to HandleQueryCompleted() + LOG( "CLocationRecord::GetRelatedImageL(), end" ); } + + +// -------------------------------------------------------------------------- +// CLocationRecord::ReverseGeocodeComplete() +// Get address details like country, city.. +// Create country and city tags and attach to the current image/video object +// -------------------------------------------------------------------------- +// +void CLocationRecord::ReverseGeocodeComplete( TInt& aErrorcode, MAddressInfo& aAddressInfo ) + { + LOG( "CLocationRecord::ReverseGeocodeComplete(), begin" ); + TItemId countryTagId(0); + TItemId cityTagId(0); + + iMediaHandlingFlag &= (~KReverseGeoCodingInProgress); + TLocationSnapshotItem* snapshotItem = NULL; + if( aErrorcode == KErrNone ) + { + TPtrC countryPtr( aAddressInfo.GetCountryName() ); + TPtrC cityPtr( aAddressInfo.GetCity() ); + TRAP_IGNORE( iTagCreator->CreateLocationTagsL( countryPtr, countryTagId, + cityPtr, cityTagId ) ); + if ( iRemapState == ERemapRevGeoCodeInProgress) + { + TRAP_IGNORE( iRemapper->AttachGeoTagsL( iTagCreator, countryTagId, cityTagId ) ); + iRemapState = ERemapProgressNone; + } + else + { + if(iLocationItems.Count() > 0) + { + iLocationItems[0]->iCountryTagId = countryTagId; + iLocationItems[0]->iCityTagId = cityTagId; + iLastLocationItem = (*iLocationItems[0]); + + TRAP_IGNORE( iTagCreator->AttachTagsL( + iLocationItems[0]->iObjectId, countryTagId, cityTagId ) ); + } + } + if(iLastMediaItem.iFlag == 0) + { + LOG("Last media item is null\n"); + } + if ( iLastMediaItem.iFlag > 0 && iLastMediaItem.iLocationId == iLastLocationItem.iLocationId ) + { + LOG("Updating country/city\n"); + iLastMediaItem.iCountryTagId = countryTagId; + iLastMediaItem.iCityTagId = cityTagId; + } + + //check other items in the array has same location + for ( TInt index = iLocationItems.Count() - 1; index > 0; index--) + { + if ( iLocationItems[index]->iLocationId == iLastLocationItem.iLocationId ) + { + LOG1("Attached tags in for - %d\n", index); + TRAP_IGNORE( iTagCreator->AttachTagsL( + iLocationItems[index]->iObjectId, countryTagId, cityTagId ) ); + snapshotItem = iLocationItems[index]; + iLocationItems.Remove(index); + delete snapshotItem; + } + } + } + else + { + //handle error + } + + //irrespective of error or not, remove current(first) item to proceed further + if ( iLocationItems.Count() > 0 ) + { + snapshotItem = iLocationItems[0]; + iLocationItems.Remove(0); + delete snapshotItem; + iLocationItems.Compress(); + } + if (aErrorcode == KErrNone) + { + if(iRemapState == ERemapRevGeoCodePending) + { + if(iRevGeocoderPlugin) + { + TRAPD(err, iRevGeocoderPlugin->GetAddressByCoordinateL( iNewItem.iLocationData.iPosition, iConnectionOption );) + if(err == KErrNone) + { + // Remap geo coding in pending state + iRemapState = ERemapRevGeoCodeInProgress; + //Find the address by coordinate, results a call to ReverseGeocodeComplete() + iMediaHandlingFlag |= KReverseGeoCodingInProgress; + } + } + } + else if(iLocationItems.Count() > 0) + { + if(iRevGeocoderPlugin) + { + TRAPD(err, iRevGeocoderPlugin->GetAddressByCoordinateL( + iLocationItems[0]->iLocationData.iPosition, + iConnectionOption) ); + if(err == KErrNone) + { + // queue is not empty process the next. + iMediaHandlingFlag |= KReverseGeoCodingInProgress; + } + } + } + } + + GeoTaggingCompleted(); + if((iMediaHandlingFlag & KSnapGeoConvertInProgress) > 0 || + (iMediaHandlingFlag & KReverseGeoCodingInProgress) > 0) + { + // stop n/w info change listener, since device may connect to n/w + // and local trail will receive so many call backs on current n/w info change. + iNetworkInfoChangeListener->StopNwInfoChangeNotifier(); + } + else + { + iNetworkInfoChangeListener->StartNwInfoChangeNotifier(); + } + LOG( "CLocationRecord::ReverseGeocodeComplete(), end" ); + } + + +// ---------------------------------------------------------------------------- +// CLocationRecord::IsRegisteredAtHomeNetwork() +// ---------------------------------------------------------------------------- +TBool CLocationRecord::IsRegisteredAtHomeNetwork() + { + LOG( "CLocationRecord::IsRegisteredAtHomeNetwork" ); + return iGeoTaggerObserver.IsRegisteredAtHomeNetwork(); + } + +// ---------------------------------------------------------------------------- +// CLocationRecord::GetHomeNetworkInfo() +// ---------------------------------------------------------------------------- +const RMobilePhone::TMobilePhoneNetworkInfoV1& + CLocationRecord::GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) + { + LOG( "CLocationRecord::GetHomeNetworkInfo" ); + return iGeoTaggerObserver.GetHomeNetworkInfo(aHomeNwInfoAvailableFlag); + } + +// ---------------------------------------------------------------------------- +// CLocationRecord::GetCurrentRegisterNw() +// ---------------------------------------------------------------------------- +RMobilePhone::TMobilePhoneNetworkInfoV2& CLocationRecord::GetCurrentRegisterNw() + { + LOG( "CLocationRecord::GetCurrentRegisterNw ,begin" ); + return GetCurrentRegisteredNw(); + } + + +// -------------------------------------------------------------------------- +// CLocationRecord::HandleTagQuery() +// handle if only gps info available +// -------------------------------------------------------------------------- +// +void CLocationRecord::HandleTagQueryL( CMdEQuery& aQuery ) + { + LOG( "CLocationRecord::HandleTagQueryL(), begin" ); + TItemId countryTagId = 0; + TItemId cityTagId = 0; + TRAPD( error, FindCountryAndCityTagL( aQuery, countryTagId, cityTagId ) ); + if ( error == KErrNone ) + { + LOG1("Media count - %d\n", iMediaItems.Count()); + if ( !countryTagId && !cityTagId ) + { + if ( iMediaItems.Count() > 0 ) + { + iLocationItems.Append( iMediaItems[0] ); + if((iMediaItems[0]->iFlag & KSnapMediaFile) > 0) + { + iLastMediaItem = *(iMediaItems[0]); + } + iMediaItems.Remove(0); + iMediaItems.Compress(); + iMediaHandlingFlag &= ~KLocationQueryInProgress; + } + +#ifdef LOC_REVERSEGEOCODE + if(!(iMediaHandlingFlag & KReverseGeoCodingInProgress) && + iLocationItems.Count() > 0) + { + iMediaHandlingFlag |= KReverseGeoCodingInProgress; + if(iRevGeocoderPlugin) + { + iRevGeocoderPlugin->GetAddressByCoordinateL + ( iLocationItems[0]->iLocationData.iPosition, + iConnectionOption); + } + } +#endif //LOC_REVERSEGEOCODE + } + else + { + + iTagCreator->AttachTagsL( iMediaItems[0]->iObjectId, countryTagId, cityTagId ); + if ( iMediaItems.Count() > 0 ) + { + iMediaItems[0]->iCountryTagId = countryTagId; + iMediaItems[0]->iCityTagId = cityTagId; + TLocationSnapshotItem* item = iMediaItems[0]; + if((iMediaItems[0]->iFlag & KSnapMediaFile) > 0) + { + iLastMediaItem = *item; + } + iMediaItems.Remove(0); + iMediaItems.Compress(); + iMediaHandlingFlag &= ~KLocationQueryInProgress; + delete item; + } + } + + } + if ( iMediaItems.Count() > 0 ) + { + FindLocationFromDBL(); + } + LOG( "CLocationRecord::HandleTagQueryL(), end" ); + } + + +// -------------------------------------------------------------------------- +// CLocationRecord::FindCountryAndCityTagL() +// Go through all attached tags to get location tags only +// -------------------------------------------------------------------------- +// +void CLocationRecord::FindCountryAndCityTagL( CMdEQuery& aQuery, + TItemId& aCountryTagId, TItemId& aCityTagId ) + { + LOG( "CLocationRecord::FindCountryAndCityTagL(), begin" ); + TItemId tagId = 0; + CMdEObject* object = NULL; + TInt error = KErrNone; + + const TInt count = aQuery.Count(); + + for ( TInt i = 0; i < count; i++ ) + { + CMdERelation& relation = static_cast( aQuery.ResultItem( i ) ); + + tagId = relation.RightObjectId(); + TRAP_IGNORE( object = iMdeSession->GetObjectL( tagId ) ); + + if ( !aCountryTagId ) + { + error = object->Uri().Find( KCountry ); + //just make sure 'country' appears first in the tag uri + if ( error == KErrNone ) + { + aCountryTagId = tagId; + continue; + } + } + + if ( !aCityTagId ) + { + error = object->Uri().Find( KCity ); + if ( error == KErrNone ) + { + aCityTagId = tagId; + } + } + + if ( aCountryTagId && aCityTagId ) + { + i = count; + } + } + LOG( "CLocationRecord::FindCountryAndCityTagL(), end" ); + + } + +// -------------------------------------------------------------------------- +// CLocationRecord::GetTagsL() +// -------------------------------------------------------------------------- +// +void CLocationRecord::GetTagsL( TItemId aImageID ) + { + LOG( "CLocationRecord::GetTagsL(), begin" ); + CMdEObjectDef& tagObjectDef = iNamespaceDef->GetObjectDefL( Tag::KTagObject ); + + if(iTagQuery) + { + iTagQuery->RemoveObserver(*this); + iTagQuery->Cancel(); + delete iTagQuery; + iTagQuery = NULL; + } + + iTagQuery = iMdeSession->NewRelationQueryL( *iNamespaceDef, this ); + User::LeaveIfNull( iTagQuery ); + + iTagQuery->SetResultMode( EQueryResultModeItem ); + + // both left and right condition must match + CMdERelationCondition& filterCond = iTagQuery->Conditions(). + AddRelationConditionL( ERelationConditionSideRight ); + + // left one must be this image object. + filterCond.LeftL().AddObjectConditionL( aImageID ); + + // right one must be tag object + filterCond.RightL().AddObjectConditionL( tagObjectDef ); + + iTagQuery->FindL(); // results to a call to HandleQueryCompleted() + LOG( "CLocationRecord::GetTagsL(), end" ); + } + + +#endif //LOC_REVERSEGEOCODE + // End of file + + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/src/cnetworkinfo.cpp --- a/locationmanager/locationtrail/src/cnetworkinfo.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/src/cnetworkinfo.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -20,6 +20,9 @@ #include "cnetworkinfo.h" #include "locationmanagerdebug.h" + + + // -------------------------------------------------------------------------- // CNetworkInfo::NewL // -------------------------------------------------------------------------- @@ -31,7 +34,6 @@ CleanupStack::PushL( self ); self->ConstructL(); CleanupStack::Pop( self ); - LOG( "CNetworkInfo::NewL(), end" ); return self; } @@ -41,12 +43,13 @@ // CNetworkInfo::CNetworkInfo( MNetworkInfoObserver* aTrail ) : CActive( CActive::EPriorityStandard ), - iFirstTime( EFalse ), - iTelephony( NULL ), - iNetworkInfoV1Pckg( iNetworkInfoV1 ) + iTrail ( aTrail ), + iMobilePhone(aTrail->GetMobilePhone4NwInfo()), + iState( ENetworkInfoNoOptState ), + + iMMNetworkInfoPckg( iMMNetworkInfo ) { CActiveScheduler::Add( this ); - iTrail = aTrail; } // -------------------------------------------------------------------------- @@ -56,17 +59,7 @@ void CNetworkInfo::ConstructL() { LOG( "CNetworkInfo::ConstructL(), begin" ); - iFirstTime = ETrue; - iTelephony = CTelephony::NewL(); - iTelephony->GetCurrentNetworkInfo(iStatus, iNetworkInfoV1Pckg); - LOG( "CNetworkInfo::ConstructL(), iTelephony->GetCurrentNetworkInfo called" ); - - if ( IsActive() ) - { - Cancel(); - } - SetActive(); - + StartNwInfoChangeNotifier(); LOG( "CNetworkInfo::ConstructL(), end" ); } @@ -76,8 +69,8 @@ // EXPORT_C CNetworkInfo::~CNetworkInfo() { + // we are not owning RMobilePhone obj.. DON'T CLOSE it. Cancel(); - delete iTelephony; } // -------------------------------------------------------------------------- @@ -90,25 +83,61 @@ } // -------------------------------------------------------------------------- +// CNetworkInfo::StartNwInfoChangeNotifier +// -------------------------------------------------------------------------- +// +EXPORT_C void CNetworkInfo::StartNwInfoChangeNotifier() + { + LOG( "CNetworkInfo::StartNwInfoChangeNotifier(), begin" ); + if ( !IsActive()) + { + // get current n/w info first and from RunL start notifier + iState = ENetworkInfoOptGetState; + + iMobilePhone.GetCurrentNetwork(iStatus, iMMNetworkInfoPckg, iMMArea); + SetActive(); + } + + LOG( "CNetworkInfo::StartNwInfoChangeNotifier(), end" ); + } + +// -------------------------------------------------------------------------- +// CNetworkInfo::StopNwInfoChangeNotifier +// -------------------------------------------------------------------------- +// +EXPORT_C void CNetworkInfo::StopNwInfoChangeNotifier() + { + LOG( "CNetworkInfo::StopNwInfoChangeNotifier(), begin" ); + Cancel(); + iState = ENetworkInfoNoOptState; + LOG( "CNetworkInfo::StopNwInfoChangeNotifier(), end" ); + } + +// -------------------------------------------------------------------------- // CNetworkInfo::RunL // -------------------------------------------------------------------------- // void CNetworkInfo::RunL() { LOG( "CNetworkInfo::RunL(), begin" ); - iFirstTime = EFalse; - iTrail->NetworkInfo( iNetworkInfoV1, iStatus.Int() ); - LOG( "CNetworkInfo::RunL(), iTrail->NetworkInfo called" ); - - iTelephony->NotifyChange(iStatus, CTelephony::ECurrentNetworkInfoChange, iNetworkInfoV1Pckg); - LOG( "CNetworkInfo::RunL(), iTelephony->NotifyChange called" ); - - if ( IsActive() ) + // reset the flag first + iState = ENetworkInfoNoOptState; + if(iStatus == KErrNone) + { + // convert the network info to CTelephony network info. just to give backward compatibility + MapNetworkInfo(&iNetworkInfoV1, &iMMNetworkInfo, &iMMArea); + } + if(iTrail) + { + iTrail->NetworkInfo( iNetworkInfoV1, iStatus.Int() ); + } + // listen to n/w info change + if ( !IsActive() ) { - Cancel(); - } - SetActive(); - + iState = ENetworkInfoOptNotifyState; + iMobilePhone.NotifyCurrentNetworkChange(iStatus,iMMNetworkInfoPckg, iMMArea); + SetActive(); + } LOG( "CNetworkInfo::RunL(), end" ); } @@ -118,21 +147,190 @@ // void CNetworkInfo::DoCancel() { - LOG( "CNetworkInfo::DoCancel(), begin" ); - if ( IsActive() ) - { - if ( iFirstTime ) + LOG1( "CNetworkInfo::DoCancel(), begin. State - %d", iState); + switch ( iState ) + { + case ENetworkInfoOptGetState: { - LOG( "CNetworkInfo::DoCancel(), cancelling CTelephony::EGetCurrentNetworkInfoCancel" ); - iTelephony->CancelAsync( CTelephony::EGetCurrentNetworkInfoCancel ); + LOG( "Cancel get current n/w info change" ); + iMobilePhone.CancelAsyncRequest( EMobilePhoneGetCurrentNetwork); + break; } - else + case ENetworkInfoOptNotifyState: { - LOG( "CNetworkInfo::DoCancel(), cancelling CTelephony::ECurrentNetworkInfoChangeCancel" ); - iTelephony->CancelAsync( CTelephony::ECurrentNetworkInfoChangeCancel ); - } - } + LOG( "Cancel current n/w info change" ); + iMobilePhone.CancelAsyncRequest( EMobilePhoneNotifyCurrentNetworkChange); + break; + } + default: + break; + } + iState = ENetworkInfoNoOptState; LOG( "CNetworkInfo::DoCancel(), end" ); } +// -------------------------------------------------------------------------- +// CNetworkInfo::MapNetworkInfo +// -------------------------------------------------------------------------- +// +EXPORT_C void CNetworkInfo::MapNetworkInfo(CTelephony::TNetworkInfoV1* aTelNetworkInfo, + RMobilePhone::TMobilePhoneNetworkInfoV2* aMMNetworkInfo, + RMobilePhone::TMobilePhoneLocationAreaV1* aMMArea) + { + LOG( "CNetworkInfo::MapNetworkInfo(), begin" ); + switch(aMMNetworkInfo->iMode) + { + case RMobilePhone::ENetworkModeUnknown: + aTelNetworkInfo->iMode=CTelephony::ENetworkModeUnknown; + break; + case RMobilePhone::ENetworkModeUnregistered: + aTelNetworkInfo->iMode=CTelephony::ENetworkModeUnregistered; + break; + case RMobilePhone::ENetworkModeGsm: + aTelNetworkInfo->iMode=CTelephony::ENetworkModeGsm; + break; + case RMobilePhone::ENetworkModeAmps: + aTelNetworkInfo->iMode=CTelephony::ENetworkModeAmps; + break; + case RMobilePhone::ENetworkModeCdma95: + aTelNetworkInfo->iMode=CTelephony::ENetworkModeCdma95; + break; + case RMobilePhone::ENetworkModeCdma2000: + aTelNetworkInfo->iMode=CTelephony::ENetworkModeCdma2000; + break; + case RMobilePhone::ENetworkModeWcdma: + aTelNetworkInfo->iMode=CTelephony::ENetworkModeWcdma; + break; + case RMobilePhone::ENetworkModeTdcdma: + aTelNetworkInfo->iMode=CTelephony::ENetworkModeTdcdma; + break; + default: + aTelNetworkInfo->iMode=CTelephony::ENetworkModeUnknown; + } + + switch(aMMNetworkInfo->iStatus) + { + case RMobilePhone::ENetworkStatusUnknown: + aTelNetworkInfo->iStatus=CTelephony::ENetworkStatusUnknown; + break; + case RMobilePhone::ENetworkStatusAvailable: + aTelNetworkInfo->iStatus=CTelephony::ENetworkStatusAvailable; + break; + case RMobilePhone::ENetworkStatusCurrent: + aTelNetworkInfo->iStatus=CTelephony::ENetworkStatusCurrent; + break; + case RMobilePhone::ENetworkStatusForbidden: + aTelNetworkInfo->iStatus=CTelephony::ENetworkStatusForbidden; + break; + default: + aTelNetworkInfo->iStatus=CTelephony::ENetworkStatusUnknown; + } + + switch(aMMNetworkInfo->iBandInfo) + { + case RMobilePhone::EBandUnknown: + aTelNetworkInfo->iBandInfo=CTelephony::EBandUnknown; + break; + case RMobilePhone::E800BandA: + aTelNetworkInfo->iBandInfo=CTelephony::E800BandA; + break; + case RMobilePhone::E800BandB: + aTelNetworkInfo->iBandInfo=CTelephony::E800BandB; + break; + case RMobilePhone::E800BandC: + aTelNetworkInfo->iBandInfo=CTelephony::E800BandC; + break; + case RMobilePhone::E1900BandA: + aTelNetworkInfo->iBandInfo=CTelephony::E1900BandA; + break; + case RMobilePhone::E1900BandB: + aTelNetworkInfo->iBandInfo=CTelephony::E1900BandB; + break; + case RMobilePhone::E1900BandC: + aTelNetworkInfo->iBandInfo=CTelephony::E1900BandC; + break; + case RMobilePhone::E1900BandD: + aTelNetworkInfo->iBandInfo=CTelephony::E1900BandD; + break; + case RMobilePhone::E1900BandE: + aTelNetworkInfo->iBandInfo=CTelephony::E1900BandE; + break; + case RMobilePhone::E1900BandF: + aTelNetworkInfo->iBandInfo=CTelephony::E1900BandF; + break; + default: + aTelNetworkInfo->iBandInfo=CTelephony::EBandUnknown; + } + + aTelNetworkInfo->iCountryCode.Copy(aMMNetworkInfo->iCountryCode); + aTelNetworkInfo->iNetworkId.Copy(aMMNetworkInfo->iNetworkId); + aTelNetworkInfo->iDisplayTag.Copy(aMMNetworkInfo->iDisplayTag); + + TInt maxLength = aTelNetworkInfo->iShortName.MaxLength(); + if (aMMNetworkInfo->iShortName.Length() > maxLength) + { + aTelNetworkInfo->iShortName.Copy(aMMNetworkInfo->iShortName.Ptr(), maxLength); + } + else + { + aTelNetworkInfo->iShortName.Copy(aMMNetworkInfo->iShortName); + } + + maxLength = aTelNetworkInfo->iLongName.MaxLength(); + + if (aMMNetworkInfo->iLongName.Length() > maxLength) + { + aTelNetworkInfo->iLongName.Copy(aMMNetworkInfo->iLongName.Ptr(), maxLength); + } + else + { + aTelNetworkInfo->iLongName.Copy(aMMNetworkInfo->iLongName); + } + + aTelNetworkInfo->iCdmaSID.Copy(aMMNetworkInfo->iCdmaSID); + + if(aMMArea) + { + aTelNetworkInfo->iAreaKnown=aMMArea->iAreaKnown; + aTelNetworkInfo->iLocationAreaCode=aMMArea->iLocationAreaCode; + aTelNetworkInfo->iCellId=aMMArea->iCellId; + } + else + { + aTelNetworkInfo->iAreaKnown=EFalse; + aTelNetworkInfo->iLocationAreaCode=0; + aTelNetworkInfo->iCellId=0; + } + + //check which paramater class version this is. + switch(aMMNetworkInfo->iAccess) + { + case RMobilePhone::ENetworkAccessUnknown: + aTelNetworkInfo->iAccess=CTelephony::ENetworkAccessUnknown; + break; + case RMobilePhone::ENetworkAccessGsm: + aTelNetworkInfo->iAccess=CTelephony::ENetworkAccessGsm; + break; + case RMobilePhone::ENetworkAccessGsmCompact: + aTelNetworkInfo->iAccess=CTelephony::ENetworkAccessGsmCompact; + break; + case RMobilePhone::ENetworkAccessUtran: + aTelNetworkInfo->iAccess=CTelephony::ENetworkAccessUtran; + break; + default: + aTelNetworkInfo->iAccess=CTelephony::ENetworkAccessUnknown; + } + + LOG( "CNetworkInfo::MapNetworkInfo(), end" ); + } + +// ---------------------------------------------------------------------------- +// CNetworkInfo::GetCurrentRegisterNw() +// ---------------------------------------------------------------------------- +RMobilePhone::TMobilePhoneNetworkInfoV2& CNetworkInfo::GetCurrentRegisterNw() + { + return iMMNetworkInfo; + } + // End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/src/cpositioninfo.cpp --- a/locationmanager/locationtrail/src/cpositioninfo.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/src/cpositioninfo.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -43,7 +43,8 @@ // CPositionInfo::CPositionInfo( MPositionInfoObserver* aTrail ) : CActive( CActive::EPriorityStandard ), - iFirstInterval( ETrue ) + iState( EPositionOptStateNone ), + iConnectedPositionServer(EFalse) { LOG( "CPositionInfo::CPositionInfo()"); CActiveScheduler::Add( this ); @@ -75,9 +76,7 @@ // EXPORT_C CPositionInfo::~CPositionInfo() { - Cancel(); - iPositioner.Close(); - iPosServer.Close(); + Stop(); } // -------------------------------------------------------------------------- @@ -96,34 +95,41 @@ void CPositionInfo::StartL( RLocationTrail::TTrailCaptureSetting aCaptureSetting, TInt aUpdateInterval ) { LOG( "CPositionInfo::StartL(), begin" ); - + if(IsActive()) + { + Cancel(); + } iTrailCaptureSetting = aCaptureSetting; iUpdateInterval = aUpdateInterval; - iFirstInterval = ETrue; - iPositionInfo = TPositionSatelliteInfo(); + iState = EPositionOptStateNone; - // Set update interval. - iUpdateOptions.SetUpdateInterval( TTimeIntervalMicroSeconds(KFirstInterval) ); - // Set time out level. - iUpdateOptions.SetUpdateTimeOut( TTimeIntervalMicroSeconds( KFirstTimeOut) ); - // Positions which have time stamp below KMaxAge can be reused - iUpdateOptions.SetMaxUpdateAge( TTimeIntervalMicroSeconds(KMaxAge) ); - // Disables location framework to send partial position data - iUpdateOptions.SetAcceptPartialUpdates( EFalse ); + iPositionInfo = TPositionSatelliteInfo(); if ( aCaptureSetting == RLocationTrail::ECaptureAll ) { - User::LeaveIfError( iPosServer.Connect() ); - User::LeaveIfError( iPositioner.Open( iPosServer ) ); - User::LeaveIfError( iPositioner.SetRequestor( CRequestor::ERequestorService, - CRequestor::EFormatApplication, KRequestor ) ); - User::LeaveIfError( iPositioner.SetUpdateOptions( iUpdateOptions ) ); - iPositioner.NotifyPositionUpdate( iPositionInfo, iStatus ); + if(!iConnectedPositionServer) + { + // Positions which have time stamp below KMaxAge can be reused + iUpdateOptions.SetMaxUpdateAge( TTimeIntervalMicroSeconds(KMaxAge) ); + // Disables location framework to send partial position data + iUpdateOptions.SetAcceptPartialUpdates( EFalse ); + User::LeaveIfError( iPosServer.Connect() ); + CleanupClosePushL(iPosServer); + User::LeaveIfError( iPositioner.Open( iPosServer ) ); + CleanupClosePushL(iPositioner); + User::LeaveIfError( iPositioner.SetRequestor( CRequestor::ERequestorService, + CRequestor::EFormatApplication, KRequestor ) ); + iUpdateOptions.SetUpdateInterval( TTimeIntervalMicroSeconds (iUpdateInterval) ); + iUpdateOptions.SetUpdateTimeOut( TTimeIntervalMicroSeconds(KUpdateTimeOut ) ); + User::LeaveIfError( iPositioner.SetUpdateOptions( iUpdateOptions ) ); + CleanupStack::Pop(2); // iPositioner, iPosServer + iConnectedPositionServer = ETrue; + } + iState = EPositionOptStateGetLastKnownPosition; + iPositioner.GetLastKnownPosition( iPositionInfo, iStatus ); + SetActive(); } - - SetActive(); - - if ( aCaptureSetting == RLocationTrail::ECaptureNetworkInfo ) + else if ( aCaptureSetting == RLocationTrail::ECaptureNetworkInfo ) { TRequestStatus* status = &iStatus; User::RequestComplete( status, KErrNone ); @@ -138,19 +144,25 @@ // void CPositionInfo::NextPosition() { - iPositionInfo = TPositionSatelliteInfo(); // Clear position info. - if ( iTrailCaptureSetting == RLocationTrail::ECaptureAll ) - { - iPositioner.NotifyPositionUpdate( iPositionInfo, iStatus ); - } - - SetActive(); - - if ( iTrailCaptureSetting == RLocationTrail::ECaptureNetworkInfo ) - { - TRequestStatus* status = &iStatus; - User::RequestComplete( status, KErrNone ); - } + LOG( "CPositionInfo::NextPosition(), begin" ); + if(!IsActive() && iConnectedPositionServer) + { + LOG("Not active"); + iPositionInfo = TPositionSatelliteInfo(); // Clear position info. + if ( iTrailCaptureSetting == RLocationTrail::ECaptureAll ) + { + iState = EPositionOptStateNotifyUpdate; + iPositioner.NotifyPositionUpdate( iPositionInfo, iStatus ); + SetActive(); + } + else if ( iTrailCaptureSetting == RLocationTrail::ECaptureNetworkInfo ) + { + SetActive(); + TRequestStatus* status = &iStatus; + User::RequestComplete( status, KErrNone ); + } + } + LOG( "CPositionInfo::NextPosition(), end" ); } // -------------------------------------------------------------------------- @@ -159,10 +171,17 @@ // void CPositionInfo::Stop() { + LOG( "CPositionInfo::Stop(), begin" ); Cancel(); - - iPositioner.Close(); - iPosServer.Close(); + if(iConnectedPositionServer) + { + iPositioner.Close(); + iPosServer.Close(); + iConnectedPositionServer = EFalse; + } + // reset the state + iState = EPositionOptStateNone; + LOG( "CPositionInfo::Stop(), end" ); } // -------------------------------------------------------------------------- @@ -171,22 +190,39 @@ // void CPositionInfo::RunL() { - iTrail->Position( iPositionInfo, iStatus.Int() ); - - if ( iFirstInterval && IsActive() ) + LOG( "CPositionInfo::RunL(), begin" ); + if(iState == EPositionOptStateGetLastKnownPosition) + { + // get last location.. check the time and if it's within the limit, pass to trail. + const TTimeIntervalSeconds KMaxAllowedLastKnownPosition(60*5); // 5 mins + TTimeIntervalSeconds interval; + TTime now; + TPosition lastPosition; + iPositionInfo.GetPosition(lastPosition); + now.UniversalTime(); + now.SecondsFrom(lastPosition.Time(), interval); + if(iStatus.Int() == KErrNone && interval < KMaxAllowedLastKnownPosition) + { + LOG("Last know position is recent one"); + iTrail->Position( iPositionInfo, iStatus.Int() ); + } + else + { + LOG("Old last know position. Drop it.."); + } + } + else + { + // notify response.. always pass to trail + iTrail->Position( iPositionInfo, iStatus.Int() ); + } + + if ( iTrailCaptureSetting == RLocationTrail::ECaptureAll && + iState != EPositionOptStateNone) { - Cancel(); - LOG("CPositionInfo::RunL() - First Time"); - iUpdateOptions.SetUpdateInterval( TTimeIntervalMicroSeconds (iUpdateInterval) ); - iUpdateOptions.SetUpdateTimeOut( TTimeIntervalMicroSeconds(KUpdateTimeOut ) ); - if ( iTrailCaptureSetting == RLocationTrail::ECaptureAll ) - { - User::LeaveIfError( iPositioner.SetUpdateOptions( iUpdateOptions ) ); - iPositioner.NotifyPositionUpdate( iPositionInfo, iStatus ); - } - SetActive(); - iFirstInterval = EFalse; + NextPosition(); } + LOG( "CPositionInfo::RunL(), end" ); } // -------------------------------------------------------------------------- @@ -195,11 +231,37 @@ // void CPositionInfo::DoCancel() { - LOG( "CPositionInfo::DoCancel()" ); - if ( IsActive() ) + LOG( "CPositionInfo::DoCancel(), begin" ); + switch(iState) { - iPositioner.CancelRequest( EPositionerNotifyPositionUpdate ); + case EPositionOptStateGetLastKnownPosition: + { + iPositioner.CancelRequest( EPositionerGetLastKnownPosition ); + break; + } + case EPositionOptStateNotifyUpdate: + { + iPositioner.CancelRequest( EPositionerNotifyPositionUpdate ); + break; + } + default: + break; } + iState = EPositionOptStateNone; + LOG( "CPositionInfo::DoCancel(), end" ); + } + + +// -------------------------------------------------------------------------- +// CPositionInfo::HandleRemapComplete +// -------------------------------------------------------------------------- +// +void CPositionInfo::HandleRemapComplete() + { + LOG( "CPositionInfo::HandleRemapComplete()" ); + // Don't call notify update from RunL + iState = EPositionOptStateNone; } // End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/locationtrail/src/locationremappingao.cpp --- a/locationmanager/locationtrail/src/locationremappingao.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/locationtrail/src/locationremappingao.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -24,6 +24,11 @@ using namespace MdeConstants; + +// -------------------------------------------------------------------------- +// CLocationRemappingAO::NewL() +// -------------------------------------------------------------------------- +// CLocationRemappingAO* CLocationRemappingAO::NewL() { LOG( "CLocationRemappingAO::NewL" ); // DEBUG INFO @@ -35,6 +40,10 @@ return self; } +// -------------------------------------------------------------------------- +// CLocationRemappingAO::ConstructL() +// -------------------------------------------------------------------------- +// void CLocationRemappingAO::ConstructL() { LOG( "CLocationRemappingAO::ConstructL" ); // DEBUG INFO @@ -49,6 +58,10 @@ } } +// -------------------------------------------------------------------------- +// CLocationRemappingAO::~CLocationRemappingAO() +// -------------------------------------------------------------------------- +// CLocationRemappingAO::~CLocationRemappingAO() { LOG( "CLocationRemappingAO::~CLocationRemappingAO" ); // DEBUG INFO @@ -59,6 +72,10 @@ iObjects.ResetAndDestroy(); } +// -------------------------------------------------------------------------- +// CLocationRemappingAO::CLocationRemappingAO() +// -------------------------------------------------------------------------- +// CLocationRemappingAO::CLocationRemappingAO() : CActive( CActive::EPriorityStandard ), iState ( EIdle ), iContinue( EFalse ), @@ -71,7 +88,10 @@ // No implementation required } - +// -------------------------------------------------------------------------- +// CLocationRemappingAO::InitialiseL() +// -------------------------------------------------------------------------- +// void CLocationRemappingAO::InitialiseL(CMdESession* aMdEClient) { LOG( "CLocationRemappingAO::Initialise start" ); // DEBUG INFO @@ -97,21 +117,41 @@ LOG( "CLocationRemappingAO::Initialise end" ); } + +// -------------------------------------------------------------------------- +// CLocationRemappingAO::Append() +// -------------------------------------------------------------------------- +// void CLocationRemappingAO::Append( TRemapItem aItem ) { iRemapItems.Append( aItem ); } + +// -------------------------------------------------------------------------- +// CLocationRemappingAO::ResetQueue() +// -------------------------------------------------------------------------- +// void CLocationRemappingAO::ResetQueue() { iRemapItems.Reset(); } + +// -------------------------------------------------------------------------- +// CLocationRemappingAO::ItemsInQueue() +// -------------------------------------------------------------------------- +// TBool CLocationRemappingAO::ItemsInQueue() { return iRemapItems.Count() > 0; } + +// -------------------------------------------------------------------------- +// CLocationRemappingAO::CheckQueue() +// -------------------------------------------------------------------------- +// TBool CLocationRemappingAO::CheckQueue() { LOG( "CLocationRemappingAO::CheckQueue - start" ); @@ -165,13 +205,21 @@ return create; } - +// -------------------------------------------------------------------------- +// CLocationRemappingAO::StopRemapping() +// -------------------------------------------------------------------------- +// void CLocationRemappingAO::StopRemapping() { LOG( "CLocationRemappingAO::StopRemapping" ); // DEBUG INFO NextState(EIdle); } + +// -------------------------------------------------------------------------- +// CLocationRemappingAO::StartRemappingObjects() +// -------------------------------------------------------------------------- +// void CLocationRemappingAO::StartRemappingObjects( const TLocationData& aLocationData ) { iLocationData = aLocationData; @@ -185,6 +233,11 @@ NextState( ERemapObjects ); } + +// -------------------------------------------------------------------------- +// CLocationRemappingAO::NextState() +// -------------------------------------------------------------------------- +// void CLocationRemappingAO::NextState(TMappingState aState) { LOG1( "CLocationRemappingAO::NextState - state: %d", aState ); // DEBUG INFO @@ -198,6 +251,11 @@ } } + +// -------------------------------------------------------------------------- +// CLocationRemappingAO::DoCancel() +// -------------------------------------------------------------------------- +// void CLocationRemappingAO::DoCancel() { LOG( "CLocationRemappingAO::DoCancel" ); // DEBUG INFO @@ -205,6 +263,11 @@ NextState(EIdle); } + +// -------------------------------------------------------------------------- +// CLocationRemappingAO::RunError() +// -------------------------------------------------------------------------- +// TInt CLocationRemappingAO::RunError( TInt aError ) { if (aError != KErrNone) @@ -216,6 +279,11 @@ return KErrNone; } + +// -------------------------------------------------------------------------- +// CLocationRemappingAO::RunL() +// -------------------------------------------------------------------------- +// void CLocationRemappingAO::RunL() { LOG1( "CCameraTrailMonitorAO::RunL iStatus: %d", iStatus.Int() ); // DEBUG INFO @@ -252,7 +320,10 @@ } } - +// -------------------------------------------------------------------------- +// CLocationRemappingAO::RemapObjectsL() +// -------------------------------------------------------------------------- +// void CLocationRemappingAO::RemapObjectsL() { LOG( "CLocationRemappingAO::RemapObjects - start" ); // DEBUG INFO @@ -331,6 +402,11 @@ LOG( "CLocationRemappingAO::RemapObjects - end" ); } + +// -------------------------------------------------------------------------- +// CLocationRemappingAO::CommitObjectsL() +// -------------------------------------------------------------------------- +// void CLocationRemappingAO::CommitObjectsL() { LOG( "CLocationRemappingAO::CommitObjects" ); // DEBUG INFO @@ -360,7 +436,10 @@ LOG( "CLocationRemappingAO::ReadTimeFromCenRepL(), end" ); } - +// -------------------------------------------------------------------------- +// CLocationRemappingAO::UpdateRelationsL() +// -------------------------------------------------------------------------- +// void CLocationRemappingAO::UpdateRelationsL( TItemId aLocationId ) { LOG("CLocationRemappingAO::UpdateRelationsL - start"); @@ -396,6 +475,30 @@ LOG("CLocationRemappingAO::UpdateRelationsL - end"); } +#ifdef LOC_REVERSEGEOCODE +// -------------------------------------------------------------------------- +// CLocationRemapping::AttachGeoTagsL +// -------------------------------------------------------------------------- +// +void CLocationRemappingAO::AttachGeoTagsL( CTagCreator *aTagCreator, + const TItemId aCountryTagId, const TItemId aCityTagId ) + { + LOG("CLocationRemapping::AttachGeoTagsL - start"); + + TInt count = iObjectIds.Count() - 1; + for( TInt i = count; i >= 0; i-- ) + { + aTagCreator->AttachTagsL( iObjectIds[i], aCountryTagId, aCityTagId ); + } + + iObjectIds.Reset(); + + LOG("CLocationRemapping::AttachGeoTagsL - end"); + } + +#endif //LOC_REVERSEGEOCODE + + // -------------------------------------------------------------------------- // TRemapItem constructor // -------------------------------------------------------------------------- @@ -409,3 +512,4 @@ } +// End of file diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/server/group/locationmanagerserver.mmp --- a/locationmanager/server/group/locationmanagerserver.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/server/group/locationmanagerserver.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -18,19 +18,22 @@ #include #include +#include "../../inc/locplatsupport.mmh" VERSION 10.0 TARGETTYPE exe TARGET locationmanagerserver.exe UID 0 0x200071BE +EPOCSTACKSIZE 0x5000 + #ifdef WINS EPOCHEAPSIZE 1000 2500000 #else EPOCHEAPSIZE 1000 5000000 #endif -CAPABILITY CAP_SERVER +CAPABILITY CAP_SERVER Location VENDORID VID_DEFAULT USERINCLUDE ../inc @@ -38,11 +41,29 @@ USERINCLUDE ../../../inc USERINCLUDE ../../locationtrail/inc +#ifdef _LOC_REVERSEGEOCODE +MACRO LOC_REVERSEGEOCODE +USERINCLUDE ../../tagcreator/inc +USERINCLUDE ../../reversegeocode/inc +#endif + + +USERINCLUDE ../../geoconverter/inc + +SYSTEMINCLUDE /epoc32/include/platform/lbs +SYSTEMINCLUDE /epoc32/include/stdapis +SYSTEMINCLUDE /epoc32/include/ecom +MW_LAYER_SYSTEMINCLUDE + SOURCEPATH ../src SOURCE clocationmanagerserver.cpp SOURCE clocationmanagersession.cpp +#ifdef _LOC_REVERSEGEOCODE +SOURCE clocationgeotagtimerao.cpp +#endif +SOURCE clocationservertimerhandler.cpp +SOURCE nwregistrationstatushandler.cpp -MW_LAYER_SYSTEMINCLUDE LIBRARY euser.lib LIBRARY efsrv.lib @@ -52,9 +73,21 @@ LIBRARY centralrepository.lib LIBRARY mdeclient.lib LIBRARY mdccommon.lib +LIBRARY libc.lib +LIBRARY ecom.lib +LIBRARY etel.lib +LIBRARY etelmm.lib +LIBRARY commsdat.lib + +#ifdef _LOC_REVERSEGEOCODE +LIBRARY geotagger.lib +#endif PAGED BYTEPAIRCOMPRESSTARGET OPTION ARMCC -O3 -OTime EPOCPROCESSPRIORITY background + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/server/inc/clocationgeotagtimerao.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/server/inc/clocationgeotagtimerao.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2009 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: 3AM geo tagger handler +* +*/ + +#ifndef __CLOCATIONGEOTAGTIMERAO_H__ +#define __CLOCATIONGEOTAGTIMERAO_H__ + + +// INCLUDES +#include +#include +#include +#include + +class CLocationGeoTagTimerAO : public CTimer, + public MGeoTaggerObserver +{ + +public: + /** + * 1st phase constructor. + * @param aMdeSession, CMdESession reference + */ + static CLocationGeoTagTimerAO* NewL(CMdESession& aMdeSession, + MGeoTaggerObserver& aObserver); + + /** + * Destructor + */ + ~CLocationGeoTagTimerAO(); + + /** + * Start 3AM timer + */ + void StartTimer(); + + +protected: + /* + * @see CActive::RunL() + */ + void RunL(); + // MGeoTaggerObserver + /** + * This method is used for notifying that the Geo Tagging is Completed, from MGeoTaggerObserver + * @param aError, TInt value to indicate if there is any error in geotagging + * @return None. + */ + void GeoTaggingCompleted( const TInt aError ); + + /** + * This method is used for notifying completion of query for pending geo tags from MGeoTaggerObserver + * @param aError, TInt value to indicate if there is any error in geotagging + * @return None. + */ + void PendingGeoTagReqComplete( const TInt aError ); + + /* + * Get registrer network country code + * + * @return current register n/w info + */ + RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw(); + + /* + * UE is registered to home network? + * + * @return ETrue if UE is registered at home network else EFalse + */ + TBool IsRegisteredAtHomeNetwork(); + + + /* + * Get home network country code + * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse + * @return user home n/w info + */ + const RMobilePhone::TMobilePhoneNetworkInfoV1& + GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag); + +private: + + /** + * 2nd Phase constructor + */ + void ConstructL(); + + /** + * CLocationGeoTagTimerAO + * Constructor + * @param aMdeSession, CMdESession reference + * @return None. + */ + CLocationGeoTagTimerAO(CMdESession& aMdeSession, MGeoTaggerObserver& aObserver); + +private: + CGeoTagger* iGeoTagger; + CMdESession& iMdeSession; + MGeoTaggerObserver& iObserver; +}; + + +#endif /*__CLOCATIONGEOTAGTIMERAO_H__*/ + +// End of file diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/server/inc/clocationmanagerserver.h --- a/locationmanager/server/inc/clocationmanagerserver.h Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/server/inc/clocationmanagerserver.h Thu Jul 22 16:38:01 2010 +0100 @@ -24,6 +24,9 @@ #include #include #include +#ifdef LOC_REVERSEGEOCODE +#include +#endif //LOC_REVERSEGEOCODE #include "rlocationtrail.h" #include "rlocationobjectmanipulator.h" @@ -35,9 +38,15 @@ #include "mdequery.h" #include "mderelationquery.h" #include "locationmanagerdefs.h" - +#include "clocationservertimerhandler.h" class CMdESession; +#ifdef LOC_REVERSEGEOCODE +class CLocationGeoTagTimerAO; +#endif +class CGeoTagger; +class REComSession; +class CNwRegistrationStatusHandler; // Total number of ranges const TUint KLocationManagerRangeCount = 1; @@ -85,7 +94,9 @@ public MMdESessionObserver, public MMdEQueryObserver, public MMdEObjectObserver, - public MGpxConversionObserver + public MGpxConversionObserver, + public MGeoTaggerObserver, + public MLocationServerTimerObserver { private: struct TMessageQuery @@ -259,30 +270,122 @@ * @return None. */ void RemoveLocationObjectL(TUint& aObjectId); + + /** + * Copies the location object + * @param aSource source location object + * @param aTargets target location object + * @param aQuery message query type + + */ void CopyLocationObjectL( TItemId aSource, const RArray& aTargets, TMessageQuery& aQuery ); + + /** + * Copies the location object + * @param aSource The source location object + * @param aTargets target location object + * @param aQuery message query type + */ void CopyLocationObjectL( const TDesC& aSource, const RArray& aTargets, TMessageQuery& aQuery ); - + + /** + * checks if the session is ready + * @return ETrue if Session is ready + */ TBool IsSessionReady(); - + + /** + * Start track log + * + * @return The itemId + */ TItemId StartTrackLogL(); - + + /** + * Stop track log + * + */ void StopTrackLogL(); - + + /** + * IsTrackLogRecording + * + * @param aRec + */ void IsTrackLogRecording( TBool &aRec ); + /** + * Retrieve track log status + * + * @param aRecording + * @param aFixQuality + */ TInt GetTrackLogStatus( TBool& aRecording, TPositionSatelliteInfo& aFixQuality); - + + /** + * Delete track log + * + * @param aUri + */ TInt DeleteTrackLogL(const TDesC& aUri); - + + /** + * Track log name + * + * @param aFileName name of file used to track log + */ TInt TrackLogName(TFileName& aFileName); + /** + * Gets the location trail capture settings + * @param aCaptureSetting The location trail capture settings + */ void GetCaptureSetting( RLocationTrail::TTrailCaptureSetting& aCaptureSetting ); - + + /** + * Adds an observer for Gpx conversion + * @param aObserver the observer for Gpx conversion + */ void AddGpxObserver( MGpxConversionObserver* aObserver ); + /** + * Copy location by Id + * @param aMessage + */ void InitCopyLocationByIdL( const RMessage2& aMessage ); + + /** + * Copy Location by Uri + * @param aMessage + */ void InitCopyLocationByURIL( const RMessage2& aMessage ); + /** + * Handles tag pending request + * + * @param aMessage IPC message + */ + void TagPendingRequestL( const RMessage2& aMessage ); + + /** + * Cancels the tag pending request + * @param aMessage IPC message + */ + void CancelTagPendingRequest( const RMessage2& aMessage ); + + /** + * Cancels the geotagging request + * @param aMessage IPC message + */ + void CancelGeoTaggingRequest( const RMessage2& aMessage ); + + + /** + * Handle starts geotagging request + * @param aMessage IPC message + */ + void StartGeoTaggingL( const RMessage2& aMessage ); + public: // from MLocationTrailObserver. /** * Callback method to get notification about trail state change. @@ -340,6 +443,52 @@ void GpxFileCreated( const TDesC& aFileName, TItemId aTagId, TReal32 aLength, TTime aStart, TTime aEnd ); +protected: //From MGeoTaggerObserver + + /** + * This method is called on completion of geotagging + * and also completes start geotagging IPC message + * @param aError The err code for geotagging if any + */ + void GeoTaggingCompleted( const TInt aError ); + /** + * This method is used for notifying completion of query for pending geo tags + * @param aError The err code for geotagging if any + */ + void PendingGeoTagReqComplete( const TInt aError ); + + /* + * Get registrer network country code + * + * @return current register n/w info + */ + RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw(); + + + /* + * Get home network country code + * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse + * @return user home n/w info + */ + const RMobilePhone::TMobilePhoneNetworkInfoV1& + GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag); + + + /* + * UE is registered to home network? + * + * @return ETrue if UE is registered at home network else EFalse + */ + TBool IsRegisteredAtHomeNetwork(); + +public: //MLocationServerTimerObserver + /** + * Timer call back + * @param aLocationServerTimerType timer type + * @param aErrorCode error code + */ + void LocationServerTimerCallBackL + (const TLocationServerTimerType aLocationServerTimerType, const TInt aErrorCode); private: /** * C++ constructor. @@ -350,7 +499,11 @@ * 2nd phase constructor. */ void ConstructL(); - + + /** + * Copies the location + * @param aQuery The query + */ void CopyLocationL( CMdEQuery& aQuery ); /** @@ -359,7 +512,10 @@ */ void CancelRequests(RArray& aMessagesList); - + /** + * cancels the list of copy requests + * @param aMessageList the list of query + */ void CancelCopyRequests(RArray& aMessageList); /** @@ -396,22 +552,45 @@ * @param aAny, a pointer to CLocationRecord object * @return Error code */ - static TInt PositioningStopTimeout( TAny* aAny ); + void PositioningStopTimeout(); /** * Callback function to check if files were added to remapping queue with delay * @param aAny, a pointer to CLocationRecord object * @return Error code */ - static TInt CheckForRemappingCallback( TAny* aAny ); + void CheckForRemappingCallback(); + /** * Stops location trail and deletes the positioning stop timer. */ void StopRecording(); - + + /** + * Complete notify request + * + * @param aEventType, returns the event type + * @param aError, return error type for this call. + */ void CompleteNotifyRequest( TEventTypes aEventType, TInt aError ); + /** + * Get supported TSY name + *@param aTsyName - buffer to store the supported tsy name + */ + void GetCommDbTSYnameL(TDes& aTsyName); + + /** + * Initialize etel to access modem parameters + */ + void InitialisePhoneL(); + + /** + * Retrieve home network + */ + void RetrieveHomeNetwork(); + private: /** * A class for recording and storing locations. @@ -466,7 +645,7 @@ * A timer to stop location trail. * Own. */ - CPeriodic* iTimer; + CLocationServerTimerHandler* iTimer; TBool iClientSwitch; TInt iSessionCount; @@ -478,12 +657,27 @@ TInt iLocManStopRemapDelay; RLocationTrail::TTrailCaptureSetting iCaptureSetting; - TBool iRemoveLocation; + TBool iRemoveLocation; /** * A flag for state of waiting for position stop timeout. */ TBool iWaitForPositioningStopTimeout; + RTelServer iTelServer; + RMobilePhone iPhone; + TBool iTelServerIsOpen; + TBool iPhoneIsOpen; + CNwRegistrationStatusHandler *iNwRegistrationStatusHandler; + RMobilePhone::TMobilePhoneNetworkInfoV1 iHomeNetwork; + TBool iHomeNwInfoAvailableFlag; + +#ifdef LOC_REVERSEGEOCODE + CLocationGeoTagTimerAO* iGeoTagTimer; + CGeoTagger* iGeoTaggingPendingReqObj; + RMessage2 iTagPendingMessage; + RMessage2 iGeoTaggingMessage; + REComSession* iEcomSession; +#endif //LOC_REVERSEGEOCODE }; diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/server/inc/clocationservertimerhandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/server/inc/clocationservertimerhandler.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2009 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: helper class to handle location server tiimer related functionality +* +*/ + +#ifndef __CLOCATIONSERVERTIMERHANDLER_H__ +#define __CLOCATIONSERVERTIMERHANDLER_H__ + + +// INCLUDES +#include +#include + + +/* +* Timer Observer class +*/ + +class MLocationServerTimerObserver + { +public: + typedef enum + { + EStopRecording = 0x1, // Stop recording + EPositioningStopTimeout, // Stop positioning + ELocGeneralPurpose // generic purpose + }TLocationServerTimerType; + /** + * Timer call back + * @param aLocationServerTimerType timer type + * @param aErrorCode error code + */ + virtual void LocationServerTimerCallBackL + (const TLocationServerTimerType aLocationServerTimerType, const TInt aErrorCode) = 0; + }; + +/* +* Helper class for location server related to timer functionality. +*/ +class CLocationServerTimerHandler : public CTimer + { + +public: + /** + * 1st phase constructor. + * @param aLocationServerTimerObserver timer observer + */ + static CLocationServerTimerHandler* NewL(MLocationServerTimerObserver& aLocationServerTimerObserver); + + /** + * Destructor + */ + ~CLocationServerTimerHandler(); + + /** + * start a timer for predefined period + * @param anInterval timer value + * @param aLocationServerTimerType timer type + */ + void StartTimer(const TTimeIntervalMicroSeconds32 anInterval, + const MLocationServerTimerObserver::TLocationServerTimerType aLocationServerTimerType); + + +protected: + /* + * @see CActive::RunL() + */ + void RunL(); +private: + /** + * 2nd Phase constructor + */ + void ConstructL(); + /** + * CLocationServerTimerHandler + * Constructor + * @param aLocationServerTimerObserver timer observer + * @return None. + */ + CLocationServerTimerHandler(MLocationServerTimerObserver& aLocationServerTimerObserver); + + + +private: + MLocationServerTimerObserver& iLocationServerTimerObserver; + MLocationServerTimerObserver::TLocationServerTimerType iLocationServerTimerType; + }; + + +#endif /*__CLOCATIONSERVERTIMERHANDLER_H__*/ + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/server/inc/nwregistrationstatushandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/server/inc/nwregistrationstatushandler.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2009 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: Helper class to retrieve UE network registration status +* +*/ + +#ifndef __NW_REGISTRATION_STATUS_HANDLER_H__ +#define __NW_REGISTRATION_STATUS_HANDLER_H__ + + +// INCLUDES +#include +#include +#include + +NONSHARABLE_CLASS(CNwRegistrationStatusHandler) : public CActive +{ + +public: + + /** + * 1st phase constructor + * @param aMobilePhone an instance of the RMobilePhone to get the current network + */ + static CNwRegistrationStatusHandler* NewL(RMobilePhone& aMobilePhone); + + /** + * destructor + */ + ~CNwRegistrationStatusHandler(); + + /** + * Register for getting the n/w registration change notification + * starts notifying the current network changes + */ + void StartNotifier(); + + /** + * Retrieve network registration status + * @return the mobilephone reg status + */ + + RMobilePhone::TMobilePhoneRegistrationStatus GetNetworkRegistrationStatus() const; + +protected: + + /** + * RunL + * from CActive + */ + void RunL(); + + /** + * DoCancel + * from CActive + */ + void DoCancel(); + private: + + /** + * Second phase construction + */ + void ConstructL(); + CNwRegistrationStatusHandler(RMobilePhone& aMobilePhone); + + + +private: + typedef enum + { + ERegStatusOptStateNone = 0x00, + ERegStatusOptStateGet, + ERegStatusOptStateNotify + }TRegStatusOptState; + + /** + * An instance of the RMobilePhone to get the current network + */ + RMobilePhone& iMobilePhone; + + /** + * Indicates the network registration status + */ + RMobilePhone::TMobilePhoneRegistrationStatus iRegistrationStatus; + TRegStatusOptState iState; +}; + + +#endif /*__NW_REGISTRATION_STATUS_HANDLER_H__*/ + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/server/src/clocationgeotagtimerao.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/server/src/clocationgeotagtimerao.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,232 @@ +/* +* Copyright (c) 2009-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: Implements geotagging 3AM timer +* +*/ + +#include "clocationgeotagtimerao.h" +#include +#include +#include +#include "locationmanagerdebug.h" + + + +//Time at which the geotagging should be triggered( 3.00 AM ) +const TInt GEOTAGGING_TIME_IN_HOURS = 3; +//Hour specified in minutes +const TInt HOUR_VALUE_IN_MINUTES = 60; +//Hour specified in seconds +const TInt HOUR_VALUE_IN_SECONDS = 3600; + +// -------------------------------------------------------------------------- +// CLocationGeoTagTimerAO::CLocationGeoTagTimerAO +// -------------------------------------------------------------------------- +// +CLocationGeoTagTimerAO::CLocationGeoTagTimerAO(CMdESession& aMdeSession, + MGeoTaggerObserver& aObserver): + CTimer(EPriorityStandard ), + iGeoTagger(NULL), + iMdeSession(aMdeSession), + iObserver(aObserver) +{ + +} + +// -------------------------------------------------------------------------- +// CLocationGeoTagTimerAO::~CLocationGeoTagTimerAO +// -------------------------------------------------------------------------- +// +CLocationGeoTagTimerAO::~CLocationGeoTagTimerAO() + { + LOG ("CLocationGeoTagTimerAO::~CLocationGeoTagTimerAO(), begin"); + if(iGeoTagger) + { + delete iGeoTagger; + iGeoTagger = NULL; + } + LOG ("CLocationGeoTagTimerAO::~CLocationGeoTagTimerAO(), end"); + } + +// -------------------------------------------------------------------------- +// CLocationGeoTagTimerAO::NewL +// -------------------------------------------------------------------------- +// +CLocationGeoTagTimerAO* CLocationGeoTagTimerAO::NewL(CMdESession& aMdeSession, + MGeoTaggerObserver& aObserver) + { + CLocationGeoTagTimerAO* self = + new( ELeave ) CLocationGeoTagTimerAO(aMdeSession, aObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + + +// -------------------------------------------------------------------------- +// CLocationGeoTagTimerAO::ConstructL +// -------------------------------------------------------------------------- +// +void CLocationGeoTagTimerAO::ConstructL() + { + LOG ("CLocationGeoTagTimerAO::ConstructL(), begin"); + CActiveScheduler::Add(this); + CTimer::ConstructL(); + LOG ("CLocationGeoTagTimerAO::ConstructL(), end"); + } + +// -------------------------------------------------------------------------- +// CLocationGeoTagTimerAO::StartTimer +// -------------------------------------------------------------------------- +// +void CLocationGeoTagTimerAO::StartTimer() + { + LOG ("CLocationGeoTagTimerAO::StartTimer(), begin"); + if(!IsActive()) + { + TTime hometime; + hometime.HomeTime(); + + //Get the current time in Hour,Minute, Second + TDateTime currentDateTime = hometime.DateTime(); + TInt currentHr = currentDateTime.Hour(); + TInt currentMin = currentDateTime.Minute(); + TInt currentSec = currentDateTime.Second(); + + //3 AM in seconds + TInt targetTimeInSeconds = GEOTAGGING_TIME_IN_HOURS * HOUR_VALUE_IN_SECONDS; + TInt timeDifference; + + //Find the time difference in seconds between current time to 3.00 AM + //Either on same day or next day. + if ( currentHr <= GEOTAGGING_TIME_IN_HOURS ) + { + timeDifference = targetTimeInSeconds - + ( ( currentHr * HOUR_VALUE_IN_SECONDS ) + ( currentMin * HOUR_VALUE_IN_MINUTES ) + currentSec ); + } + else + { + timeDifference = ( 24 * HOUR_VALUE_IN_SECONDS - ( + ( currentHr * HOUR_VALUE_IN_SECONDS ) + ( currentMin * HOUR_VALUE_IN_MINUTES ) + currentSec ) ) + + targetTimeInSeconds ; + } + + //Add the time difference to current time to set the target time ( 3.00 AM ) + TTimeIntervalSeconds interval( timeDifference ); + TTime timeToSet; + timeToSet.HomeTime(); + timeToSet+= interval; + + + At( timeToSet ); + } + LOG ("CLocationGeoTagTimerAO::StartTimer(), end"); + } + + +// -------------------------------------------------------------------------- +// CLocationGeoTagTimerAO::RunL +// -------------------------------------------------------------------------- +// +void CLocationGeoTagTimerAO::RunL( ) + { + LOG ("CLocationGeoTagTimerAO::RunL(), begin"); + TInt status = iStatus.Int(); + + switch( status ) + { + case KErrAbort: + StartTimer(); + break; + case KErrUnderflow: + case KErrOverflow: + StartTimer(); + break; + case KErrNone: + { + //Trigger the reverse geocoding and start the timer again + //Create the instance of geotagger class + if(iGeoTagger) + { + delete iGeoTagger; + iGeoTagger = NULL; + } + iGeoTagger = CGeoTagger::NewL( this, NULL ); + iGeoTagger->CreateGeoTagsL(); + break; + } + default: + break; + } + LOG ("CLocationGeoTagTimerAO::RunL(), end"); + } + +// -------------------------------------------------------------------------- +// CLocationGeoTagTimerAO::GeoTaggingCompleted +// -------------------------------------------------------------------------- +// +void CLocationGeoTagTimerAO::GeoTaggingCompleted( const TInt aError ) + { + LOG ("CLocationGeoTagTimerAO::GeoTaggingCompleted(), begin"); + delete iGeoTagger; + iGeoTagger = NULL; + StartTimer(); + iObserver.GeoTaggingCompleted(aError); + LOG ("CLocationGeoTagTimerAO::GeoTaggingCompleted(), end"); + } + +// -------------------------------------------------------------------------- +// CLocationGeoTagTimerAO::PendingGeoTagReqComplete +// -------------------------------------------------------------------------- +// +void CLocationGeoTagTimerAO::PendingGeoTagReqComplete( const TInt aError ) + { + LOG ("CLocationGeoTagTimerAO::PendingGeoTagReqComplete()"); + // do nothing. + iObserver.PendingGeoTagReqComplete(aError); + } + +// ---------------------------------------------------------------------------- +// CLocationGeoTagTimerAO::GetCurrentRegisterNw() +// ---------------------------------------------------------------------------- +RMobilePhone::TMobilePhoneNetworkInfoV2& CLocationGeoTagTimerAO::GetCurrentRegisterNw() + { + LOG( "CLocationGeoTagTimerAO::GetCurrentRegisterNw ,begin" ); + return iObserver.GetCurrentRegisterNw(); + } + + +// ---------------------------------------------------------------------------- +// CLocationGeoTagTimerAO::IsRegisteredAtHomeNetwork() +// ---------------------------------------------------------------------------- +TBool CLocationGeoTagTimerAO::IsRegisteredAtHomeNetwork() + { + LOG( "CLocationGeoTagTimerAO::IsRegisteredAtHomeNetwork" ); + return iObserver.IsRegisteredAtHomeNetwork(); + } + +// ---------------------------------------------------------------------------- +// CLocationGeoTagTimerAO::GetHomeNetworkInfo() +// ---------------------------------------------------------------------------- +const RMobilePhone::TMobilePhoneNetworkInfoV1& + CLocationGeoTagTimerAO::GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) + { + LOG( "CLocationGeoTagTimerAO::GetHomeNetworkInfo" ); + return iObserver.GetHomeNetworkInfo(aHomeNwInfoAvailableFlag); + } + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/server/src/clocationmanagerserver.cpp --- a/locationmanager/server/src/clocationmanagerserver.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/server/src/clocationmanagerserver.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -17,6 +17,10 @@ #include #include +#include +#include +#include +#include #include "clocationmanagerserver.h" #include "clocationmanagersession.h" @@ -29,8 +33,14 @@ #include "mdeobjectdef.h" #include "mdepropertydef.h" #include "mdcserializationbuffer.h" +#ifdef LOC_REVERSEGEOCODE +#include "clocationgeotagtimerao.h" +#endif //LOC_REVERSEGEOCODE +#include "nwregistrationstatushandler.h" using namespace MdeConstants; +using namespace CommsDat; + // -------------------------------------------------------------------------- // RunServerL @@ -94,6 +104,7 @@ : CPolicyServer( CActive::EPriorityStandard, KLocationManagerPolicy, ESharableSessions ), + iASW(NULL), iTimer( NULL ), iSessionReady( EFalse ), iTagId( 0 ), @@ -101,7 +112,16 @@ iLocManStopRemapDelay( 0 ), iCaptureSetting( RLocationTrail::EOff ), iRemoveLocation( EFalse ), - iWaitForPositioningStopTimeout ( EFalse ) + iWaitForPositioningStopTimeout ( EFalse ), + iTelServerIsOpen(EFalse), + iPhoneIsOpen(EFalse), + iNwRegistrationStatusHandler(NULL), + iHomeNwInfoAvailableFlag(EFalse) +#ifdef LOC_REVERSEGEOCODE + ,iGeoTagTimer(NULL) + ,iGeoTaggingPendingReqObj(NULL) + ,iEcomSession(NULL) +#endif //LOC_REVERSEGEOCODE { } @@ -119,50 +139,69 @@ RProcess process; process.SetPriority( EPriorityBackground ); process.Close(); + + // initialize etel + InitialisePhoneL(); +#ifdef LOC_REVERSEGEOCODE + iEcomSession = &(REComSession::OpenL()); +#endif //LOC_REVERSEGEOCODE + iASW = new (ELeave) CActiveSchedulerWait(); + + iNwRegistrationStatusHandler = CNwRegistrationStatusHandler::NewL(iPhone); + iMdeSession = CMdESession::NewL( *this ); - iLocationRecord = CLocationRecord::NewL(); + iLocationRecord = CLocationRecord::NewL(*this, iPhone); iTrackLog = CTrackLog::NewL(); iASW->Start(); - - iLocationRecord->SetObserver( this ); - - iLocationRecord->SetAddObserver( iTrackLog ); - - iTrackLog->AddGpxObserver( this ); - - CRepository* repository = CRepository::NewLC( KRepositoryUid ); - TInt err = repository->Get( KLocationTrailShutdownTimer, iLocManStopDelay ); - - LOG1("CLocationManagerServer::ConstructL, iLocManStopDelay:%d", iLocManStopDelay); - - if ( err != KErrNone ) - { - LOG1("CLocationManagerServer::ConstructL, iLocManStopDelay err:%d", err); - iLocManStopDelay = KLocationTrailShutdownDelay; - } + delete iASW; + iASW = NULL; + if(iSessionReady) + { + LOG("Session is ready to give service"); + + iLocationRecord->SetObserver( this ); + + iLocationRecord->SetAddObserver( iTrackLog ); + + iTrackLog->AddGpxObserver( this ); + + CRepository* repository = CRepository::NewLC( KRepositoryUid ); + TInt err = repository->Get( KLocationTrailShutdownTimer, iLocManStopDelay ); + + LOG1("CLocationManagerServer::ConstructL, iLocManStopDelay:%d", iLocManStopDelay); + + if ( err != KErrNone ) + { + LOG1("CLocationManagerServer::ConstructL, iLocManStopDelay err:%d", err); + iLocManStopDelay = KLocationTrailShutdownDelay; + } - err = repository->Get( KLocationTrailRemapShutdownTimer, iLocManStopRemapDelay ); - CleanupStack::PopAndDestroy( repository ); - - LOG1("CLocationManagerServer::ConstructL, iLocManStopRemapDelay:%d", iLocManStopRemapDelay); - - if ( err != KErrNone ) - { - LOG1("CLocationManagerServer::ConstructL, iLocManStopRemapDelay err:%d", err); - iLocManStopRemapDelay = KLocationTrailRemapShutdownDelay; + err = repository->Get( KLocationTrailRemapShutdownTimer, iLocManStopRemapDelay ); + CleanupStack::PopAndDestroy( repository ); + + LOG1("CLocationManagerServer::ConstructL, iLocManStopRemapDelay:%d", iLocManStopRemapDelay); + + if ( err != KErrNone ) + { + LOG1("CLocationManagerServer::ConstructL, iLocManStopRemapDelay err:%d", err); + iLocManStopRemapDelay = KLocationTrailRemapShutdownDelay; + } + +#ifdef LOC_REVERSEGEOCODE + //Create the instance of the geotagging timer object + iGeoTagTimer = CLocationGeoTagTimerAO::NewL(*iMdeSession, *this); + //Schedule a task for geotagging every day at 3.00 AM + iGeoTagTimer->StartTimer(); +#endif //LOC_REVERSEGEOCODE } - - TRAPD( error, iTimer = CPeriodic::NewL( CActive::EPriorityUserInput ) ); - if ( error != KErrNone ) + else { - LOG("CLocationManagerServer::ConstructL - iTimer not created"); - iTimer = NULL; - } - - + LOG("Unable to open MDE session. Closing.."); + User::Leave(KErrCouldNotConnect); + } LOG ("CLocationManagerServer::ConstructL() end"); } @@ -173,13 +212,19 @@ // CLocationManagerServer::~CLocationManagerServer() { + LOG("CLocationManagerServer::~CLocationManagerServer ,begin"); + +#ifdef LOC_REVERSEGEOCODE + delete iGeoTagTimer; + delete iGeoTaggingPendingReqObj; +#endif //LOC_REVERSEGEOCODE + delete iLocationRecord; delete iTrackLog; delete iTimer; - //delete iRelationQuery; delete iASW; delete iMdeSession; - + delete iNwRegistrationStatusHandler; iTargetObjectIds.Close(); CancelRequests(iNotifReqs); iNotifReqs.Close(); @@ -190,9 +235,115 @@ CancelCopyRequests(iCopyReqs); iCopyReqs.Close(); iSessionCount = 0; + if(iPhoneIsOpen) + { + iPhoneIsOpen = EFalse; // not required + iPhone.Close(); + } + if(iTelServerIsOpen) + { + iTelServerIsOpen = EFalse; + iTelServer.Close(); + } +#ifdef LOC_REVERSEGEOCODE + if(iEcomSession) + { + iEcomSession->Close(); + } +#endif //LOC_REVERSEGEOCODE + LOG("CLocationManagerServer::~CLocationManagerServer ,end"); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::GetCommDbTSYnameL +// -------------------------------------------------------------------------- +// +void CLocationManagerServer::GetCommDbTSYnameL(TDes& aTsyName) + { + LOG( "CLocationManagerServer::GetCommDbTSYnameL(), begin" ); +#ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY + CMDBSession* db = CMDBSession::NewL(KCDVersion1_2); +#else + CMDBSession* db = CMDBSession::NewL(KCDVersion1_1); +#endif + CleanupStack::PushL(db); + + CMDBField* globalSettingField = new(ELeave) CMDBField(KCDTIdBearerAvailabilityCheckTSY); + CleanupStack::PushL(globalSettingField); + globalSettingField->SetRecordId(1); + globalSettingField->SetMaxLengthL(KMaxTextLength); + globalSettingField->LoadL(*db); + aTsyName = *globalSettingField; + CleanupStack::PopAndDestroy(globalSettingField); + + CleanupStack::PopAndDestroy(db); + LOG( "CLocationManagerServer::GetCommDbTSYnameL(), end" ); + } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::InitialisePhoneL // -------------------------------------------------------------------------- -// CLocationManagerServer::CompleteRequests() +// +void CLocationManagerServer::InitialisePhoneL() + { + LOG( "CLocationManagerServer::InitialisePhoneL(), begin" ); + User::LeaveIfError(iTelServer.Connect()); + iTelServerIsOpen = ETrue; + TBuf tsyName; + GetCommDbTSYnameL(tsyName); + + User::LeaveIfError(iTelServer.LoadPhoneModule(tsyName)); + + TInt numPhones; + User::LeaveIfError(iTelServer.EnumeratePhones(numPhones)); + + TInt phoneIndx; + TInt ret = KErrHardwareNotAvailable; + + for(phoneIndx=0; phoneIndx& aMessageList) @@ -211,6 +362,10 @@ aMessageList.Reset(); } +// -------------------------------------------------------------------------- +// CLocationManagerServer::CancelCopyRequests +// -------------------------------------------------------------------------- +// void CLocationManagerServer::CancelCopyRequests(RArray& aMessageList) { const TInt count = aMessageList.Count(); @@ -227,10 +382,14 @@ aMessageList.Reset(); } - +// -------------------------------------------------------------------------- +// CLocationManagerServer::HandleSessionOpened +// -------------------------------------------------------------------------- +// void CLocationManagerServer::HandleSessionOpened(CMdESession& /*aSession*/, TInt aError) { - if ( iASW->IsStarted() ) + LOG ("CLocationManagerServer::HandleSessionOpened() start"); + if ( iASW && iASW->IsStarted() ) { iASW->AsyncStop(); } @@ -249,18 +408,31 @@ } } -void CLocationManagerServer::HandleSessionError(CMdESession& /*aSession*/, TInt /*aError*/) + +// -------------------------------------------------------------------------- +// CLocationManagerServer::HandleSessionError +// -------------------------------------------------------------------------- +// +void CLocationManagerServer::HandleSessionError(CMdESession& /*aSession*/, TInt aError) { + LOG1 ("CLocationManagerServer::HandleSessionError() start, Error - %d", aError); + ARG_USED(aError); iSessionReady = EFalse; delete iMdeSession; iMdeSession = NULL; - if ( iASW->IsStarted() ) + if ( iASW && iASW->IsStarted() ) { iASW->AsyncStop(); } } + + +// -------------------------------------------------------------------------- +// CLocationManagerServer::IsSessionReady +// -------------------------------------------------------------------------- +// TBool CLocationManagerServer::IsSessionReady() { return iSessionReady; @@ -303,8 +475,11 @@ void CLocationManagerServer::RemoveSession() { iSessionCount--; - if ( !iSessionCount ) + if ( !iSessionCount + && iLocationRecord + && !iLocationRecord->TaggingInProgress()) { + // Nothing in progress. shutdown the server CActiveScheduler::Stop(); } } @@ -334,7 +509,8 @@ if ( iTimer ) { - iTimer->Cancel(); + delete iTimer; + iTimer = NULL; } iLocationRecord->StartL( aCaptureSetting ); @@ -355,24 +531,19 @@ if( state != RLocationTrail::ETrailStopped && state != RLocationTrail::ETrailStopping ) { - if(!iTimer) + if(iTimer == NULL) { - TRAPD( error, iTimer = CPeriodic::NewL( CActive::EPriorityUserInput ) ); - if ( error != KErrNone ) - { - LOG("CLocationManagerServer::StopGPSPositioningL() - iTimer not created"); - iTimer = NULL; - } - } - if(iTimer) + TRAP_IGNORE(iTimer = CLocationServerTimerHandler::NewL(*this)); + } + if ( iTimer == NULL) { - iTimer->Cancel(); - iLocationRecord->SetStateToStopping(); - iTimer->Start( iLocManStopDelay * 1000000, 0, TCallBack( CheckForRemappingCallback, this ) ); - } + // If timer can't be created we stop the location trail immediately. + iLocationRecord->Stop(); + } else { - iLocationRecord->Stop(); + iLocationRecord->SetStateToStopping(); + iTimer->StartTimer( iLocManStopDelay * 1000000, MLocationServerTimerObserver::EStopRecording); } } @@ -389,48 +560,61 @@ LOG( "CLocationManagerServer::StopRecording()" ); iWaitForPositioningStopTimeout = EFalse; iLocationRecord->Stop(); - if(iTimer) - { - iTimer->Cancel(); - } - + } + +// -------------------------------------------------------------------------- +// CLocationUtilityServer::LocationServerTimerCallBackL +// -------------------------------------------------------------------------- +// +void CLocationManagerServer::LocationServerTimerCallBackL + (const TLocationServerTimerType aLocationServerTimerType, const TInt /*aErrorCode*/) + { + LOG1( "CLocationManagerServer::LocationServerTimerCallBackL, begin, Type - %d", + aLocationServerTimerType); + switch(aLocationServerTimerType) + { + case MLocationServerTimerObserver::EStopRecording: + CheckForRemappingCallback(); + break; + case MLocationServerTimerObserver::EPositioningStopTimeout: + PositioningStopTimeout(); + break; + case MLocationServerTimerObserver::ELocGeneralPurpose: + default: + // execution shouldn't come over here. + LOG("Invalid timer type"); + break; + } + LOG( "CLocationManagerServer::LocationServerTimerCallBackL, end" ); } // -------------------------------------------------------------------------- // CLocationUtilityServer::PositioningStopTimeout // -------------------------------------------------------------------------- // -TInt CLocationManagerServer::PositioningStopTimeout( TAny* aAny ) +void CLocationManagerServer::PositioningStopTimeout() { LOG( "CLocationManagerServer::PositioningStopTimeout" ); - CLocationManagerServer* self = STATIC_CAST( CLocationManagerServer*, aAny ); - self->StopRecording(); - - return KErrNone; + StopRecording(); } // -------------------------------------------------------------------------- -// CLocationUtilityServer::PositioningStopTimeout +// CLocationUtilityServer::CheckForRemappingCallback // -------------------------------------------------------------------------- // -TInt CLocationManagerServer::CheckForRemappingCallback( TAny* aAny ) +void CLocationManagerServer::CheckForRemappingCallback() { - LOG( "CLocationManagerServer::CheckForRemappingCallback" ); - CLocationManagerServer* self = STATIC_CAST( CLocationManagerServer*, aAny ); - - self->iTimer->Cancel(); - - if ( self->iLocationRecord->RemappingNeeded() && !self->iLocationRecord->IsLowBattery()) + LOG( "CLocationManagerServer::CheckForRemappingCallback, begin" ); + if ( iLocationRecord->RemappingNeeded() && !iLocationRecord->IsLowBattery()) { - self->iTimer->Start( self->iLocManStopRemapDelay * 1000000, 0, TCallBack( PositioningStopTimeout, self ) ); - self->iWaitForPositioningStopTimeout = ETrue; + iTimer->StartTimer( iLocManStopRemapDelay * 1000000, MLocationServerTimerObserver::EPositioningStopTimeout); + iWaitForPositioningStopTimeout = ETrue; } else { - self->StopRecording(); + StopRecording(); } - - return KErrNone; + LOG( "CLocationManagerServer::CheckForRemappingCallback, end" ); } // -------------------------------------------------------------------------- @@ -548,7 +732,7 @@ } // -------------------------------------------------------------------------- -// CLocationManagerServer::GetCurrentCellId +// CLocationManagerServer::GetCurrentNetworkInfo // -------------------------------------------------------------------------- // void CLocationManagerServer::GetCurrentNetworkInfo( CTelephony::TNetworkInfoV1& aNetworkInfo ) @@ -630,6 +814,11 @@ LOG( "CLocationManagerServer::CurrentLocation(), end" ); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::GPSSignalQualityChanged +// -------------------------------------------------------------------------- +// void CLocationManagerServer::GPSSignalQualityChanged( const TPositionSatelliteInfo& aSatelliteInfo ) { LOG( "CLocationManagerServer::GPSSignalQualityChanged" ); @@ -677,7 +866,10 @@ } - +// -------------------------------------------------------------------------- +// CLocationManagerServer::CancelTrackLogNotificationRequest +// -------------------------------------------------------------------------- +// void CLocationManagerServer::CancelTrackLogNotificationRequest( const TInt aHandle ) { LOG( "CLocationManagerServer::CancelTrackLogNotificationRequest(), begin" ); @@ -704,6 +896,11 @@ LOG( "CLocationManagerServer::CancelTrackLogNotificationRequest(), end" ); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::CreateLocationObjectL +// -------------------------------------------------------------------------- +// void CLocationManagerServer::CreateLocationObjectL( const TLocationData& aLocationData, const TUint& aObjectId ) { @@ -715,13 +912,21 @@ iLocationRecord->CreateLocationObjectL( aLocationData, aObjectId ); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::LocationSnapshotL +// -------------------------------------------------------------------------- +// void CLocationManagerServer::LocationSnapshotL( const TUint& aObjectId ) { + LOG( "CLocationManagerServer::LocationSnapshotL(), begin" ); if ( !IsSessionReady() ) { + LOG( "Session is not ready" ); User::Leave( KErrNotReady ); } iLocationRecord->LocationSnapshotL( aObjectId ); + LOG( "CLocationManagerServer::LocationSnapshotL(), end" ); } // -------------------------------------------------------------------------- @@ -757,6 +962,11 @@ iRelationQuery->FindL( 1, 1 ); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::CopyLocationObjectL +// -------------------------------------------------------------------------- +// void CLocationManagerServer::CopyLocationObjectL( TItemId aSource, const RArray& aTargets, TMessageQuery& aMessageQuery ) { @@ -818,6 +1028,11 @@ } } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::CopyLocationObjectL +// -------------------------------------------------------------------------- +// void CLocationManagerServer::CopyLocationObjectL( const TDesC& aSource, const RArray& aTargets, TMessageQuery& aQuery ) { @@ -839,13 +1054,24 @@ CopyLocationObjectL( source, iTargetObjectIds, aQuery ); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::HandleQueryNewResults +// -------------------------------------------------------------------------- +// void CLocationManagerServer::HandleQueryNewResults( CMdEQuery& /*aQuery*/, TInt /*aFirstNewItemIndex*/, TInt /*aNewItemCount*/ ) { } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::HandleQueryCompleted +// -------------------------------------------------------------------------- +// void CLocationManagerServer::HandleQueryCompleted( CMdEQuery& aQuery, TInt aError ) { + LOG("CLocationManagerServer::HandleQueryCompleted"); if ( iRemoveLocation ) { if( aQuery.Count() > 0 && aError == KErrNone ) @@ -889,6 +1115,11 @@ iTargetObjectIds.Reset(); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::NewLC +// -------------------------------------------------------------------------- +// void CLocationManagerServer::CopyLocationL( CMdEQuery& aQuery ) { CMdEObjectDef& locationDef = aQuery.NamespaceDef().GetObjectDefL( Location::KLocationObject ); @@ -926,6 +1157,11 @@ } } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::InitCopyLocationByIdL +// -------------------------------------------------------------------------- +// void CLocationManagerServer::InitCopyLocationByIdL( const RMessage2& aMessage ) { const TInt KParamSourceId = 0; @@ -959,6 +1195,11 @@ CleanupStack::PopAndDestroy(&targetIds); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::InitCopyLocationByURIL +// -------------------------------------------------------------------------- +// void CLocationManagerServer::InitCopyLocationByURIL( const RMessage2& aMessage ) { LOG( "CLocationManagerSession::CopyLocationDataByUriL begin" ); @@ -1008,8 +1249,14 @@ LOG( "CLocationManagerSession::CopyLocationDataByUriL end" ); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::StartTrackLogL +// -------------------------------------------------------------------------- +// TItemId CLocationManagerServer::StartTrackLogL() { + LOG("CLocationManagerServer::StartTrackLogL"); if ( iTrackLog->IsRecording() ) { User::Leave( KErrInUse ); @@ -1026,8 +1273,14 @@ return iTagId; } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::StopTrackLogL +// -------------------------------------------------------------------------- +// void CLocationManagerServer::StopTrackLogL() { + LOG("CLocationManagerServer::StopTrackLogL"); if ( iTrackLog->IsRecording() ) { iTrackLog->StopRecordingL(); @@ -1040,8 +1293,14 @@ } } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::CompleteNotifyRequest +// -------------------------------------------------------------------------- +// void CLocationManagerServer::CompleteNotifyRequest( TEventTypes aEventType, TInt aError ) { + LOG("CLocationManagerServer::CompleteNotifyRequest"); const TInt KEventTypeParam = 2; TPckg wrapEventType( aEventType ); @@ -1059,19 +1318,35 @@ iTrackLogNotifyReqs.Reset(); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::IsTrackLogRecording +// -------------------------------------------------------------------------- +// void CLocationManagerServer::IsTrackLogRecording( TBool &aRec ) { aRec = iTrackLog->IsRecording(); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::GpxFileCreated +// -------------------------------------------------------------------------- +// void CLocationManagerServer::GpxFileCreated( const TDesC& aFileName, TItemId aTagId, TReal32 aLength, TTime aStart, TTime aEnd ) { TRAP_IGNORE( CreateTrackLogL( aTagId, aFileName, aLength, aStart, aEnd ) ); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::CreateTrackLogTagL +// -------------------------------------------------------------------------- +// TItemId CLocationManagerServer::CreateTrackLogTagL() { + LOG("CLocationManagerServer::CreateTrackLogTagL"); if ( !IsSessionReady() ) { User::Leave( KErrNotReady ); @@ -1104,9 +1379,15 @@ return tagId; } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::CreateTrackLogL +// -------------------------------------------------------------------------- +// void CLocationManagerServer::CreateTrackLogL( TItemId aTagId, const TDesC& aUri, TReal32 aLength, TTime aStart, TTime aEnd ) { + LOG("CLocationManagerServer::CreateTrackLogL"); if ( !IsSessionReady() ) { User::Leave( KErrNotReady ); @@ -1153,6 +1434,11 @@ CleanupStack::PopAndDestroy( trackLog ); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::GetTrackLogStatus +// -------------------------------------------------------------------------- +// TInt CLocationManagerServer::GetTrackLogStatus( TBool& aRecording, TPositionSatelliteInfo& aFixQuality) { if ( !iTrackLog ) @@ -1165,6 +1451,11 @@ return KErrNone; } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::DeleteTrackLogL +// -------------------------------------------------------------------------- +// TInt CLocationManagerServer::DeleteTrackLogL( const TDesC& aUri ) { LOG( "CLocationManagerServer::DeleteTrackLogL enter" ); @@ -1205,6 +1496,11 @@ return err; } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::TrackLogName +// -------------------------------------------------------------------------- +// TInt CLocationManagerServer::TrackLogName( TFileName& aFileName ) { if ( iTrackLog->IsRecording() ) @@ -1215,11 +1511,21 @@ return KErrNotFound; } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::GetCaptureSetting +// -------------------------------------------------------------------------- +// void CLocationManagerServer::GetCaptureSetting( RLocationTrail::TTrailCaptureSetting& aCaptureSetting ) { aCaptureSetting = iCaptureSetting; } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::HandleObjectNotification +// -------------------------------------------------------------------------- +// void CLocationManagerServer::HandleObjectNotification( CMdESession& /*aSession*/, TObserverNotificationType aType, const RArray& aObjectIdArray ) @@ -1234,6 +1540,11 @@ TRAP_IGNORE( LinkObjectToTrackLogTagL( aObjectIdArray ) ); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::StartListeningTagRemovalsL +// -------------------------------------------------------------------------- +// void CLocationManagerServer::StartListeningTagRemovalsL() { if ( !IsSessionReady() ) @@ -1249,6 +1560,11 @@ CleanupStack::Pop( condition ); } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::StartListeningObjectCreationsL +// -------------------------------------------------------------------------- +// void CLocationManagerServer::StartListeningObjectCreationsL() { if ( !IsSessionReady() ) @@ -1271,6 +1587,11 @@ } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::LinkObjectToTrackLogTagL +// -------------------------------------------------------------------------- +// void CLocationManagerServer::LinkObjectToTrackLogTagL( const RArray& aObjectIdArray ) { CMdERelationDef& containsRelDef = iMdeSession->GetDefaultNamespaceDefL() @@ -1288,21 +1609,279 @@ } } + +// -------------------------------------------------------------------------- +// CLocationManagerServer::AddGpxObserver +// -------------------------------------------------------------------------- +// void CLocationManagerServer::AddGpxObserver( MGpxConversionObserver* aObserver ) { iTrackLog->AddGpxObserver( aObserver ); } +// -------------------------------------------------------------------------- +// CLocationManagerServer::RemapedCompleted() +// -------------------------------------------------------------------------- +// void CLocationManagerServer::RemapedCompleted() { LOG( "CLocationManagerServer::RemapedCompleted()" ); StopRecording(); } +// -------------------------------------------------------------------------- +// CLocationManagerServer::WaitForPositioningStopTimeout() +// -------------------------------------------------------------------------- +// TBool CLocationManagerServer::WaitForPositioningStopTimeout() { LOG( "CLocationManagerServer::WaitForPositioningStopTimeout()" ); return iWaitForPositioningStopTimeout; } +// -------------------------------------------------------------------------- +// CLocationManagerServer::GeoTaggingCompleted +// -------------------------------------------------------------------------- +// + +void CLocationManagerServer::GeoTaggingCompleted( const TInt aError ) + { + LOG("CLocationManagerServer::GeoTaggingCompleted ,begin"); + ARG_USED(aError); + // do nothing because we are only handling pending request for this object. +#ifdef LOC_REVERSEGEOCODE + if(!iGeoTaggingMessage.IsNull()) + { + LOG("Completing the request"); + iGeoTaggingMessage.Complete(aError); + iGeoTaggingMessage = RMessage2 (); + } +#endif //LOC_REVERSEGEOCODE + // once geo tagging completed, check whether, we can terminate the server + if ( !iSessionCount + && iLocationRecord + && !iLocationRecord->TaggingInProgress()) + { + // Nothing in progress. shutdown the server + CActiveScheduler::Stop(); + } + LOG("CLocationManagerServer::GeoTaggingCompleted ,end"); + } + + +// -------------------------------------------------------------------------- +// CLocationManagerServer::PendingGeoTagReqComplete +// -------------------------------------------------------------------------- +// +void CLocationManagerServer::PendingGeoTagReqComplete( const TInt aError ) + { + LOG("CLocationManagerServer::PendingGeoTagReqComplete ,begin"); + ARG_USED(aError); +#ifdef LOC_REVERSEGEOCODE + if(!iTagPendingMessage.IsNull()) + { + + TGeoTaggingSatus pendingGeoTagEntry = EGeoTagCmpt; + switch(aError) + { + case KErrNotFound: + pendingGeoTagEntry = EGeoTaggingPending; + LOG("Geo tagging pending"); + break; + case KErrInUse: + pendingGeoTagEntry = EGeoTaggingGoingOn; + LOG("Geo tagging going on"); + break; + default: + break; + } + + TPckg pendingGeoTagEntryPkg( pendingGeoTagEntry ); + TRAPD(err, iTagPendingMessage.WriteL( 0, pendingGeoTagEntryPkg )); + iTagPendingMessage.Complete((err == KErrNone) ? KErrNone : err); + iTagPendingMessage = RMessage2 (); + } +#endif //LOC_REVERSEGEOCODE + LOG("CLocationManagerServer::PendingGeoTagReqComplete ,end"); + } + + +// -------------------------------------------------------------------------- +// CLocationManagerServer::TagPendingRequestL +// -------------------------------------------------------------------------- +// +void CLocationManagerServer::TagPendingRequestL( const RMessage2& aMessage ) + { + LOG("CLocationManagerServer::TagPendingRequestL ,begin"); + // Only one request at a time +#ifdef LOC_REVERSEGEOCODE + if(iTagPendingMessage.IsNull() && iGeoTaggingMessage.IsNull()) + { + iTagPendingMessage = RMessage2( aMessage ); + // search for pending entry. + //Create the instance of geotagger class + TBool tagProgress = iLocationRecord->TaggingInProgress(); + if(tagProgress) + { + LOG("Tagging is going on.\n"); + // Let UI to send start geo tagging command. + PendingGeoTagReqComplete(KErrNotFound); + } + else + { + LOG("Tagging is not going on.\n"); + if(iGeoTaggingPendingReqObj == NULL) + { + iGeoTaggingPendingReqObj = CGeoTagger::NewL( this, NULL ); + } + iGeoTaggingPendingReqObj->PendingGeoTagsL( tagProgress); + } + } + else + { + LOG("Server busy\n"); + aMessage.Complete(KErrServerBusy); + } +#else + aMessage.Complete(KErrNotSupported); +#endif //LOC_REVERSEGEOCODE + LOG("CLocationManagerServer::TagPendingRequestL ,end"); + } + + + +// -------------------------------------------------------------------------- +// CLocationManagerServer::CancelTagPendingRequest +// -------------------------------------------------------------------------- +// +void CLocationManagerServer::CancelTagPendingRequest( const RMessage2& aMessage ) + { + LOG("CLocationManagerServer::CancelTagPendingRequest ,begin"); + // Only one request at a time +#ifdef LOC_REVERSEGEOCODE + if(!iTagPendingMessage.IsNull()) + { + iTagPendingMessage.Complete(KErrCancel); + iLocationRecord->CancelGeoTagging(); + } + aMessage.Complete(KErrNone); +#else + aMessage.Complete(KErrNotSupported); +#endif //LOC_REVERSEGEOCODE + } + + +// -------------------------------------------------------------------------- +// CLocationManagerServer::CancelGeoTaggingRequest +// -------------------------------------------------------------------------- +// +void CLocationManagerServer::CancelGeoTaggingRequest( const RMessage2& aMessage ) + { + LOG("CLocationManagerServer::CancelGeoTaggingRequest ,begin"); + // Only one request at a time +#ifdef LOC_REVERSEGEOCODE + if(!iGeoTaggingMessage.IsNull()) + { + iGeoTaggingMessage.Complete(KErrCancel); + iGeoTaggingMessage = RMessage2 (); + iLocationRecord->CancelGeoTagging(); + } + aMessage.Complete(KErrNone); +#else + aMessage.Complete(KErrNotSupported); +#endif //LOC_REVERSEGEOCODE + } + + +// -------------------------------------------------------------------------- +// CLocationManagerServer::StartGeoTaggingL +// -------------------------------------------------------------------------- +// +void CLocationManagerServer::StartGeoTaggingL( const RMessage2& aMessage ) + { + LOG("CLocationManagerServer::StartGeoTaggingL ,begin"); +#ifdef LOC_REVERSEGEOCODE + if(iGeoTaggingMessage.IsNull() && iTagPendingMessage.IsNull()) + { + iGeoTaggingMessage = RMessage2( aMessage ); + // search for pending entry. + //Create the instance of geotagger class + if(!iLocationRecord->StartGeoTagging(EInteractive)) + { + if(iGeoTaggingPendingReqObj == NULL) + { + iGeoTaggingPendingReqObj = CGeoTagger::NewL( this, NULL ); + } + iGeoTaggingPendingReqObj->CreateGeoTagsL((TConnectionOption)(aMessage.Int0())); + } + } + else + { + LOG("Server busy\n"); + aMessage.Complete(KErrServerBusy); + } +#else + aMessage.Complete(KErrNotSupported); +#endif //LOC_REVERSEGEOCODE + } + + +// ---------------------------------------------------------------------------- +// CLocationManagerServer::GetCurrentRegisterNw() +// ---------------------------------------------------------------------------- +RMobilePhone::TMobilePhoneNetworkInfoV2& CLocationManagerServer::GetCurrentRegisterNw() + { + LOG( "CLocationManagerServer::GetCurrentRegisterNw ,begin" ); + return iLocationRecord->GetCurrentRegisteredNw(); + } + +// ---------------------------------------------------------------------------- +// CLocationManagerServer::RetrieveHomeNetwork() +// ---------------------------------------------------------------------------- +void CLocationManagerServer::RetrieveHomeNetwork() + { + LOG("CLocationManagerServer::RetrieveHomeNetwork ,begin"); + if(iHomeNwInfoAvailableFlag) + { + RMobilePhone::TMobilePhoneNetworkInfoV1Pckg homeNetworkPckg( iHomeNetwork ); + + TRequestStatus status( KErrNone ); + + iPhone.GetHomeNetwork(status, homeNetworkPckg); + User::WaitForRequest( status ); + if(status.Int() == KErrNone) + { + iHomeNwInfoAvailableFlag = ETrue; + } + } + LOG("CLocationManagerServer::RetrieveHomeNetwork ,end"); + } + +// ---------------------------------------------------------------------------- +// CLocationManagerServer::GetHomeNetworkInfo() +// ---------------------------------------------------------------------------- +const RMobilePhone::TMobilePhoneNetworkInfoV1& + CLocationManagerServer::GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) + { + LOG("CLocationManagerServer::RetrieveHomeNetwork ,begin"); + if(!iHomeNwInfoAvailableFlag) + { + RetrieveHomeNetwork(); + } + aHomeNwInfoAvailableFlag = iHomeNwInfoAvailableFlag; + return iHomeNetwork; + } + + +// ---------------------------------------------------------------------------- +// CLocationManagerServer::IsRegisteredAtHomeNetwork() +// ---------------------------------------------------------------------------- +TBool CLocationManagerServer::IsRegisteredAtHomeNetwork() + { + LOG( "CLocationManagerServer::IsRegisteredAtHomeNetwork" ); + return (iNwRegistrationStatusHandler && + (iNwRegistrationStatusHandler->GetNetworkRegistrationStatus() + == RMobilePhone::ERegisteredOnHomeNetwork)); + } + // End of file diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/server/src/clocationmanagersession.cpp --- a/locationmanager/server/src/clocationmanagersession.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/server/src/clocationmanagersession.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -48,7 +48,12 @@ CLocationManagerSession::~CLocationManagerSession() { LOG( "CLocationManagerSession::~CLocationManagerSession(), begin" ); - TRAP_IGNORE(Server().StopGPSPositioningL()); + // don't call stop GPS positioning from here... + // we are expecting the application to start and stop else on server terminate, we will do the same. + // this is not okay when user takes a photograph and then transfer photo using BT/PC . + // at this point, it will stop the trail for camera where as camera session is still valid. + // DON"T CALL StopGPSPositioningL METHOD. +// TRAP_IGNORE(Server().StopGPSPositioningL()); Server().CancelNotificationRequest( iNotificationHandle ); Server().CancelLocationRequest( iLocationHandle ); Server().CancelTrackLogNotificationRequest( iTrackLogNotificationHandle ); @@ -86,22 +91,15 @@ // void CLocationManagerSession::ServiceL( const RMessage2& aMessage ) { - LOG( "CLocationManagerSession::ServiceL" ); - _LIT( KSemaphore, "LocManSynchSemaphore" ); - RSemaphore semaphore; - const TInt result = semaphore.OpenGlobal( KSemaphore ); - LOG1( "CLocationManagerSession::ServiceL - semaphore open result: %d", result ); + LOG( "CLocationManagerSession::ServiceL, begin" ); + LOG1("Message id - %d", aMessage.Function()); iMessage = RMessage2( aMessage ); - if ( result == KErrNone ) - { - semaphore.Signal(); - semaphore.Close(); - } TRAPD( err, DispatchMessageL( aMessage ) ); if ( err != KErrNone ) { aMessage.Complete( err ); } + LOG( "CLocationManagerSession::ServiceL, end" ); } // -------------------------------------------------------------------------- @@ -180,6 +178,18 @@ case ELocManCancelTrackLogNotify: CancelTrackLogNotificationRequest( aMessage ); break; + case ELocManTagPending: + Server().TagPendingRequestL(aMessage); + break; + case ELocManStartGeoTaging: + Server().StartGeoTaggingL(aMessage); + break; + case ELocManCancelTagPendingReq: + Server().CancelTagPendingRequest(aMessage); + break; + case ELocManCancelGeoTaggingReq: + Server().CancelGeoTaggingRequest(aMessage); + break; default: aMessage.Complete( KErrArgument ); break; @@ -494,7 +504,7 @@ } // -------------------------------------------------------------------------- -// CLocationManagerSession::GpsQualityChange +// CLocationManagerSession::RegisterTrackLogObserver // -------------------------------------------------------------------------- // void CLocationManagerSession::RegisterTrackLogObserver( const RMessage2& aMessage ) @@ -503,6 +513,11 @@ TRAP_IGNORE( Server().AddTrackLogNotificationRequestL( aMessage ) ); } + +// -------------------------------------------------------------------------- +// CLocationManagerSession::GetCaptureSettingL +// -------------------------------------------------------------------------- +// void CLocationManagerSession::GetCaptureSettingL( const RMessage2& aMessage ) { TInt KParamCaptureSetting = 0; diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/server/src/clocationservertimerhandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/server/src/clocationservertimerhandler.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,108 @@ +/* +* Copyright (c) 2009-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: Implements helper class to handle location server tiimer related functionality +* +*/ + +#include "clocationservertimerhandler.h" +#include "locationmanagerdebug.h" + + + +// -------------------------------------------------------------------------- +// CLocationServerTimerHandler::CLocationServerTimerHandler +// -------------------------------------------------------------------------- +// +CLocationServerTimerHandler::CLocationServerTimerHandler + (MLocationServerTimerObserver& aLocationServerTimerObserver): + CTimer(EPriorityStandard ), + iLocationServerTimerObserver(aLocationServerTimerObserver), + iLocationServerTimerType(MLocationServerTimerObserver::ELocGeneralPurpose) + { + } + +// -------------------------------------------------------------------------- +// CLocationServerTimerHandler::~CLocationServerTimerHandler +// -------------------------------------------------------------------------- +// +CLocationServerTimerHandler::~CLocationServerTimerHandler() + { + LOG ("CLocationServerTimerHandler::~CLocationServerTimerHandler(), begin"); + Cancel(); + LOG ("CLocationServerTimerHandler::~CLocationServerTimerHandler(), end"); + } + +// -------------------------------------------------------------------------- +// CLocationServerTimerHandler::NewL +// -------------------------------------------------------------------------- +// +CLocationServerTimerHandler* CLocationServerTimerHandler::NewL(MLocationServerTimerObserver& aLocationServerTimerObserver) + { + CLocationServerTimerHandler* self = + new( ELeave ) CLocationServerTimerHandler(aLocationServerTimerObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + + +// -------------------------------------------------------------------------- +// CLocationServerTimerHandler::ConstructL +// -------------------------------------------------------------------------- +// +void CLocationServerTimerHandler::ConstructL() + { + LOG ("CLocationServerTimerHandler::ConstructL(), begin"); + CActiveScheduler::Add(this); + CTimer::ConstructL(); + LOG ("CLocationServerTimerHandler::ConstructL(), end"); + } + +// -------------------------------------------------------------------------- +// CLocationServerTimerHandler::StartTimer +// -------------------------------------------------------------------------- +// +void CLocationServerTimerHandler::StartTimer(const TTimeIntervalMicroSeconds32 anInterval, + const MLocationServerTimerObserver::TLocationServerTimerType aLocationServerTimerType) + { + LOG ("CLocationServerTimerHandler::StartTimer(), begin"); + if(!IsActive()) + { + LOG1("Starting timer of type - %d", aLocationServerTimerType); + // not active. + iLocationServerTimerType = aLocationServerTimerType; + After( anInterval ); + } + LOG ("CLocationServerTimerHandler::StartTimer(), end"); + } + + +// -------------------------------------------------------------------------- +// CLocationServerTimerHandler::RunL +// -------------------------------------------------------------------------- +// +void CLocationServerTimerHandler::RunL( ) + { + LOG ("CLocationServerTimerHandler::RunL(), begin"); + TInt status = iStatus.Int(); + LOG1("Error code - %d", status); + iLocationServerTimerObserver.LocationServerTimerCallBackL + (iLocationServerTimerType,status); + LOG ("CLocationServerTimerHandler::RunL(), end"); + } + + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/server/src/nwregistrationstatushandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/server/src/nwregistrationstatushandler.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2009-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: Network registration status handler +* +*/ + + +#include "nwregistrationstatushandler.h" +#include "locationmanagerdebug.h" + + +// ---------------------------------------------------------------------------- +// CNwRegistrationStatusHandler::CNwRegistrationStatusHandler() +// ---------------------------------------------------------------------------- +CNwRegistrationStatusHandler::CNwRegistrationStatusHandler(RMobilePhone& aMobilePhone): + CActive(EPriorityStandard ), + iMobilePhone(aMobilePhone), + iRegistrationStatus(RMobilePhone::ERegistrationUnknown), + iState(ERegStatusOptStateNone) + { + } + +// ---------------------------------------------------------------------------- +// CNwRegistrationStatusHandler::~CNwRegistrationStatusHandler() +// ---------------------------------------------------------------------------- +CNwRegistrationStatusHandler::~CNwRegistrationStatusHandler() + { + LOG("CNwRegistrationStatusHandler::~CNwRegistrationStatusHandler"); + Cancel(); + } + +// ---------------------------------------------------------------------------- +// CNwRegistrationStatusHandler::NewL() +// ---------------------------------------------------------------------------- +CNwRegistrationStatusHandler* CNwRegistrationStatusHandler::NewL(RMobilePhone& aMobilePhone) + { + LOG("CNwRegistrationStatusHandler::NewL ,begin"); + CNwRegistrationStatusHandler* self = new( ELeave ) CNwRegistrationStatusHandler(aMobilePhone); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ---------------------------------------------------------------------------- +// CNwRegistrationStatusHandler::ConstructL() +// ---------------------------------------------------------------------------- +void CNwRegistrationStatusHandler::ConstructL() + { + LOG("CNwRegistrationStatusHandler::ConstructL ,begin"); + CActiveScheduler::Add(this); + iMobilePhone.GetNetworkRegistrationStatus(iStatus, iRegistrationStatus); + iState = ERegStatusOptStateGet; + SetActive(); + LOG("CNwRegistrationStatusHandler::ConstructL ,end"); + } + + +// ---------------------------------------------------------------------------- +// CNwRegistrationStatusHandler::GetNetworkRegistrationStatus() +// ---------------------------------------------------------------------------- +RMobilePhone::TMobilePhoneRegistrationStatus CNwRegistrationStatusHandler::GetNetworkRegistrationStatus() const + { + return iRegistrationStatus; + } + + +// ---------------------------------------------------------------------------- +// CNwRegistrationStatusHandler::StartNotifier() +// ---------------------------------------------------------------------------- +void CNwRegistrationStatusHandler::StartNotifier() + { + LOG("CNwRegistrationStatusHandler::StartNotifier ,begin"); + if(!IsActive()) + { + iState = ERegStatusOptStateNotify; + iMobilePhone.NotifyNetworkRegistrationStatusChange(iStatus, iRegistrationStatus); + SetActive(); + } + else + { + // already active. + LOG("N/W registration status handler already active"); + } + LOG("CNwRegistrationStatusHandler::StartNotifier ,end"); + } + +// ---------------------------------------------------------------------------- +// CNwRegistrationStatusHandler::RunL() +// ---------------------------------------------------------------------------- +void CNwRegistrationStatusHandler::RunL( ) + { + LOG("CNwRegistrationStatusHandler::RunL"); + LOG1("Status - %d", iStatus.Int()); + StartNotifier(); + } + +// ---------------------------------------------------------------------------- +// CNwRegistrationStatusHandler::DoCancel() +// ---------------------------------------------------------------------------- +void CNwRegistrationStatusHandler::DoCancel( ) + { + LOG("CNwRegistrationStatusHandler::DoCancel"); + switch(iState) + { + case ERegStatusOptStateGet: + { + iMobilePhone.CancelAsyncRequest(EMobilePhoneGetNetworkRegistrationStatus); + break; + } + case ERegStatusOptStateNotify: + { + iMobilePhone.CancelAsyncRequest(EMobilePhoneNotifyNetworkRegistrationStatusChange); + break; + } + default: + // execution shouldn't come over here + LOG1("CNwRegistrationStatusHandler::DoCancel, in wrong state - %d", iState); + break; + } + } + + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/sis/locutildebug.pkg --- a/locationmanager/sis/locutildebug.pkg Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/sis/locutildebug.pkg Thu Jul 22 16:38:01 2010 +0100 @@ -28,7 +28,34 @@ ;:"Nokia" :"Vendor" -"S:\EPOC32\RELEASE\ARMV5\UDEB\locationutilityserver.exe" -"!:\sys\bin\locationutilityserver.exe" -"S:\EPOC32\RELEASE\ARMV5\UDEB\LocationTrail.dll" -"!:\sys\bin\LocationTrail.dll" -"S:\EPOC32\RELEASE\ARMV5\UDEB\locationutility.dll" -"!:\sys\bin\locationutility.dll" -"S:\EPOC32\RELEASE\ARMV5\UDEB\Loc.exe" -"!:\sys\bin\Loc.exe" \ No newline at end of file +"\EPOC32\RELEASE\ARMV5\UDEB\locationutilityserver.exe" -"!:\sys\bin\locationutilityserver.exe" +"\EPOC32\RELEASE\ARMV5\UDEB\LocationTrail.dll" -"!:\sys\bin\LocationTrail.dll" +"\EPOC32\RELEASE\ARMV5\UDEB\locationutility.dll" -"!:\sys\bin\locationutility.dll" +"\EPOC32\RELEASE\ARMV5\UDEB\Loc.exe" -"!:\sys\bin\Loc.exe" + + +; Geo converter +"\EPOC32\RELEASE\ARMV5\UDEB\geoconverter.dll" -"!:\sys\bin\geoconverter.dll" + +;#include "..\inc\locplatsupport.mmh" +;#ifdef _LOC_REVERSEGEOCODE +;MACRO LOC_REVERSEGEOCODE +; Reverse geocode +;"\EPOC32\RELEASE\ARMV5\UDEB\ReverseGeocode.dll" -"!:\sys\bin\ReverseGeocode.dll" + +; Tag creator +;"\EPOC32\RELEASE\ARMV5\UDEB\tagcreator.dll" -"!:\sys\bin\tagcreator.dll" + +; Geo tagger +;"\EPOC32\RELEASE\ARMV5\UDEB\geotagger.dll" -"!:\sys\bin\geotagger.dll" + +; Reverse geocode plugin +;"\epoc32\RELEASE\armv5\UDEB\ReverseGeoCoderPlugin.dll"-"!:\sys\bin\ReverseGeoCoderPlugin.dll" +;"\epoc32\data\z\resource\plugins\reversegeocoderplugin.rsc"-"!:\resource\plugins\reversegeocoderplugin.rsc" + +;#endif + + + +; End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/sis/package.pkg --- a/locationmanager/sis/package.pkg Fri Jun 25 13:56:30 2010 +0100 +++ b/locationmanager/sis/package.pkg Thu Jul 22 16:38:01 2010 +0100 @@ -28,4 +28,7 @@ ;Files "\EPOC32\RELEASE\ARMV5\UREL\LocationTrail.dll" -"c:\sys\bin\LocationTrail.dll" "\EPOC32\RELEASE\ARMV5\UREL\locationmanager.dll" -"c:\sys\bin\locationmanager.dll" -"\EPOC32\RELEASE\ARMV5\UREL\locationmanagerserver.exe" -"c:\sys\bin\locationmanagerserver.exe" \ No newline at end of file +"\EPOC32\RELEASE\ARMV5\UREL\locationmanagerserver.exe" -"c:\sys\bin\locationmanagerserver.exe" + +; End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/sis/package_cellid_reverse_geocode_enabled.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/sis/package_cellid_reverse_geocode_enabled.pkg Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,53 @@ +; +; Copyright (c) 2009 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: +; +;Languages +&EN + +;packet-header (name, uid, major, minor, build, type) +#{"Location Manager Patch"},(0x200071BE), 2, 0, 0, TYPE=SA, RU + +; Localised vendor name +%{"Nokia"} + +; Unique vendor name +:"Nokia" + +;Files +"\EPOC32\RELEASE\ARMV5\UREL\LocationTrail.dll" -"c:\sys\bin\LocationTrail.dll" +"\EPOC32\RELEASE\ARMV5\UREL\locationmanager.dll" -"c:\sys\bin\locationmanager.dll" +"\EPOC32\RELEASE\ARMV5\UREL\locationmanagerserver.exe" -"c:\sys\bin\locationmanagerserver.exe" + +; Reverse geocode +"\EPOC32\RELEASE\ARMV5\UREL\ReverseGeocode.dll" -"c:\sys\bin\ReverseGeocode.dll" + +; Tag creator +"\EPOC32\RELEASE\ARMV5\UREL\tagcreator.dll" -"c:\sys\bin\tagcreator.dll" + +; Geo tagger +"\EPOC32\RELEASE\ARMV5\UREL\geotagger.dll" -"c:\sys\bin\geotagger.dll" + +; Geo converter +"\EPOC32\RELEASE\ARMV5\UREL\geoconverter.dll" -"c:\sys\bin\geoconverter.dll" + + +; Reverse geocode plugin +"\epoc32\RELEASE\armv5\UREL\ReverseGeoCoderPlugin.dll"-"c:\sys\bin\ReverseGeoCoderPlugin.dll" +"\epoc32\data\z\resource\plugins\reversegeocoderplugin.rsc"-"c:\resource\plugins\reversegeocoderplugin.rsc" + + +; End of file + + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/sis/package_cellidenabled.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/sis/package_cellidenabled.pkg Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,39 @@ +; +; Copyright (c) 2009 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: +; +;Languages +&EN + +;packet-header (name, uid, major, minor, build, type) +#{"Location Manager Patch"},(0x200071BE), 2, 0, 0, TYPE=SA, RU + +; Localised vendor name +%{"Nokia"} + +; Unique vendor name +:"Nokia" + +;Files +"\EPOC32\RELEASE\ARMV5\UREL\LocationTrail.dll" -"c:\sys\bin\LocationTrail.dll" +"\EPOC32\RELEASE\ARMV5\UREL\locationmanager.dll" -"c:\sys\bin\locationmanager.dll" +"\EPOC32\RELEASE\ARMV5\UREL\locationmanagerserver.exe" -"c:\sys\bin\locationmanagerserver.exe" + +; Geo converter +"\EPOC32\RELEASE\ARMV5\UREL\geoconverter.dll" -"c:\sys\bin\geoconverter.dll" + + +; End of file + + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/tagcreator/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/tagcreator/group/bld.inf Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file +* +*/ + +PRJ_PLATFORMS + DEFAULT + +PRJ_EXPORTS + +PRJ_MMPFILES +tagcreator.mmp + +PRJ_TESTMMPFILES + +PRJ_TESTEXPORTS + diff -r bf039b7fe409 -r 3d9988ee47f5 locationmanager/tagcreator/group/tagcreator.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationmanager/tagcreator/group/tagcreator.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2005-2009 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: Project definition file +* +*/ + +#include +#include +VERSION 10.0 +TARGET tagcreator.dll +TARGETTYPE DLL +UID 0x1000008d 0x2002701E + +VENDORID VID_DEFAULT +CAPABILITY CAP_GENERAL_DLL + +#if defined(WINSCW) +deffile ../bwincw/tagcreatorwinscw.def +#elif defined(ARMCC) +deffile ../eabi/tagcreatorarm.def +#endif +nostrictdef + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../reversegeocode/inc + + + +SOURCEPATH ../src +SOURCE ctagcreator.cpp + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY mdeclient.lib +LIBRARY estor.lib +LIBRARY platformenv.lib +DEBUGLIBRARY flogger.lib + + +PAGED +BYTEPAIRCOMPRESSTARGET +OPTION ARMCC -O3 -OTime + +// End of file + diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/content_listing_framework_collection_manager_api/tsrc/src/CollectionManagerTestBlocks.cpp --- a/mds_plat/content_listing_framework_collection_manager_api/tsrc/src/CollectionManagerTestBlocks.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/content_listing_framework_collection_manager_api/tsrc/src/CollectionManagerTestBlocks.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -471,6 +471,7 @@ const TInt itemCount( 500 ); CDesCArray* removeItemArray = new (ELeave) CDesCArrayFlat( itemCount ); + CleanupStack::PushL( removeItemArray ); for( TInt i = 0 ; i < itemCount ; ++i ) { @@ -484,12 +485,12 @@ TRAP( error, iCollectionManager->RemoveFromAllCollectionsL( *removeItemArray ) ); if( error != KErrNotSupported && error != KErrNone ) { - delete removeItemArray; + CleanupStack::PopAndDestroy( removeItemArray ); removeItemArray = NULL; return error; } - delete removeItemArray; + CleanupStack::PopAndDestroy( removeItemArray ); removeItemArray = NULL; _LIT( KMsg2, "Exit RemoveFromAllCollectionsL" ); diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/harvester_framework_api/inc/harvesterclient.h --- a/mds_plat/harvester_framework_api/inc/harvesterclient.h Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/harvester_framework_api/inc/harvesterclient.h Thu Jul 22 16:38:01 2010 +0100 @@ -32,6 +32,8 @@ class MHarvesterEventObserver; class CHarvesterRequestActive; class CHarvesterRequestQueue; +class MHarvesterSessionObserver; +class CHarvesterSessionWatcher; // default event interval for MHarvesterEventObserver const TInt KHarvesterEventInterval = 20; @@ -171,6 +173,20 @@ TInt aItemsLeft ) = 0; }; +class MHarvesterSessionObserver + { +public: + + /** + * Called to notify the observer that harvester server has been terminated, + * thus harvester server sessions created are now invalid and new connection + * needs to be established + * NOTE! Cliens still have to call Close() on the session to release client side + * resources. + */ + virtual void HarvesterServerTerminated() = 0; + }; + /** * Harvester client session class which provides also means to: * - Pause/resume the Harvesting framework @@ -284,7 +300,20 @@ RArray &aAlbumIds, TBool aAddLocation, TUid aUid ); - + + /** + * Public method to set observer for notifications about harvester server termination. + * Only one observer at a time is currently supported. + * + * @param aObserver Pointer to the observer + */ + IMPORT_C void AddSessionObserverL( MHarvesterSessionObserver& aObserver ); + + /** + * Public method to remove harvester session observer + */ + IMPORT_C void RemoveSessionObserver(); + /** * Requests a harvest complete event from harvester server. * On return, aURI is the URI of the harvested file. @@ -346,6 +375,11 @@ * Request queue processor. */ CHarvesterRequestQueue* iRequestQueue; + + /** + * Harvester session observer AO. + */ + CHarvesterSessionWatcher* iSessionWatcher; }; #endif // __HARVESTER_CLIENT_H__ diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/harvester_framework_api/inc/harvesterplugin.h --- a/mds_plat/harvester_framework_api/inc/harvesterplugin.h Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/harvester_framework_api/inc/harvesterplugin.h Thu Jul 22 16:38:01 2010 +0100 @@ -208,6 +208,11 @@ */ IMPORT_C void SetHarvesterPluginFactory( CHarvesterPluginFactory& aFactory ); + /** + * Method for checking if the plugin is in idle state + */ + IMPORT_C TBool PluginInIdleState(); + private: /** diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/harvester_framework_api/inc/monitorplugin.h --- a/mds_plat/harvester_framework_api/inc/monitorplugin.h Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/harvester_framework_api/inc/monitorplugin.h Thu Jul 22 16:38:01 2010 +0100 @@ -114,8 +114,8 @@ * { * // Our CMyActiveObjectNotifier notifies us about new file and we notify the Harvester server about it. * // Before this CMyActiveObjectNotifier has filled the need data to aHarvesterData like: - * // aHarvesterData->SetEventType( EHarvesterAdd ); - * // aHarvesterData->SetOrigin( aOrigin ); + * aHarvesterData->SetEventType( EHarvesterAdd ); + * aHarvesterData->SetOrigin( aOrigin ); * iObserver->MonitorEvent( aHarvesterData ); * } */ diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/conf/HarvesterClientTestScripter.cfg --- a/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/conf/HarvesterClientTestScripter.cfg Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/conf/HarvesterClientTestScripter.cfg Thu Jul 22 16:38:01 2010 +0100 @@ -410,3 +410,15 @@ delete test [Endtest] +[Test] +title Harvester Blacklist Test +timeout 180000 +create HarvesterClientTestScripter test +test SetUpBlacklist +test AddFileToBlacklist e:\testing\data\corrupt.jpg +test CheckBlacklist e:\testing\data\corrupt.jpg +test RemoveFileFromBlacklist e:\testing\data\corrupt.jpg +test TearDownBlacklist +delete test +[Endtest] + diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/HarvesterClientTestScripter.mmp --- a/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/HarvesterClientTestScripter.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/HarvesterClientTestScripter.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -34,6 +34,8 @@ USERINCLUDE ../inc USERINCLUDE ../../../../../inc +USERINCLUDE ../../../../../harvester/common/inc/ +USERINCLUDE ../../../../../harvester/blacklistclient/inc/ MW_LAYER_SYSTEMINCLUDE @@ -42,4 +44,7 @@ LIBRARY mdeclient.lib LIBRARY stiftestinterface.lib LIBRARY stiftestengine.lib +LIBRARY harvestercommon.lib +LIBRARY blacklistclient.lib +LIBRARY efsrv.lib diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/HarvesterClientTestScripter.pkg --- a/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/HarvesterClientTestScripter.pkg Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/HarvesterClientTestScripter.pkg Thu Jul 22 16:38:01 2010 +0100 @@ -53,4 +53,5 @@ "..\..\data\mmc\HarvesterTest\MPEG4.3gp" -"E:\testing\data\MPEG4.3gp" "..\..\data\mmc\HarvesterTest\MPEG4.mp4" -"E:\testing\data\MPEG4.mp4" "..\..\data\mmc\HarvesterTest\00001.mp3" -"E:\testing\data\00001.mp3" +"..\..\data\mmc\HarvesterTest\corrupt.jpg" -"E:\testing\data\corrupt.jpg" diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/bld.inf --- a/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/bld.inf Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/group/bld.inf Thu Jul 22 16:38:01 2010 +0100 @@ -51,3 +51,4 @@ ../../data/mmc/HarvesterTest/Temp2.jpg /epoc32/WINSCW/C/Data/Temp2.jpg ../../data/mmc/HarvesterTest/Temp3.jpg /epoc32/WINSCW/C/Data/Temp3.jpg ../../data/mmc/HarvesterTest/00001.mp3 /epoc32/WINSCW/C/Data/00001.mp3 +../../data/mmc/HarvesterTest/corrupt.jpg /epoc32/WINSCW/C/Data/corrupt.jpg diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/inc/HarvesterClientTestScripter.h --- a/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/inc/HarvesterClientTestScripter.h Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/inc/HarvesterClientTestScripter.h Thu Jul 22 16:38:01 2010 +0100 @@ -27,6 +27,8 @@ #include "mdccommon.h" #include "mdesession.h" #include "mdequery.h" +#include "harvestermediaidutil.h" +#include "blacklistclient.h" // CONSTANTS @@ -142,6 +144,11 @@ virtual TInt Results( CStifItemParser& aItem ); virtual TInt AddHarvesterEventObserverL( CStifItemParser& aItem ); virtual TInt RemoveHarvesterEventObserverL( CStifItemParser& aItem ); + virtual TInt SetUpBlacklistL( CStifItemParser& aItem ); + virtual TInt TearDownBlacklistL( CStifItemParser& aItem ); + virtual TInt AddFileToBlacklistL( CStifItemParser& aItem ); + virtual TInt CheckBlacklistL( CStifItemParser& aItem ); + virtual TInt RemoveFileFromBlacklistL( CStifItemParser& aItem ); private: // Data // Status booleans @@ -162,6 +169,10 @@ RArray iObjectIdArray; TFileName iUri; + + RBlacklistClient iBlacklistClient; + CHarvesterMediaIdUtil* iMediaIdUtil; + RFs iFs; }; #endif // HARVESTERCLIENTTESTSCRIPTER_H diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/src/HarvesterClientTestScripterBlocks.cpp --- a/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/src/HarvesterClientTestScripterBlocks.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/harvester_framework_api/tsrc/HarvesterClientTest/src/HarvesterClientTestScripterBlocks.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -77,6 +77,11 @@ ENTRY( "Results", CHarvesterClientTestScripter::Results ), ENTRY( "AddHarvesterEventObserver", CHarvesterClientTestScripter::AddHarvesterEventObserverL ), ENTRY( "RemoveHarvesterEventObserver", CHarvesterClientTestScripter::RemoveHarvesterEventObserverL ), + ENTRY( "SetUpBlacklist", CHarvesterClientTestScripter::SetUpBlacklistL ), + ENTRY( "TearDownBlacklist", CHarvesterClientTestScripter::TearDownBlacklistL ), + ENTRY( "AddFileToBlacklist", CHarvesterClientTestScripter::AddFileToBlacklistL ), + ENTRY( "CheckBlacklist", CHarvesterClientTestScripter::CheckBlacklistL ), + ENTRY( "RemoveFileFromBlacklist", CHarvesterClientTestScripter::RemoveFileFromBlacklistL ), }; const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo ); @@ -489,6 +494,139 @@ } // ----------------------------------------------------------------------------- +// CHarvesterClientTest::SetUpBlacklistL +// ----------------------------------------------------------------------------- +// +TInt CHarvesterClientTestScripter::SetUpBlacklistL( CStifItemParser& /*aItem*/ ) + { + _LIT( KMsg1, "Enter SetUpBlacklistL" ); + iLog->Log( KMsg1 ); + RDebug::Print( KMsg1 ); + + User::LeaveIfError( iBlacklistClient.Connect() ); + iBlacklistClient.LoadBlacklistL(); + iMediaIdUtil = &RMediaIdUtil::GetInstanceL(); + User::LeaveIfError( iFs.Connect() ); + + _LIT( KMsg2, "Exit SetUpBlacklistL" ); + iLog->Log( KMsg2 ); + RDebug::Print( KMsg2 ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CHarvesterClientTest::TearDownBlacklistL +// ----------------------------------------------------------------------------- +// +TInt CHarvesterClientTestScripter::TearDownBlacklistL( CStifItemParser& /*aItem*/ ) + { + _LIT( KMsg1, "Enter TearDownBlacklistL" ); + iLog->Log( KMsg1 ); + RDebug::Print( KMsg1 ); + + iBlacklistClient.CloseDBL(); + iBlacklistClient.Close(); + RMediaIdUtil::ReleaseInstance(); + iMediaIdUtil = NULL; + iFs.Close(); + + _LIT( KMsg2, "Exit TearDownBlacklistL" ); + iLog->Log( KMsg2 ); + RDebug::Print( KMsg2 ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CHarvesterClientTest::AddFileToBlacklistL +// ----------------------------------------------------------------------------- +// +TInt CHarvesterClientTestScripter::AddFileToBlacklistL( CStifItemParser& aItem ) + { + _LIT( KMsg1, "Enter AddFileToBlacklistL" ); + iLog->Log( KMsg1 ); + RDebug::Print( KMsg1 ); + + TPtrC inputFile; + User::LeaveIfError( aItem.GetNextString( inputFile )); + + TUint32 mediaId( 0 ); + TTime modified ( 0 ); + + TRAPD( err, iBlacklistClient.AddL( inputFile, mediaId, modified ) ); + if( err != KErrNone ) + { + return err; + } + + _LIT( KMsg2, "Exit AddFileToBlacklistL" ); + iLog->Log( KMsg2 ); + RDebug::Print( KMsg2 ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CHarvesterClientTest::CheckBlacklistL +// ----------------------------------------------------------------------------- +// +TInt CHarvesterClientTestScripter::CheckBlacklistL( CStifItemParser& aItem ) + { + _LIT( KMsg1, "Enter CheckBlacklistL" ); + iLog->Log( KMsg1 ); + RDebug::Print( KMsg1 ); + + TPtrC inputFile; + User::LeaveIfError( aItem.GetNextString( inputFile )); + + TUint32 mediaId( 0 ); + TTime modified ( 0 ); + + TBool isBlacklisted( EFalse ); + TRAP_IGNORE( isBlacklisted = iBlacklistClient.IsBlacklistedL( inputFile, mediaId, modified ) ); + if( !isBlacklisted ) + { + return KErrNotFound; + } + + _LIT( KMsg2, "Exit CheckBlacklistL" ); + iLog->Log( KMsg2 ); + RDebug::Print( KMsg2 ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CHarvesterClientTest::RemoveFileFromBlacklistL +// ----------------------------------------------------------------------------- +// +TInt CHarvesterClientTestScripter::RemoveFileFromBlacklistL( CStifItemParser& aItem ) + { + _LIT( KMsg1, "Enter CheckBlacklistL" ); + iLog->Log( KMsg1 ); + RDebug::Print( KMsg1 ); + + TPtrC inputFile; + User::LeaveIfError( aItem.GetNextString( inputFile )); + + TUint32 mediaId( 0 ); + TTime modified ( 0 ); + + TRAPD( err, iBlacklistClient.RemoveL( inputFile, mediaId ) ); + if( err != KErrNone ) + { + return err; + } + + _LIT( KMsg2, "Exit CheckBlacklistL" ); + iLog->Log( KMsg2 ); + RDebug::Print( KMsg2 ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- // CHarvesterClientTest::HarvestingUpdated // ----------------------------------------------------------------------------- // diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/harvester_framework_api/tsrc/MonitorPluginTest/conf/MonitorPluginTest.cfg diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/harvester_framework_api/tsrc/data/mmc/HarvesterTest/corrupt.jpg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mds_plat/harvester_framework_api/tsrc/data/mmc/HarvesterTest/corrupt.jpg Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,94 @@ +ZZZZ$Z$$$ZZ$$$$$77$777777777777777777777I77II7I?III?IIII???????+++????????++++++=++++++++++++++++++=++======+======+++++ +ZZZZZZZZ$$ZZ$77777777777III777777I7777IIIIIIIII??IIIIII???????++++???????++++++++++++?????++++++++++========+===~+=+++++ +ZZZZZZ$$$$$$77777$$77I77777777III77IIIIII7IIIII????II????I7$ZZZ$$7I???????++?+++++++++++++++++++++++==+=============++++ +$ZZ77$7$$$$$777777777777I7777IIII77I777III?III??????IDNNMNNNNNDDDNNNDDO7????+++++=++=++++++++=++++====+========~~===++++ +ZZ$$$7777$$$$$777777777777IIIIIIII7IIIIIIIIII?I??+IZNND8NNNMMMMNNNDDDNND8?+??+?++++++++++++++==+=+===++=======~~~====+++ +$$$$$$$$Z$$$$7777777777I7I?II??IIIIII?III???????$DMNN8O8NNNNNNNNMMMMND8DNMD$+++?++==++++++++=======~===========~~======+ +$$$$Z$$$$$$$7777I777IIIIII?IIIIIIIII?????+????ZNND8DDZZDDDDDDDNNNNNNMMMMNNNNNZ?++=====+++++++=====~~==~===~==~=~=~====== +$$$7$$$7$777III777IIIIIIIIIII??III??III???++?$MNNDDD8$O88DDDNMNNNNNNMMMMMMDNMMN7+=====+++++==========~~~~~~~~~~=~======+ +77777777777777IIIII7IIIII????????II?????++++$DN8Z7?+++=++???I$ODNNNMMMMMNNNNNMMM+=+===~==========~==~~~~~~~~~~~~=~====== +$$77777777777I77IIIIIIII????II?III?????++++I8N$I?+======++???I$O8DDNNNMMNNNMNMNMZ+=+==~===~~====~==~~~~~~~~~~~~~~~====== +$$77777777III77IIIIIIII??????I?I????+++++?I8NOI?=~~~~~~~~~==+?I7$ZDNNNNMMMMNNNMNMO+===~~===~~~~~~~~~~~~~~~~~~::~~======= +$$$$$$77II77IIIIIIIIIII?????????????+++++7NM87+=~:~~:~~~~~~==++I7$8DNNNMNMMMMMNMNMO=~=======~~~~~~~:~~~~~~:::::::~~===== +77777$$7IIII?II??II??????????++++??++===$NMNZI+=~~~~~~~~~~~==+?I7$OO8DNMNNNMNNMMNMM$==+++===~===~~~~~~~~:::::::::~~~==== +7II?I7I77III???+????++???????++????+==~+$DMD$I+=======~=====+???I7$ZO8DDNNMMNNMMMMMD???+++++++==~=~~~~=~~~~~:::::~~~==+= +777I777$7II???????++++??????+++???++==+IONM8$I+============+++??II7$ZZODNNNMMMMMMMMM7?I??????+=====~~~~~~~~~~::::~~~===+ +$7777$$ZZ7I7I??++?I?++?++???+++++++===7$DNNO7I++===~~=======++++++?I7$Z8NNNNNMNMNMMM8I7IIII7I+=====~+=~~::::~~~::~~~===+ +ZZZOOZ8OO$7III?II77I?+++++++++=====+=?78DMMZI?=+===~=~=~==++=+++???II7Z8NMMMMMMMNMNMD7$$$I77I????+++?=~~~~~~~::::::~==++ +O8888ZZZ88Z$$$$7777$7?I7?++=+=++====+7$8NMMOI?????+=+===?7$7IIIII77$ZZODNNMMMMMMNNMNN$OZ$7IIII?I??++?+?+=~~:~~:::::===++ +O8DD8OOOOOOOZ$$$$$Z$$$Z$7I++++++====?$Z8MMM87?I77$I++++?$ZOZZZZOZ$OOOOO8NNMMMMMMNNNMMOZ$ZZ$$777I??+??+?+=~~:~~~::::~==== +DDDD88OOOZZZZOOOZZOOOOZ$ZZ7+?+=++=++IOO8DNMDDDI777$ZI+?ZDDZ7$OOO8DMNO$ZODMMMNNNNMMMNMDOZZZZZ$III?I7$7I??=~~~~~~~:~==++++ +888888888OOOO8OZO8OOOZO$7$Z+?+=+++??IZDNNMMOZDIZNDO7I=I8O$I?IOZZZZ???I7O8MMNNMMMMMMMMNOOZZZZZ7$$$77$77I++~:::::~:~====+? +DD8D8O8OOO888OOOZ8D8O88ZZ8+???IZO$???ONNMMMZIIII$Z7?+=7ZZ7??I77$7I++?I7ODMMMMMMMMNNNMMO8OOOZ$7$$$77$777I?=~~~~~~~===+++? +8D88OO88OOO8888OODD888OOO8OZ7$OO$8Z7ZO8NMMN7?+=====+?+I77I?=~~~~~=??I7Z8DMMMMNMMMMMNNMZZZZZ$$777$$$Z$$$7I+==~==~=====++? +8DDDO88888888DDD8DD88DD8O888OZOZ$DO$OO8NMMM$?+====++++?II?+==~~~==?I7$Z8NMMMMNMMMMNNNMZZZZZZ$$Z$$$$ZZZ$7I?==========++?? +DD888D8OO8DDD8ODNDD88DDD8D8D8O8OODOO88DNNMM8I+=~==+++=?II?++====++I7$ZODNMMMNMMNMMNNNM77777I??I???????????++++++???????I +NMMNNNNNDDDND8D88DD8DDDDDD8DD8D8D8DNNNNNNMMD7+++==++++II7I?++==++?7$ZO8NNMMMNNNMMMMMNN88OOOOO$$$$$$$7I??I???++??III7$$7I +NMMNDDNNNDDDD88O88888D8DN8DDDDDDNNNMMNNNMMMMZ7++??I?=?777ZI++=+??I$ZOODNNMMMMMMMMMMMMNDD8O8OOOZZZZZZZ$ZZ$7I7777I7I7$$ZZZ +NNNNNDDNNDDDNDNDD888DD88DDDDDDDDDNNNNNMMMMMMD$II?++?$8NMND7++??II7ZO88DNMMMMMMMMMMMMMMNDDD888OOOOOO8OZ$Z$$$ZZZ$$$$$$$$ZZ +MMNMNDDNNNDDNDDDNDD8DD888D88DDDDNNNMNNNMMMMMNZ7II?==?NNN8ZI??III7$$ZO8DNMMMMMMMMMMMMMMN8OOOOOOOOZOOOZOZZZZOZZZZ$$$$$$ZZ$ +NNNMMNNDDNDDNDDDNND8DDDDDD88DDDDDNDNMMMMNMMMMO7I77?++I7$$77Z7IIII7ZZO8DNNMMMMMMMMMMMMNND888ZOOOZZZOOOOZZZZ$$77777$$ZZOO8 +MNNMNDDDNNNNNDDDDDD8DDNDDDDDDNNDNDDDNMMMNNMMMN7II7I?77$ZOOZ7I??II7ZO8DNNNMMMNNMMMMMMMNNN8OOZOZZZZZZZZZZZZ$$$$$$$$$$ZOOOO +NMMNDNNNNNDDDDDDDNNNNNMNDDDNDNNDD88DNNNNMMMMMMO7I?++IZZZZZ$77II7$$O8DDNNMMMMMMMMMMMMMNND8OOOOZZZOOZZZZZZZZZZZZZOOOZZZZZO +NMMNDNNNNNNDNDDDDNDNNNNNNNNDDDDDD88DNNMMMMMMMMNO$II??$$Z$77$777$ZZ8DDDNNMMMMMMMMMMMMMMDD8ZOO8OZZZ$ZZOOOOZZZZOOOOOOZOOZ$Z +NMMNNNNNNNNNNNNNDNNDDDDDD8D88D8D88O8NDDNMMMMMMMMNO7?+===?I777$ZO88DDDNMMMMMMMMMMMMMMMMND8O$ZZZ$$$$$ZOZOOZZZ$$$Z$$ZZ$ZOZZ +MNNMNNMNNNNNNNNNNNNNNNDDD888888888O8NNNMNNNMMNMMMMNOI++?I77$O88DDDDNNMMMMMMMMMMMMMMMMNNNDOZZZZ$$$$$$ZZZZOZ$$ZZOOO$$ZOZZO +NNMMMNMMMDDNNNNNNNNNDNNDDDDD88O8OOZ$8NNNMMMMMMMMMMMMNZZOO88DDDDDDNMMMNNNMMMNMMMMMMMMNMNNDZOZO8ZOOZZZOOZO8O8OOOOO8OZZZZ$$ +MMMNNNMMNNNDNDNNNNNNNDNNDDDDDD88OZZ$OMNMMMMMMMMMMMMMMMMMMMNNNMMMMMNNNNNNNNNMMMMMMMMMMNNNND88O8OOOOOZOOOO8OZO888888OZZZO8 +NMNNNMNMMMNDNNNNNNNND88DOO8OOZOOZZZ$ZDNMMMMMMMMMMMMMMMMNNMMMMMMNNNNNNDNDDNNMMMNMMMMMMNMMND88OOZZZZZ$OOO88OO8888O8O888OOO +MMMMMMMNMNNNNDDDDDDD8888D8OZZZZZZOZZO8NMMMMMMMMMMMMMMMN$ZO88DNNNDDD88OOO8DNNMMNMMMMNNNNNN8O8O8OOOO8OOOO8OZZZO88OOZOZZZO8 +MMMMMMMMMMNDNNNDD888OOO8OZ8OOOZOZZZZOOONMMNNMMMMMMMMMMMZI7$$OOO888OOZZZZZ8DNMNNNMMMMNNNMMDD8Z$77II7$77$$$$$$$77$7I??7$ZZ +NNMMMMMMMNDDND88D888O8OO8O88OOOOOOOO888NMMMNMMMMMMMMMMMD7II77$ZZZZZZ$$77$Z8NNDNMNNMNDNNMMMN8DD8O8O8OZZ7I77Z$77777$$ZOZ7$ +NNNNNNNNNNNND88DNNDDNNNNNOOOOOOOZOZONDDMMMMMMMMMMMMMMMN8$7III777$$777I7I7$Z8NNNNNNNN88MMMMMNMND888DNZOO8DNZ77II777ZZ$7$O +NNNNNNDNDDD88888D8DNNNNNMDD8O8DD8DNDNNMMMMMMMMMMMMMMMDOZ$7II?I7777IIIII?7$$ODNDDDDDN88MNNMMNNND8OO8NODD8DN8O7II77$Z$$7$O +NNNNNNNNDDDDD888D8NDDDO8NMNMNNNMNNMMNNNMMMMMMMMMMMNDO7I?I????????I?++????I7Z8DDNN88N8DMNMNNMNDDNNNND88ZZOOZZ7II?IZ$ZZ7$$ +NNNNNNNNNDDDD8DDNNDDDND8NMMMMMMNMNNMMMMMMMMNMMMNNZ$$7???++?+????+++++++++?I$O8NDDZ8D8DNNNNMMNDD8OZZZ7III???III7ZZ$ZOZZZ8 +MMNDDNMMNNND8DNDNNNDD8DDNMNDNMMMMNMMMMMMMMMMMM8$7I???=++=++++++++==+==+++I7ZDDDDOZ8D8NNNNNNNNMND8888O7+?I?7$$77$$$$ZOOOO +NMMNNNNMNNNDDDNDDDD8888NMMNDNMMMMMMMMMMMMMMMMMZIII++++++==+=+++++==+++????7Z888DOZ8DDNNNNNNNNMNND88D8$?IIII777$$Z$$$Z$$$ +NNNNNNMNNDDDNDDD8O8O8DDNMNNNNMMMMNNNMMMMMMMNNN7I?+++========++========++??I$8OO88O8DNMNNNNMDDNNMNDDDOO$I$7I??II??I777777 +NNNMNNNND8DDD8DDO8D8DNDNDDNNDDNMNNNMMMMMMMNNNOI+++++=~~=====+====~=====+?I$$8DO88O8NNMNNNDD88DDDNNNN8OO8Z$77Z7?7O777$O$$ +NDNNNDNNND8888O8OO8O8DDDNNDDDNNDNNMMMMMMNDDDO$?+==============~====+++++?I$8O888888MMMNN8ZZZ88DDNMMNND8Z$$IIIIII?IIII??? +NNNMNDMMNM8Z8$ZOOO8OODDDDD888DNNMMMMMMMM8OZZO7++======~~~=======~~==++?+?I$ZOO8D88DND888OZOZ7ZZZO8DNMMMND88888Z77777I?I? +NNNNNDMMNMDDN$ZOZZOOZO88DN888DMMMMMMMMMMOZZ$$?=+===========~=====~===+++?I$ZOO8DDD8OOZ$$$7$$$8DDDDNMNNMMMD8O88OZ$$$OO77$ +NNNNNNMMNNNDNMN8OZZO88O8D88DNMMMMMMMMMMNZ7II?+==========~======~=~===++??7ZOO888O$7$$$$I?IIII$O8DNMMMMMMMMNDD8ODD88888DO +DDNNDDNDDNNNNNNDNDOOOOOOO88MMMMMMMMMMMN8$III+===~=========~~=~~~==~==++?I$$ZZZZOOOZ7I?7$O888DNNNNNNMMMMMMMMNNDD88DNNDO$I +NNNNDDDNNNDNNNNNN88DDD8OZ$MMMMMMMMMMMMND7?++=======+===~~~~~~~~=~~~~~=+??7$$ZOO$7$ZO8DDNNNMMMMMMMMMMMMMMMMMMMD88DDD8888D +DNNNNNNNDDDDDNDDDDD888OZ$8MMMMMMMMMMMNDD87?++=~~=++++=~~~~~~~:~~~~~~===+?7ZZ$ZZODNNMNNDDNNNNMMMMMMMMMMMMMMMMMNMD8888DND8 +DNNNNNNNNND88D8888OZ$ZZZ8NMMMMMMMMMMNNDDDO$I?+===+?++==~~~~~~~~~~~~====?7$ZOO8DDNNNNDDMMMMMMMMMMMMMMMMMMMMMNNNMN888888D8 +NNDDND888OOO888OOOOO88DMMMMMMMMMMMMMNDD8DOOOD87I?I?+=~~~~~~=~~~~~===+I$ZOO8DNNMNNNNMMMMMMMMNMMMMMMMMMMMMMMMNMNMNDOOZOZO8 +NDND888O8888DO888DDDDMMMMMMMMMMMMMMNND88D8DD8888DDD8O7III?++=+==++I$$Z88ODMMNNNMMMMNNMNDNNNNMMMMMMMMMNMMMMMMMNNMMOOOZZ88 +NDDD8D8O8DDDD88888D8MMMMMMMMMMMMMMNDDDDDNNNDD8D8888OOOOOOOOO8OO8OZO8OODMD8NMMMMMMMMNNN8NNNNNMMMMMMMMMMMMMMMMMMMNMDDNDNDD +NNDDDDDD8888OOZOOZZZMMMMMMMMMMMMMNDNDNNDMMD8DD8O8OO8D888888D888888ODMMNDNMNMMMMMMNNNN8NMNNNNMMMMMMMMMMMMMMMMMMMMNNDDDDD8 +MMNDDD888888O8OOOZ$$MMMMMMMMMMMMMNDDNNNDMMDDDNDD8OOO88888D8DDD8DD8DNNNNMMMMMMMMMNNNMD8NMDNNNMMNNDNNNMMMMMMMMMMMMNM8O88D8 +MMMNNNDDD8888888DDDDMMMMMMMMMMMMMNNNMNDNMNNMNMD8D88DDD88DND8NNNDDNDNMMMMMMMMMMMMNNNNDNNDDNN8OODNDDNDNNMMNMMMMNNNMMNOOO88 +MMMNNNNNNDNDDDDDD8DDMMMMMMMMMMMMMNNMMNMMMNMMMNDDDD8DD88NNMNMD8NNDNMMMMMMMMMMMMNNNMNNNMNND88O888NNNNNDNNMMMMMMMNMNNMDOZZZ +MMMMMNNNNNNNNDDDDDDDMMMMMMMMMMMMMMMMMMMMNMMMMMNNNNNMNNNNMMMNNMNNMMMMMMMMMMMMMMMMMMMMMMDNND8O8D8N88DNNMMMMMMMNNNMMMMMNNND +MMMMNNNDDNDNNDDDNNNMMMMMMMMMMMMMMMMMMMMMNMMMMNNNMNNMNNNNMNNNNNMNNMMMMMMMMMMMMMMMMMMMMNNNDDO888O888DNMMMMMMMMNNNNNMNMMMNN +MMMNDD8D8888OOOO8DNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMNMMMMMNNNMNNNMMMMNMMMMMMMMMMMMMMMMNDND888888DNDNMMMNMMMMMMMNNNNNNMMD88 +MMD8888OOOO88OO88DNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNMMMMMMMMMMMMMMMMMMMMMMNDDDDD8ODDDNMMMMMMMMMMMMMNNNDNMMMMN88 +MD8D888888OOOOOO8NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNMMMMMMMMMMMMMMMMMMMMMMNNNDNND888DMMMNMMMMMMMMMMMMNNNNNNNNMDO +88DDD88888OOO888MMNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMNNMMMMMMMMMMMMMMMMMMMMNMNNNNDDNNDNNNMMNMMMMMMMMMMMMMMNNNNNMNNMN8 +DDDDDDDDDD888DDNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMNNNNDNNNNNMMMMMMMMMMMMMMMMMMMNNNNNNNMMNN +NMMMMMMNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMNMMMMMMMMMMMMNNNNMMMNNNN +MMMNNMNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNMMNMMMMMMMMMMMMMMMMMMMMMMMNNNMMMMMMN +NMMMMMNNNNMMMMMMMMMMMMMMMNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNMNNMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNMMMN +NMMMNNMMMMMMMMMMMMMMMMMMMNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMNNNMNNNMMMNNNM +NNMMMMMMMMMMMMMMMMMMMMNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMNMMMMMMMMMMMMMMMNNMMNNMMMNNNN +NMMMMMMMMMMMMMMMMMMMMMMMNNNMMMMMMMMMMMMMMMMMMMMMMMMMMNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMNMMMMMMNNN +NMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMNMMNMMMMNN +NMMNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNMMMMMMMMMMMMMMMNNMNN +NMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNMMMMMMMMMMMMMMMMMMMNN +NMMMMMMMMMMMMMMNNMMMNDDDNMMMMMMMMNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNMMNMNNMNM +MMMMMMMMMMMMMNNND88NMMMMNDDMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNMMMMNN +NMMMMMMMMMMNNNNNDDMMDDDNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNMMMMMMMMMNMMNNNMNNNNNNNNN +MMMMMMMMMMMMMMNNNMNODNND88NODD8DMNMND8OODDNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNNNMNNN +NMMMMMMMMMMMMMDDNDOOMMND8N8DDODMN8O$III77$Z8DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNMNNNNNNMM +NMMMMMMMMMMMMN8NDNNNNDONMNNO8MDZ8IIIIIII77$$$7ZODNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNMNNMNNN +MMMMMMMMMMMMMNMDDMNMODMM8DNMMNOD$777IIII777777$$$$77$DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNMMNNMNN +NMMMMMMMMMMMMNDNMNN8MMMNMNMNMD88$$777777777777777$$77$$8NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNMMMNNNNN +NMMMMMMMMMMMMMMMMMDNNMMNMDMNMNNDZ$$$$$$$$7777777777$$$$$ZZZZNMMMMMMNNMMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMMMMMMMNNNMNNNNNNN +NMMMMMMMMMMMMMMMMNNNMMNNNDMMNNM8ZZZZZ$$Z$$777777$$77$$$$77$$Z8NMMMMMNMMMMMMMMMMMMMMMMMMMMMMNMMNMMMMMMMMNMMMMNNNNNNNNMMNN +NNNMMMMMMMMMMMMMMMMMMMNMMMMMNNMND8888OOZZ$$$$$$7777777777777$$ZO88MNMNMMMMMMMMNNNDD8O8NNMMNNNMMMNMMMMMMNNMNNMNNNNNNNNNNN +NMMMMMMMMMMMMMMMMMMMMMMMMMMMMNMMMDDNDD88ZZZ$$$$$7$$$$77$ZZ$7III$8NDNNMN8ZO8O88NMND888NNND8O88NNMMMMMMMMNMMNNNNNNNNNNNNNN +NNNNMMMMMMMMMMMMMMMMMMMMMMNMMMMMMMMMMNN8ZZZZZ$$$$Z$$$$$ZODD8777$7$D88D8OZZO8DD8O88DND88DNNNNNNNMMMMMMMMMMMNMMNMNNNMMMNNN +NMNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMD888OOZZZZZ$$ZZZZ$$ZZ8NNOZ$$$$DDDDDNDOODDDDDDDDDDD8DNNDNNNNNMMMMMMMMMMMMMNNNNNNNMMNN \ No newline at end of file diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/group/bld.inf --- a/mds_plat/location_manager_api/group/bld.inf Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/location_manager_api/group/bld.inf Thu Jul 22 16:38:01 2010 +0100 @@ -16,6 +16,7 @@ */ #include +#include "../../../locationmanager/inc/locplatsupport.mmh" PRJ_PLATFORMS DEFAULT @@ -28,6 +29,11 @@ ../inc/rlocationobjectmanipulator.h MW_LAYER_PLATFORM_EXPORT_PATH(rlocationobjectmanipulator.h) ../inc/locationdatatype.h MW_LAYER_PLATFORM_EXPORT_PATH(locationdatatype.h) ../inc/locationeventdef.h MW_LAYER_PLATFORM_EXPORT_PATH(locationeventdef.h) +../inc/geotagobserver.h MW_LAYER_PLATFORM_EXPORT_PATH(geotagobserver.h) +../inc/rlocationgeotagger.h MW_LAYER_PLATFORM_EXPORT_PATH(rlocationgeotagger.h) +#ifdef _LOC_REVERSEGEOCODE +../inc/geotagger.h MW_LAYER_PLATFORM_EXPORT_PATH(geotagger.h) +#endif PRJ_MMPFILES diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/inc/geotagger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mds_plat/location_manager_api/inc/geotagger.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2009 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: A class responsible for geotagging of media files in background. +* +*/ + +#ifndef GEOTAGGER_H_ +#define GEOTAGGER_H_ + +#include +#include +#include +#include + + +/** + * GeoTagger converts a given cell ID(CGI Info) to geo-coordinates. + * Does reverse geocoding to get country and city name. + * Creates country and city tag for image/video files. + * @since S60 9.2 + */ + +class CGeoTagger : public CBase + { +public: + /** + * 2-phased constructor. + */ + IMPORT_C static CGeoTagger* NewL(MGeoTaggerObserver* aObserver, CMdESession* aMdeSession = NULL ); + +public: //exported API + /** + * Harvests location tags. + * @param aObserver, observer for geotagging. + * @return None. + */ + virtual void CreateGeoTagsL( const TConnectionOption = ESilent ) = 0; + + /** + * Is there any untagged photos with location info?. + * @return None. + */ + virtual void PendingGeoTagsL( TBool aTagInProgress ) = 0; + }; + +#endif // GEOTAGGER_H_ + +// End of file. + diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/inc/geotagobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mds_plat/location_manager_api/inc/geotagobserver.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 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: A class responsible for geotagging of media files in background. +* +*/ + +#ifndef GEOTAGOBSERVER_H_ +#define GEOTAGOBSERVER_H_ + +#include +#include +#include + +enum TConnectionOption + { + ESilent=0, + EInteractive + }; + +typedef enum + { + EGeoTaggingPending = 0x01, + EGeoTaggingGoingOn, + EGeoTagCmpt + }TGeoTaggingSatus; + + +class MGeoTaggerObserver + { +public: + /** + * This method is used for notifying completion of geotagging + */ + virtual void GeoTaggingCompleted( const TInt aError ) = 0; + + /** + * This method is used for notifying completion of query for pending geo tags + */ + virtual void PendingGeoTagReqComplete( const TInt aError ) = 0; + + /* + * Get registrer network country code + * + * @return current register n/w info + */ + virtual RMobilePhone::TMobilePhoneNetworkInfoV2& GetCurrentRegisterNw() = 0; + + /* + * UE is registered to home network? + * + * @return ETrue if UE is registered at home network else EFalse + */ + virtual TBool IsRegisteredAtHomeNetwork() = 0; + + /* + * Get home network country code + * @param aHomeNwInfoAvailableFlag ETrue if home n/w info available else EFalse + * @return user home n/w info + */ + virtual const RMobilePhone::TMobilePhoneNetworkInfoV1& + GetHomeNetworkInfo(TBool& aHomeNwInfoAvailableFlag) = 0; + + }; + + +#endif // GEOTAGOBSERVER_H_ + +// End of file. diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/inc/locationdatatype.h --- a/mds_plat/location_manager_api/inc/locationdatatype.h Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/location_manager_api/inc/locationdatatype.h Thu Jul 22 16:38:01 2010 +0100 @@ -20,6 +20,8 @@ #include #include +const TInt KMaxCountryName = 128; +typedef TBuf TCountryName; /* * TLocationData encapsulates all location data. */ @@ -28,7 +30,7 @@ TPosition iPosition; CTelephony::TNetworkInfoV1 iNetworkInfo; TCourse iCourse; - TBuf<100> iCountry; + TCountryName iCountry; TUint iSatellites; TReal32 iQuality; }; diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/inc/rlocationgeotagger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mds_plat/location_manager_api/inc/rlocationgeotagger.h Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2006-2009 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: An interface to Location Trail. +* +*/ + +#ifndef R_RLOCATIONGEOTAGGER_H +#define R_RLOCATIONGEOTAGGER_H + +#include +#include +#include +#include +#include +#include + + +/** + * RLocationManager class is used for creating a Location Manager session. + * Location Manager is used to start and stop the location trail, retrieve + * location information and write the location information to images. + * + * @lib LocationManager.lib + * @since S60 9.2 + */ +NONSHARABLE_CLASS( RLocationGeoTagger ) : public RLocationManager + { +public: + +public: + IMPORT_C RLocationGeoTagger(); + + IMPORT_C ~RLocationGeoTagger(); + + + /** + * Is there any geo tag pending state. (Asynchronous call) + * @param aStatus - request status. + * @param aTagPendingFlag - tag pending flag (ETrue if few entry is yet to be tagged else EFalse) + * @return None + */ + IMPORT_C void GeoTagStaus( TRequestStatus& aStatus, + TGeoTaggingSatus& aTagPendingFlag ); + + /** + * Cancel tag pending request + * @return None + */ + IMPORT_C void CancelTagPendingRequest(); + + /** + * Cancel geo tagging request + * @return None + */ + IMPORT_C void CancelGeoTaggingRequest(); + + /** + * Start geo tagging. + * @param aConnectionOption - connection option (ESilent/EInteractive). + * @return None + */ + IMPORT_C void StartGeoTagging(TRequestStatus& aStatus, const TConnectionOption aConnectionOption ); + +private: + TPckg *iTagPendingData; + }; + +#endif // R_RLOCATIONGEOTAGGER_H + +//End of File diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/tsrc/conf/LocationManagerTestScripter.cfg --- a/mds_plat/location_manager_api/tsrc/conf/LocationManagerTestScripter.cfg Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/location_manager_api/tsrc/conf/LocationManagerTestScripter.cfg Thu Jul 22 16:38:01 2010 +0100 @@ -190,22 +190,8 @@ [Endtest] [Test] -title Tracklog Observer test -timeout 60000 -create LocationManagerTestScripter test -test SetupTrackLog -test AddObserver -test AddObserver -test AddObserver -test RemoveObserver -test RemoveObserver -test TearDownTrackLog -delete test -[Endtest] - -[Test] title Start Stop Tracklog Recording -timeout 60000 +timeout 80000 create LocationManagerTestScripter test test SetupTrackLog test AddObserver @@ -223,8 +209,22 @@ [Endtest] [Test] +title Tracklog Observer test +timeout 60000 +create LocationManagerTestScripter test +test SetupTrackLog +test AddObserver +test AddObserver +test AddObserver +test RemoveObserver +test RemoveObserver +test TearDownTrackLog +delete test +[Endtest] + +[Test] title Start Stop Tracklog Recording 2 -timeout 60000 +timeout 240000 create LocationManagerTestScripter test test SetupTrackLog test AddObserver diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/tsrc/conf/LocationManagerTestScripter_reverse_geocode.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mds_plat/location_manager_api/tsrc/conf/LocationManagerTestScripter_reverse_geocode.cfg Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,345 @@ +# +# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "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: Location Manager API tests +# + +// --------------------------------------------------------------------------- +// Location Manager API test cases +// --------------------------------------------------------------------------- + +// These should be run in sequential mode if several cases are run at the same +// time! + +[StifSettings] +TestThreadStackSize= 32768 +TestThreadMinHeap= 4096 +TestThreadMaxHeap= 16777216 +[EndStifSettings] + +[Test] +title Location Manager Connect Disconnect +timeout 60000 +create LocationManagerTestScripter test +test Connect +test Close +delete test +[Endtest] + +[Test] +title Location Trail Connect Disconnect +timeout 60000 +create LocationManagerTestScripter test +test TrailConnect +test TrailClose +delete test +[Endtest] + +[Test] +title Start-Stop Location Trail +timeout 60000 +create LocationManagerTestScripter test +test TrailConnect +test StartTrailTests +test TrailClose +delete test +[Endtest] + +[Test] +title Get Location Trail State +timeout 60000 +create LocationManagerTestScripter test +test TrailConnect +test StartTrail +test GetTrailState +test StopTrail +test TrailClose +delete test +[Endtest] + +[Test] +title Location Trail Notification Basic Test +timeout 60000 +create LocationManagerTestScripter test +test TrailConnect +test StartTrail +test LocationTrailNotifyTest +test StopTrail +test TrailClose +delete test +[Endtest] + +[Test] +title Retrieve Location Basic Test +timeout 60000 +create LocationManagerTestScripter test +test TrailConnect +test StartTrail +test RetrieveLocation +test StopTrail +test TrailClose +delete test +[Endtest] + +[Test] +title Current Location Basic Test +timeout 60000 +create LocationManagerTestScripter test +test TrailConnect +test StartTrail +test CurrentLocation +test StopTrail +test TrailClose +delete test +[Endtest] + +[Test] +title Create Location Object Manipulator +timeout 60000 +create LocationManagerTestScripter test +request Session +test PrepareSession +wait Session +test TearDownOM +delete test +[Endtest] + +[Test] +title Create Location Object +timeout 60000 +create LocationManagerTestScripter test +request Session +test PrepareSession +wait Session +test SetupOM +test TearDownOM +delete test +[Endtest] + +[Test] +title Location Snapshot +timeout 60000 +create LocationManagerTestScripter test +request Session +test PrepareSession +wait Session +test SetupOM +test TearDownOM +delete test +[Endtest] + +[Test] +title Remove Location Object +timeout 60000 +create LocationManagerTestScripter test +request Session +test PrepareSession +wait Session +test SetupOM +test TearDownOM +delete test +[Endtest] + +[Test] +title Copy By ID +timeout 60000 +create LocationManagerTestScripter test +request Session +test PrepareSession +wait Session +test SetupOM +test CopyByID +test CloseOM +test CopyByIDDisco +test TearDownOM +delete test +[Endtest] + +[Test] +title Copy By URI +timeout 60000 +create LocationManagerTestScripter test +request Session +test PrepareSession +wait Session +test SetupOM +test CopyByURI +test CloseOM +test CopyByURIDisco +test TearDownOM +delete test +[Endtest] + +[Test] +title Tracklog Connect Disconnect +timeout 60000 +create LocationManagerTestScripter test +test SetupTrackLog +test TearDownTrackLog +delete test +[Endtest] + +[Test] +title Start Stop Tracklog Recording +timeout 80000 +create LocationManagerTestScripter test +test SetupTrackLog +test AddObserver +request Recording +test StartTrackLog +wait Recording +test Recording +request StopRecording +test StopTrackLog +wait StopRecording +test NotRecording +test RemoveObserver +test TearDownTrackLog +delete test +[Endtest] + +[Test] +title Tracklog Observer test +timeout 60000 +create LocationManagerTestScripter test +test SetupTrackLog +test AddObserver +test AddObserver +test AddObserver +test RemoveObserver +test RemoveObserver +test TearDownTrackLog +delete test +[Endtest] + +[Test] +title Start Stop Tracklog Recording 2 +timeout 240000 +create LocationManagerTestScripter test +test SetupTrackLog +test AddObserver +request Recording +test StartTrackLog +wait Recording +test Recording +test GetFile +test GetStatus +request StopRecording +test StopTrackLog +wait StopRecording +test NotRecording +test DeleteFile +test GetStatus2 +test RemoveObserver +test TearDownTrackLog +delete test +[Endtest] + +[Test] +title Tracklog Crash Test +timeout 60000 +create LocationManagerTestScripter test +test SetupTrackLog +test AddObserver +request Recording +test StartTrackLog +wait Recording +test CrashLocationManager +test RemoveObserver +test TearDownTrackLog +delete test +create LocationManagerTestScripter test2 +test2 SetupTrackLog +test2 AddObserver +request Recording +test2 StartTrackLog +wait Recording +test2 StopTrackLog +test2 RemoveObserver +test2 TearDownTrackLog +delete test2 +[Endtest] + +[Test] +title StartGeoTagging Test +create LocationManagerTestScripter test +#test ConnectGeoTaggerL +test StartGeoTaggingL +test CloseGeoTaggerL +delete test +[Endtest] + + +[Test] +title TagComplete Status for GeoTagged Photos +create LocationManagerTestScripter test +test ConnectGeoTaggerL +test TestGeoTagCompleteStatusL 0 +test CloseGeoTaggerL +delete test +[Endtest] + +[Test] +title TagPending Status for GeoTagged Photos +create LocationManagerTestScripter test +test ConnectGeoTaggerL +test TestGeoTagPendingStatusL 0 +test CloseGeoTaggerL +delete test +[Endtest] + +[Test] +title TagGoingOn Status for GeoTagged Photos +create LocationManagerTestScripter test +test ConnectGeoTaggerL +test TestGeoTagGoingOnStatusL 0 +test CloseGeoTaggerL +delete test +[Endtest] + + +[Test] +title TagComplete Status for NonGeoTagged Photos +create LocationManagerTestScripter test +test ConnectGeoTaggerL +test TestGeoTagCompleteStatusL 1 +test CloseGeoTaggerL +delete test +[Endtest] + +[Test] +title TagPending Status for NonGeoTagged Photos +create LocationManagerTestScripter test +test ConnectGeoTaggerL +test TestGeoTagPendingStatusL 1 +test CloseGeoTaggerL +delete test +[Endtest] + +[Test] +title TagGoingOn Status for NonGeoTagged Photos +create LocationManagerTestScripter test +test ConnectGeoTaggerL +test TestGeoTagGoingOnStatusL 1 +test CloseGeoTaggerL +delete test +[Endtest] + +[Test] +title CancelGeoTagging +create LocationManagerTestScripter test +test ConnectGeoTaggerL +test CancelGeoTaggingL +test CloseGeoTaggerL +delete test +[Endtest] \ No newline at end of file diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/tsrc/group/LocationManagerTestScripter.mmp --- a/mds_plat/location_manager_api/tsrc/group/LocationManagerTestScripter.mmp Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/location_manager_api/tsrc/group/LocationManagerTestScripter.mmp Thu Jul 22 16:38:01 2010 +0100 @@ -18,6 +18,7 @@ #include #include +#include "../../../../locationmanager/inc/locplatsupport.mmh" TARGET LocationManagerTestScripter.dll TARGETTYPE dll @@ -28,6 +29,11 @@ DEFFILE LocationManagerTestScripter.DEF +#ifdef _LOC_REVERSEGEOCODE +MACRO LOC_REVERSEGEOCODE +#endif + + SOURCEPATH ../src SOURCE LocationManagerTestScripter.cpp SOURCE LocationManagerTestScripterBlocks.cpp diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/tsrc/group/bld.inf --- a/mds_plat/location_manager_api/tsrc/group/bld.inf Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/location_manager_api/tsrc/group/bld.inf Thu Jul 22 16:38:01 2010 +0100 @@ -15,6 +15,8 @@ * */ +#include "../../../../locationmanager/inc/locplatsupport.mmh" + PRJ_PLATFORMS DEFAULT @@ -26,5 +28,10 @@ LocationManagerTestScripter.mmp PRJ_TESTEXPORTS +#ifdef _LOC_REVERSEGEOCODE +../conf/LocationManagerTestScripter_reverse_geocode.cfg /epoc32/winscw/c/TestFramework/LocationManagerTestScripter.cfg +#else ../conf/LocationManagerTestScripter.cfg /epoc32/winscw/c/TestFramework/LocationManagerTestScripter.cfg +#endif + ../init/LocationManagerTestScripter.ini /epoc32/winscw/c/TestFramework/LocationManagerTestScripter.ini diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/tsrc/inc/LocationManagerTestScripter.h --- a/mds_plat/location_manager_api/tsrc/inc/LocationManagerTestScripter.h Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/location_manager_api/tsrc/inc/LocationManagerTestScripter.h Thu Jul 22 16:38:01 2010 +0100 @@ -31,6 +31,10 @@ #include "mdccommon.h" #include "mdesession.h" +#ifdef LOC_REVERSEGEOCODE +#include "RLocationGeoTagger.h" +#endif //LOC_REVERSEGEOCODE + // CONSTANTS // Logging path _LIT( KLocationManagerTestScripterLogPath, "\\logs\\testframework\\LocationManagerTestScripter\\" ); @@ -136,7 +140,19 @@ TInt GetStatus2L( CStifItemParser& aItem ); //ADD NEW METHOD DEC HERE //[TestMethods] - Do not remove - + +#ifdef LOC_REVERSEGEOCODE + TInt ConnectGeoTaggerL( CStifItemParser& /*aItem*/ ); + TInt CloseGeoTaggerL( CStifItemParser& /*aItem*/ ); + TInt StartGeoTaggingL( CStifItemParser& aItem ); + + TInt TestGeoTagCompleteStatusL( CStifItemParser& aItem ); + TInt TestGeoTagPendingStatusL( CStifItemParser& aItem ); + TInt TestGeoTagGoingOnStatusL( CStifItemParser& aItem ); + + TInt CancelGeoTaggingL( CStifItemParser& aItem ) ; +#endif //LOC_REVERSEGEOCODE + public: // From MTrackLogObserver void TrackLogStarted(TInt aError); void TrackLogStopped(TInt aError); @@ -155,7 +171,11 @@ CMdESession* iMdeSession; CActiveSchedulerWait* iASW; - + +#ifdef LOC_REVERSEGEOCODE + RLocationGeoTagger iLocationGeoTagger; + TBool iLocGeoTaggerConnected; +#endif //LOC_REVERSEGEOCODE }; #endif // LOCATIONMANAGERTESTSCRIPTER_H diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/tsrc/src/LocationManagerTestScripter.cpp --- a/mds_plat/location_manager_api/tsrc/src/LocationManagerTestScripter.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/location_manager_api/tsrc/src/LocationManagerTestScripter.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -43,6 +43,11 @@ // void CLocationManagerTestScripter::ConstructL() { + +#ifdef LOC_REVERSEGEOCODE + iLocGeoTaggerConnected = EFalse; +#endif //LOC_REVERSEGEOCODE + //Read logger settings to check whether test case name is to be //appended to log file name. RSettingServer settingServer; diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/tsrc/src/LocationManagerTestScripterBlocks.cpp --- a/mds_plat/location_manager_api/tsrc/src/LocationManagerTestScripterBlocks.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/location_manager_api/tsrc/src/LocationManagerTestScripterBlocks.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -88,9 +88,16 @@ ENTRY( "DeleteFile" , CLocationManagerTestScripter::DeleteFileL ), ENTRY( "GetStatus" , CLocationManagerTestScripter::GetStatusL ), ENTRY( "GetStatus2" , CLocationManagerTestScripter::GetStatus2L ) - //ADD NEW ENTRY HERE - // [test cases entries] - Do not remove +#ifdef LOC_REVERSEGEOCODE + ,ENTRY( "ConnectGeoTaggerL", CLocationManagerTestScripter::ConnectGeoTaggerL ) + ,ENTRY( "CloseGeoTaggerL", CLocationManagerTestScripter::CloseGeoTaggerL ) + ,ENTRY( "StartGeoTaggingL", CLocationManagerTestScripter::StartGeoTaggingL ) + ,ENTRY( "TestGeoTagCompleteStatusL", CLocationManagerTestScripter::TestGeoTagCompleteStatusL ) + ,ENTRY( "TestGeoTagPendingStatusL", CLocationManagerTestScripter::TestGeoTagPendingStatusL ) + ,ENTRY( "TestGeoTagGoingOnStatusL", CLocationManagerTestScripter::TestGeoTagGoingOnStatusL ) + ,ENTRY( "CancelGeoTaggingL", CLocationManagerTestScripter::CancelGeoTaggingL ) +#endif //LOC_REVERSEGEOCODE }; const TInt count = sizeof( KFunctions ) / diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/location_manager_api/tsrc/src/RLocationObjectManipulatorTest.cpp --- a/mds_plat/location_manager_api/tsrc/src/RLocationObjectManipulatorTest.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/location_manager_api/tsrc/src/RLocationObjectManipulatorTest.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -334,5 +334,212 @@ aLocationData.iQuality = 1; } -// End of file + +#ifdef LOC_REVERSEGEOCODE +TInt CLocationManagerTestScripter::ConnectGeoTaggerL( CStifItemParser& /*aItem*/ ) + { + _LIT( KMsg1, "ConnectGeoTaggerL" ); + iLog->Log( KMsg1 ); + RDebug::Print( KMsg1 ); + + if(!iLocGeoTaggerConnected) + { + User::LeaveIfError( iLocationGeoTagger.Connect() ); + } + + iLocGeoTaggerConnected = ETrue; + return KErrNone; + } + +TInt CLocationManagerTestScripter::CloseGeoTaggerL( CStifItemParser& /*aItem*/ ) + { + _LIT( KMsg1, "CloseGeoTaggerL" ); + iLog->Log( KMsg1 ); + RDebug::Print( KMsg1 ); + + iLocationGeoTagger.Close() ; + iLocGeoTaggerConnected = EFalse; + + return KErrNone; + } + + +TInt CLocationManagerTestScripter::StartGeoTaggingL( CStifItemParser& /*aItem*/ ) + { + _LIT( KMsg1, "Enter StartGeoTagging" ); + iLog->Log( KMsg1 ); + RDebug::Print( KMsg1 ); + + //rav + + if(!iLocGeoTaggerConnected) + { + User::LeaveIfError( iLocationGeoTagger.Connect() ); + } + + iLocGeoTaggerConnected = ETrue; + + + + TRequestStatus status(KRequestPending); + TConnectionOption conOption(ESilent); + iLocationGeoTagger.StartGeoTagging(status,conOption); + User::WaitForRequest( status ); + + _LIT( KMsg3, " status.Int() =%d" ); + iLog->Log( KMsg3,status.Int() ); + + TL( status.Int() == KErrNone ); + + + _LIT( KMsg2, "Exit StartGeoTagging" ); + iLog->Log( KMsg2 ); + RDebug::Print( KMsg2 ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CLocationManagerTestScripter::TestGeoTagCompleteStatusL +// ----------------------------------------------------------------------------- +// +TInt CLocationManagerTestScripter::TestGeoTagCompleteStatusL( CStifItemParser& /*aItem*/) + { + _LIT( KMsg1, "TestGeoTagCompleteStatusL enter" ); + iLog->Log( KMsg1 ); + RDebug::Print( KMsg1 ); + + TRequestStatus status = KRequestPending; + TGeoTaggingSatus tagPendingFlag = EGeoTaggingPending; + iLocationGeoTagger.GeoTagStaus( status, tagPendingFlag ); + + User::WaitForRequest( status ); + + TL(status.Int() == KErrNone); + + TL(tagPendingFlag == EGeoTagCmpt); + + _LIT( KMsg2, "TestGeoTagCompleteStatusL exit" ); + iLog->Log( KMsg2 ); + RDebug::Print( KMsg2 ); + return KErrNone; + } + + +// ----------------------------------------------------------------------------- +// CLocationManagerTestScripter::TestGeoTagPendingStatusL +// ----------------------------------------------------------------------------- +// +TInt CLocationManagerTestScripter::TestGeoTagPendingStatusL( CStifItemParser& aItem ) + { + _LIT( KMsg1, "TestGeoTagPendingStatusL enter" ); + iLog->Log( KMsg1 ); + RDebug::Print( KMsg1 ); + + TInt fntype; + aItem.GetNextInt(fntype); + + TRequestStatus status = KRequestPending; + TGeoTaggingSatus tagPendingFlag = EGeoTagCmpt; + iLocationGeoTagger.GeoTagStaus( status, tagPendingFlag ); + + User::WaitForRequest( status ); + + TL(status.Int() == KErrNone); + + if(fntype == 0 ) + { + //for geotagged photos the tag status will be pending + TL(tagPendingFlag == EGeoTaggingPending); + } + else + { + //for geotagged photos the tag status will be pending + TL(tagPendingFlag == EGeoTagCmpt); + } + + _LIT( KMsg2, "TestGeoTagPendingStatusL exit" ); + iLog->Log( KMsg2 ); + RDebug::Print( KMsg2 ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CLocationManagerTestScripter::TestGeoTagGoingOnStatusL +// ----------------------------------------------------------------------------- +// +TInt CLocationManagerTestScripter::TestGeoTagGoingOnStatusL( CStifItemParser& aItem ) + { + _LIT( KMsg1, "TestGeoTagGoingOnStatusL enter" ); + iLog->Log( KMsg1 ); + RDebug::Print( KMsg1 ); + + TInt fntype; + aItem.GetNextInt(fntype); + + + TRequestStatus status = KRequestPending; + TGeoTaggingSatus tagPendingFlag = EGeoTagCmpt; + iLocationGeoTagger.GeoTagStaus( status, tagPendingFlag ); + + User::WaitForRequest( status ); + + TL(status.Int() == KErrNone); + + if(fntype == 0 ) + { + if(tagPendingFlag == EGeoTaggingPending) + { + TConnectionOption conOption(ESilent); + status = KRequestPending; + iLocationGeoTagger.StartGeoTagging(status,conOption); + iLocationGeoTagger.GeoTagStaus( status, tagPendingFlag ); + + TL(tagPendingFlag == EGeoTaggingGoingOn); + + User::WaitForRequest( status ); + + TL(status.Int() == KErrNone); + } + } + else + { + TL(tagPendingFlag == EGeoTagCmpt); + } + + _LIT( KMsg2, "TestGeoTagGoingOnStatusL exit" ); + iLog->Log( KMsg2 ); + RDebug::Print( KMsg2 ); + + return KErrNone; + } + + +TInt CLocationManagerTestScripter::CancelGeoTaggingL( CStifItemParser& /*aItem*/ ) + { + _LIT( KMsg1, "Enter CancelGeoTaggingL" ); + iLog->Log( KMsg1 ); + RDebug::Print( KMsg1 ); + + TRequestStatus status(KRequestPending); + TConnectionOption conOption(ESilent); + iLocationGeoTagger.StartGeoTagging(status,conOption); + iLocationGeoTagger.CancelGeoTaggingRequest(); + + User::WaitForRequest( status ); + + TL(status.Int() == KErrNone); + + + _LIT( KMsg2, "CancelGeoTaggingL exit" ); + iLog->Log( KMsg2 ); + RDebug::Print( KMsg2 ); + + return KErrNone; + + } +#endif //LOC_REVERSEGEOCODE + + // End of file diff -r bf039b7fe409 -r 3d9988ee47f5 mds_plat/metadata_engine_api/inc/mdeconstants.h --- a/mds_plat/metadata_engine_api/inc/mdeconstants.h Fri Jun 25 13:56:30 2010 +0100 +++ b/mds_plat/metadata_engine_api/inc/mdeconstants.h Thu Jul 22 16:38:01 2010 +0100 @@ -35,6 +35,7 @@ _LIT( KItemTypeProperty, "ItemType" ); _LIT( KTitleProperty, "Title" ); _LIT( KTimeOffsetProperty, "TimeOffset" ); + _LIT( KInDefaultFolder, "InDefaultFolder" ); enum TOrigin { @@ -129,6 +130,12 @@ { _LIT( KTagObject, "Tag" ); _LIT( KTagItemType, "application/vnd.nokia.mde.tag" ); + enum TTagType + { + EUserDefineTags = 0, + ESystemDefineCityTags = 1, + ESystemDefineCountryTags = 2 + }; } namespace MediaObject diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/client/src/mdeobject.cpp --- a/metadataengine/client/src/mdeobject.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/client/src/mdeobject.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -122,7 +122,7 @@ } CMdEObject::CMdEObject(CMdESession* aSession, TItemId aId, CMdEObjectDef& aDef) - : CMdEInstanceItem( aSession, aId ), iDef( &aDef ) + : CMdEInstanceItem( aSession, aId ), iDef( &aDef ), iUri( NULL ) { } @@ -145,6 +145,7 @@ } delete iUri; + iUri = NULL; iPropertyArray.ResetAndDestroy(); iPropertyArray.Close(); @@ -276,6 +277,7 @@ } iUri = HBufC::NewL( aUri.Length() ); + // Note: CopyLC doesn't push anything to cleanup stack iUri->Des().CopyLC( aUri ); iFlags |= EMdEObjectFlagModObject; } diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/client/src/mdesessionimpl.cpp --- a/metadataengine/client/src/mdesessionimpl.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/client/src/mdesessionimpl.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -1338,6 +1338,7 @@ { const TDesC& uri = *((*aObjects)[i]); HBufC* lcUri = HBufC::NewLC( uri.Length() ); + // Note: CopyLC doesn't push anything to cleanup stack lcUri->Des().CopyLC( uri ); buffer->InsertL( *lcUri ); CleanupStack::PopAndDestroy( lcUri ); diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/data/schema.mde --- a/metadataengine/data/schema.mde Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/data/schema.mde Thu Jul 22 16:38:01 2010 +0100 @@ -93,7 +93,7 @@ // // -version 2.0 +version 3.0 namespace http://sw.nokia.com/MdE 0 diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/inc/mdslogger.h --- a/metadataengine/server/inc/mdslogger.h Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/inc/mdslogger.h Thu Jul 22 16:38:01 2010 +0100 @@ -57,6 +57,10 @@ _LIT(KFilename, "server.txt"); _LIT(KAltFilename, "server2.txt"); +#ifdef LOG_QUERY +#define MDE_FILE_LOGGING +#endif + // CLASS DECLARATION /** * CMdSLogger. diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/inc/mdsmaintenanceengine.h --- a/metadataengine/server/inc/mdsmaintenanceengine.h Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/inc/mdsmaintenanceengine.h Thu Jul 22 16:38:01 2010 +0100 @@ -139,6 +139,8 @@ CMdSSqlDbMaintenance* iMaintenance; TInt iFailedImports; + + TBool iPrivateSchemaFileInvalid; }; #endif // __MDSMAINTENANCEENGINE_H__ diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/inc/mdsmanipulationengine.h --- a/metadataengine/server/inc/mdsmanipulationengine.h Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/inc/mdsmanipulationengine.h Thu Jul 22 16:38:01 2010 +0100 @@ -32,7 +32,7 @@ class CMdSSqlObjectManipulate; // CONSTANT DECLARATION -const TInt KGarbageCollectionDelay = 60; // 1 minute +const TInt KGarbageCollectionDelay = 90; // 1,5 minutes // CLASS DECLARATION @@ -342,6 +342,10 @@ CMdSGarbageCollector* iGarbageCollector; CMdSObjectLockList& iLockList; + + //For DB maintenance + TInt iAddedObjectsCount; + TInt iModifiedObjectsCount; }; #endif //__MDSMANIPULATIONENGINE_H__ diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/inc/mdsserversession.h --- a/metadataengine/server/inc/mdsserversession.h Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/inc/mdsserversession.h Thu Jul 22 16:38:01 2010 +0100 @@ -394,6 +394,9 @@ CMdCSerializationBuffer* CombineBuffersL( CMdCSerializationBuffer& aLeftBuffer, CMdCSerializationBuffer& aRightBuffer ); + + CMdCSerializationBuffer* CombineUriNotificationsBuffersL( + CMdCSerializationBuffer& aLeftBuffer, CMdCSerializationBuffer& aRightBuffer ); CMdCSerializationBuffer* CombineItemBuffersL( CMdCSerializationBuffer& aLeftBuffer, CMdCSerializationBuffer& aRightBuffer ); diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/inc/mdssqlobjectmanipulate.h --- a/metadataengine/server/inc/mdssqlobjectmanipulate.h Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/inc/mdssqlobjectmanipulate.h Thu Jul 22 16:38:01 2010 +0100 @@ -483,6 +483,11 @@ RArray& aObjectIds); void CheckMassStorageMediaIdL( const TUint32 aMediaId ); + + /** + * Analyze the database after enough items have been added or modified + */ + void AnalyzeL(); protected: // personal methods @@ -579,6 +584,8 @@ TBuf<256> iLastAddedObjName; + TBool iDictionaryToBeCleaned; + private: class RClauseBuffer { diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/src/mdsgarbagecollector.cpp --- a/metadataengine/server/src/mdsgarbagecollector.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/src/mdsgarbagecollector.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -99,14 +99,12 @@ if ( startAgain ) { - iTimer.After( iStatus, iDelay ); // start timer - SetActive(); - } - else if ( iNewDelay.Int() > 0 ) - { - iDelay = iNewDelay; - iNewDelay = 0; - iTimer.After( iStatus, iDelay ); // start timer + if( iNewDelay.Int() > 0 ) + { + iDelay = iNewDelay; + iNewDelay = 0; + } + iTimer.After( iStatus, iDelay ); // start timer SetActive(); } } diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/src/mdsmaintenanceengine.cpp --- a/metadataengine/server/src/mdsmaintenanceengine.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/src/mdsmaintenanceengine.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -59,7 +59,7 @@ // Constructor // ------------------------------------------------ // -CMdSMaintenanceEngine::CMdSMaintenanceEngine() +CMdSMaintenanceEngine::CMdSMaintenanceEngine() : iPrivateSchemaFileInvalid( EFalse ) { } @@ -129,32 +129,50 @@ iMaintenance->CreateDatabaseL( ); const TUint KMdSServerUid = 0x0320e65f; // temporal uid - // try to read schema file from C drive - TRAPD( err, ImportSchemaL( aSchema, KSchemaImportFile, KMdSServerUid) ); + TInt schemaError( KErrNone ); + + if( iPrivateSchemaFileInvalid ) + { + // if schema was updated in FOTA update, read the updated schema from ROM + TRAP( schemaError, ImportSchemaL( aSchema, KSchemaRomImportFile, KMdSServerUid) ); + } + else + { + // try to read schema file from C drive + TRAP( schemaError, ImportSchemaL( aSchema, KSchemaImportFile, KMdSServerUid) ); + } - if( err != KErrNone ) + if( schemaError != KErrNone ) { - __LOG1( ELogAlways, "Schema reading error: %d", err ); + __LOG1( ELogAlways, "Schema reading error: %d", schemaError ); // if schema file is not found, try to read from rom (Z) drive - if ( err == KErrNotFound || err == KErrPathNotFound ) + if ( schemaError == KErrNotFound || schemaError == KErrPathNotFound ) { - TRAP( err, ImportSchemaL( aSchema, KSchemaRomImportFile, KMdSServerUid) ); + TRAP( schemaError, ImportSchemaL( aSchema, KSchemaRomImportFile, KMdSServerUid) ); } - if( err != KErrNone ) + else if( !iPrivateSchemaFileInvalid && schemaError == KErrCorrupt ) + { + iPrivateSchemaFileInvalid = ETrue; + } + else + { + schemaError = KErrUnknown; + } + if( schemaError != KErrNone ) { - __LOG1( ELogAlways, "Schema reading error: %d", err ); + __LOG1( ELogAlways, "Schema reading error: %d", schemaError ); DeleteDatabase(); - User::Leave( err ); + User::Leave( schemaError ); } } if ( FailedImports() != 0 ) { - User::Leave( KErrCorrupt ); + User::Leave( KErrBadName ); } // try to read default import file from C drive - TRAP( err, ImportMetadataL( aManipulate, aSchema, KMdsDefaultImportFile ) ); + TRAPD( err, ImportMetadataL( aManipulate, aSchema, KMdsDefaultImportFile ) ); if ( err == KErrNotFound || err == KErrPathNotFound ) { // if default import file is not found, try to read from rom (Z) drive diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/src/mdsmanipulationengine.cpp --- a/metadataengine/server/src/mdsmanipulationengine.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/src/mdsmanipulationengine.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -31,6 +31,7 @@ #include "mdcserializationbuffer.h" #include "mdeinternalerror.h" #include "mdeerror.h" +#include "mdscommoninternal.h" // for CleanupResetAndDestroyPushL #include @@ -168,6 +169,7 @@ if (err == KErrNone) { aResultBuffer.InsertL( id ); + iAddedObjectsCount++; } else { @@ -295,6 +297,28 @@ iManipulate->SetNamespace( NULL ); iNotifier.NotifyAddedL( aBuffer, aResultBuffer ); + + if( iAddedObjectsCount > KTriggerDbMaintenanceTreasholdValue ) + { + RMdSTransaction transaction( connection ); + CleanupClosePushL(transaction); + const TInt beginError( transaction.Error() ); + + if( beginError != KErrNone ) + { + CleanupStack::PopAndDestroy( &transaction ); + } + + iManipulate->AnalyzeL(); + + if( beginError == KErrNone ) + { + transaction.CommitL(); + CleanupStack::PopAndDestroy( &transaction ); + } + + iAddedObjectsCount = 0; + } } // --------------------------------------------------------------------------- @@ -605,6 +629,7 @@ if (err == KErrNone) { aResultBuffer.InsertL( id ); + iModifiedObjectsCount++; } else { @@ -689,6 +714,28 @@ resultIds.SerializeL( aResultBuffer ); iNotifier.NotifyModifiedL( aBuffer, aResultBuffer ); + + if( iModifiedObjectsCount > KTriggerDbMaintenanceTreasholdValue ) + { + RMdSTransaction transaction( connection ); + CleanupClosePushL(transaction); + const TInt beginError( transaction.Error() ); + + if( beginError != KErrNone ) + { + CleanupStack::PopAndDestroy( &transaction ); + } + + iManipulate->AnalyzeL(); + + if( beginError == KErrNone ) + { + transaction.CommitL(); + CleanupStack::PopAndDestroy( &transaction ); + } + + iModifiedObjectsCount = 0; + } } CMdCSerializationBuffer* CMdSManipulationEngine::CheckObjectL( diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/src/mdsschema.cpp --- a/metadataengine/server/src/mdsschema.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/src/mdsschema.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -100,6 +100,7 @@ iBaseObject->AddPropertyL( MdeConstants::Object::KLastModifiedDateProperty, EPropertyTime, KMinTInt64, KMaxTInt64, EFalse, ETrue, EFalse ); iBaseObject->AddPropertyL( MdeConstants::Object::KItemTypeProperty, EPropertyText, TInt32(0), TInt32(255), EFalse, EFalse, EFalse ); iBaseObject->AddPropertyL( MdeConstants::Object::KTitleProperty, EPropertyText, TInt32(0), TInt32(255), EFalse, EFalse, EFalse ); + iBaseObject->AddPropertyL( MdeConstants::Object::KInDefaultFolder, EPropertyBool, TInt32(0), TInt32(1), EFalse, EFalse, EFalse ); TInt propcount = iBaseObject->GetPropertiesCount(); iBaseObject->iCol2Prop.Reset(); @@ -203,7 +204,7 @@ void CMdsSchema::CreateObjectTablesL() { - _LIT( KBaseObjectDefinition, "CREATE TABLE IF NOT EXISTS %S%u(ObjectId INTEGER PRIMARY KEY AUTOINCREMENT,ObjectDefId INTEGER NOT NULL,Flags INTEGER,MediaId LARGEINT,UsageCount LARGEINT DEFAULT 0,GuidHigh LARGEINT,GuidLow LARGEINT,URI TEXT NOT NULL COLLATE NOCASE,Origin INTEGER,Size LARGEINT,TimeOffset INTEGER,CreationDate LARGEINT,LastModifiedDate LARGEINT,ItemType TEXT,Title TEXT,UNIQUE(GuidHigh,GuidLow),UNIQUE(URI,MediaId));" ); + _LIT( KBaseObjectDefinition, "CREATE TABLE IF NOT EXISTS %S%u(ObjectId INTEGER PRIMARY KEY AUTOINCREMENT,ObjectDefId INTEGER NOT NULL,Flags INTEGER,MediaId LARGEINT,UsageCount LARGEINT DEFAULT 0,GuidHigh LARGEINT,GuidLow LARGEINT,URI TEXT NOT NULL COLLATE NOCASE,Origin INTEGER,Size LARGEINT,TimeOffset INTEGER,CreationDate LARGEINT,LastModifiedDate LARGEINT,ItemType TEXT,Title TEXT,InDefaultFolder INTEGER,UNIQUE(GuidHigh,GuidLow),UNIQUE(URI,MediaId));" ); _LIT( KCreateRelationsTable, "CREATE TABLE IF NOT EXISTS Relations%u(RelationId INTEGER PRIMARY KEY AUTOINCREMENT,Flags INTEGER,RelationDefId INTEGER NOT NULL,LeftObjectId INTEGER NOT NULL,RightObjectId INTEGER NOT NULL,Parameter INTEGER,GuidHigh LARGEINT,GuidLow LARGEINT,LastModifiedDate LARGEINT);" ); _LIT( KCreateEventsTable, "CREATE TABLE IF NOT EXISTS Event%u(EventId INTEGER PRIMARY KEY AUTOINCREMENT,ObjectId INTEGER NOT NULL, EventDefId INTEGER NOT NULL, Timestamp INTEGER NOT NULL, Source TEXT, Participant TEXT);" ); _LIT( KCreateTxtSrchTable, "CREATE TABLE IF NOT EXISTS TextSearch%u(WordId INTEGER NOT NULL,ObjectId INTEGER NOT NULL,Position INTEGER);" ); diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/src/mdsserver.cpp --- a/metadataengine/server/src/mdsserver.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/src/mdsserver.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -365,10 +365,10 @@ CMdSSqLiteConnection* conn = CMdSSqLiteConnection::NewLC(); iDefaultDBConnection = conn; MMdSDbConnectionPool::SetDefaultDB( conn ); - - CMdSMaintenanceEngine::InitConnectionL(); CleanupStack::Pop( conn ); + CMdSMaintenanceEngine::InitConnectionL(); + iNotifier = CMdSNotifier::NewL(); InitializeL(); @@ -400,7 +400,46 @@ iManipulate = CMdSManipulationEngine::NewL( *iSchema, *iNotifier, *iLockList ); - iMaintenance->InstallL( *iManipulate, *iSchema ); + // TRAP InstallL - first time for if there has been schema update, and + // the DB version is too old. Delete the DB and try to recreate it + TRAPD( error, iMaintenance->InstallL( *iManipulate, *iSchema ) ); + if( error == KErrCorrupt ) + { + delete iSchema; + iSchema = NULL; // for CS + iSchema = CMdsSchema::NewL(); + + delete iManipulate; + iManipulate = NULL; // for CS + iManipulate = CMdSManipulationEngine::NewL( *iSchema, *iNotifier, + *iLockList ); + + CMdSMaintenanceEngine::InitConnectionL(); + // TRAP InstallL - second time for if the schema file in private not updated + // during update, and the first attempt to recreate the DB fails. + // Then schema file in rom is used for final attempt to recreate the DB + TRAP( error, iMaintenance->InstallL( *iManipulate, *iSchema ) ); + if( error == KErrCorrupt ) + { + delete iSchema; + iSchema = NULL; // for CS + iSchema = CMdsSchema::NewL(); + + delete iManipulate; + iManipulate = NULL; // for CS + iManipulate = CMdSManipulationEngine::NewL( *iSchema, *iNotifier, + *iLockList ); + + CMdSMaintenanceEngine::InitConnectionL(); + // If the DB cannot be created from ANY available schema file, nothing can be + // can be done at this point, unfortunately + iMaintenance->InstallL( *iManipulate, *iSchema ); + } + } + else if( error != KErrNone ) + { + User::Leave( error ); + } } void CMdSServer::DeInitializeL() diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/src/mdsserversession.cpp --- a/metadataengine/server/src/mdsserversession.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/src/mdsserversession.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -866,6 +866,7 @@ delete findEngine; iFindEngines.Remove( findEngineIndex ); + iFindEngines.Compress(); } } break; @@ -984,6 +985,7 @@ // The cache holds a new notification for this notifier, trigger it CNotificationCacheItem* item = iNotificationCache[mid]; iNotificationCache.Remove(mid); + iNotificationCache.Compress(); CleanupStack::PushL( item ); @@ -1023,6 +1025,7 @@ delete iNotificationCache[i]->iData; iNotificationCache[i]->iData = NULL; iNotificationCache.Remove(i); + iNotificationCache.Compress(); } } } @@ -1089,6 +1092,95 @@ return buffer; } +// --------------------------------------------------------------------------- +// CacheNotificationL caches a notifier event +// --------------------------------------------------------------------------- +// + +CMdCSerializationBuffer* CMdSServerSession::CombineUriNotificationsBuffersL(CMdCSerializationBuffer& aLeftBuffer, + CMdCSerializationBuffer& aRightBuffer ) + { + // IDs are always stored in object IDs, + // even if those are actually relation or event IDs + + aLeftBuffer.PositionL( KNoOffset ); + aRightBuffer.PositionL( KNoOffset ); + + const TMdCItemIds& leftItemIds = TMdCItemIds::GetFromBufferL( aLeftBuffer ); + const TMdCItemIds& rightItemIds = TMdCItemIds::GetFromBufferL( aRightBuffer ); + + // check that namespaces match + if ( leftItemIds.iNamespaceDefId != rightItemIds.iNamespaceDefId ) + { + return NULL; + } + + // create new buffer, which will contain combined results + const TInt leftBufferSize = aLeftBuffer.Size(); + const TInt rightBufferSize = aRightBuffer.Size(); + CMdCSerializationBuffer* buffer = CMdCSerializationBuffer::NewLC( + leftBufferSize + rightBufferSize ); + + TMdCItemIds combinedItemIds; + + // use left buffer's data as base line + Mem::Copy( &combinedItemIds, &leftItemIds, sizeof( TMdCItemIds ) ); + + // and add right buffer's count + combinedItemIds.iObjectIds.iPtr.iCount += rightItemIds.iObjectIds.iPtr.iCount; + + combinedItemIds.SerializeL( *buffer ); + + // move left and right buffer to begin of items + aLeftBuffer.PositionL( leftItemIds.iObjectIds.iPtr.iOffset ); + aRightBuffer.PositionL( rightItemIds.iObjectIds.iPtr.iOffset ); + + // copy IDs from left and right buffers to combined buffer + for (TInt i = 0; i < leftItemIds.iObjectIds.iPtr.iCount; ++i) + { + TItemId id; + aLeftBuffer.ReceiveL( id ); + buffer->InsertL( id ); + } + + for (TInt i = 0; i < rightItemIds.iObjectIds.iPtr.iCount; ++i) + { + TItemId id; + aRightBuffer.ReceiveL( id ); + buffer->InsertL( id ); + } + + //Add combined URI count + TUint32 leftUriCount ( 0 ); + aLeftBuffer.ReceiveL( leftUriCount ); + TUint32 rightUriCount ( 0 ); + aRightBuffer.ReceiveL( rightUriCount ); + buffer->InsertL( TUint32( leftUriCount + rightUriCount) ); + + //Add uris + HBufC* uri = NULL; + for( TInt i( 0 ); i < leftUriCount; i++ ) + { + //Get uri + uri = aLeftBuffer.ReceiveDes16L(); + CleanupStack::PushL( uri ); + buffer->InsertL( *uri ); + CleanupStack::Pop( uri ); + } + + for( TInt i( 0 ); i < rightUriCount; i++ ) + { + //Get uri + uri = aRightBuffer.ReceiveDes16L(); + CleanupStack::PushL( uri ); + buffer->InsertL( *uri ); + CleanupStack::Pop( uri ); + } + + CleanupStack::Pop( buffer ); + return buffer; + } + CMdCSerializationBuffer* CMdSServerSession::CombineItemBuffersL( CMdCSerializationBuffer& aLeftBuffer, CMdCSerializationBuffer& aRightBuffer ) { @@ -1176,7 +1268,13 @@ { CMdCSerializationBuffer* data = NULL; // combine buffers - if ( notificationItem.iCode != ERelationItemNotifyRemove ) + if( notificationItem.iCode == EObjectNotifyAddWithUri || + notificationItem.iCode == EObjectNotifyModifyWithUri || + notificationItem.iCode == EObjectNotifyRemoveWithUri ) + { + data = CombineUriNotificationsBuffersL( *notificationItem.iData, *aData ); + } + else if ( notificationItem.iCode != ERelationItemNotifyRemove ) { data = CombineBuffersL( *notificationItem.iData, *aData ); } diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/src/mdssqliteconnection.cpp --- a/metadataengine/server/src/mdssqliteconnection.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/src/mdssqliteconnection.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -75,8 +75,8 @@ void CMdSSqLiteConnection::OpenDbL( const TDesC& aDbFileName ) { - _LIT8( KMdsSqlDbaConfig, "cache_size=8000; page_size=2048; encoding=\"UTF-16\";"); - _LIT8( KBlacklistSqlDbaConfig, "cache_size=4000; page_size=1024; encoding=\"UTF-16\";"); + _LIT8( KMdsSqlDbaConfig, "cache_size=2000; page_size=2048; encoding=\"UTF-16\";"); + _LIT8( KBlacklistSqlDbaConfig, "cache_size=1500; page_size=1024; encoding=\"UTF-16\";"); delete iDbFileName; iDbFileName = NULL; // in case AllocL leaves @@ -639,6 +639,15 @@ } } +void CMdSSqLiteConnection::DoAnalyzeL() + { + _LIT( KAnalyze, "ANALYZE;"); + + RRowData emptyRow; + CleanupClosePushL( emptyRow ); + ExecuteL(KAnalyze, emptyRow); + CleanupStack::PopAndDestroy( &emptyRow ); + } TInt CMdSSqLiteConnection::DeleteAndReCreateDB( const HBufC* aDbFileName, const RSqlSecurityPolicy& asqlSecurityPolicy, diff -r bf039b7fe409 -r 3d9988ee47f5 metadataengine/server/src/mdssqlobjectmanipulate.cpp --- a/metadataengine/server/src/mdssqlobjectmanipulate.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/metadataengine/server/src/mdssqlobjectmanipulate.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -3309,14 +3309,13 @@ TBool CMdSSqlObjectManipulate::DoGarbageCollectionL() { - _LIT( KDeleteObject, "DELETE FROM Object%u WHERE Flags&?;" ); + _LIT( KDeleteObject, "DELETE FROM Object%u WHERE ObjectId IN (SELECT ObjectId FROM Object%u WHERE Flags&? LIMIT 100);" ); _LIT( KUpdateDeleteObject, "UPDATE Object%u SET Flags=Flags|? WHERE Flags&?;" ); _LIT( KDeleteRelations, "DELETE FROM Relations%u WHERE Flags&?;" ); _LIT( KUpdateDeleteRelations, "UPDATE Relations%u SET Flags=Flags|? WHERE Flags&?;" ); _LIT( KUpdateDeleteContextObjects, "UPDATE Object%u SET Flags=Flags|? WHERE ObjectId IN ( SELECT ObjectId FROM Object%u AS O WHERE Flags&? AND UsageCount=0 AND ( SELECT count(*) FROM Relations%u WHERE NOT Flags&? AND ( LeftObjectId = O.ObjectId OR RightObjectId = O.ObjectId ) )= 0 );" ); _LIT( KDeleteWordFromTextSearchDict, "DELETE FROM TextSearchDictionary%u WHERE NOT EXISTS(SELECT WordId FROM TextSearch%u WHERE WordId = TextSearchDictionary%u.WordId);"); - RClauseBuffer commonClauseOne(*this, KUpdateDeleteContextObjects().Length() + 3 * KMaxUintValueLength); CleanupClosePushL( commonClauseOne ); CMdsClauseBuffer& buffer = commonClauseOne.BufferL(); @@ -3325,34 +3324,11 @@ CleanupClosePushL( rowDataDel ); rowDataDel.AppendL( TColumn( EMdEObjectFlagGarbage ) ); - RRowData rowDataUpd; - CleanupClosePushL( rowDataUpd ); - rowDataUpd.AppendL( TColumn( EMdEObjectFlagGarbage ) ); - rowDataUpd.AppendL( TColumn( EMdEObjectFlagRemoved ) ); - - RRowData rowDataDelRel; - CleanupClosePushL( rowDataDelRel ); - rowDataDelRel.AppendL( TColumn( EMdERelationFlagGarbageDeleted ) ); - - RRowData rowDataUpdRel; - CleanupClosePushL( rowDataUpdRel ); - rowDataUpdRel.AppendL( TColumn( EMdERelationFlagGarbageDeleted ) ); - rowDataUpdRel.AppendL( TColumn( EMdERelationFlagDeleted ) ); - - RRowData rowDataDelContext; - CleanupClosePushL( rowDataDelContext ); - rowDataDelContext.AppendL( TColumn( EMdEObjectFlagRemoved ) ); - rowDataDelContext.AppendL( TColumn( EMdEObjectFlagContext ) ); - rowDataDelContext.AppendL( TColumn( EMdERelationFlagDeleted ) ); - - RRowData emptyRow; - CleanupClosePushL( emptyRow ); - const RPointerArray& namespaceDefs = iSchema.NamespaceDefs(); CMdSSqLiteConnection& connection = MMdSDbConnectionPool::GetDefaultDBL(); - TInt deleteObjectResult; + TInt deleteObjectResult = 0; TInt updateResult = 0; const TInt count = namespaceDefs.Count(); @@ -3362,14 +3338,43 @@ const TDefId nmspId = namespaceDefs[i]->GetId(); // deleting objects - buffer.BufferL().Format( KDeleteObject, nmspId ); + buffer.BufferL().Format( KDeleteObject, nmspId, nmspId ); User::LeaveIfError( deleteObjectResult = connection.ExecuteL( buffer.ConstBufferL(), rowDataDel ) ); - + + if( deleteObjectResult > 0 ) + { + // If objects were deleted, continue garbage collection + iDictionaryToBeCleaned = ETrue; + CleanupStack::PopAndDestroy( 2, &commonClauseOne ); + return ETrue; + } + + RRowData rowDataUpd; + CleanupClosePushL( rowDataUpd ); + rowDataUpd.AppendL( TColumn( EMdEObjectFlagGarbage ) ); + rowDataUpd.AppendL( TColumn( EMdEObjectFlagRemoved ) ); + buffer.BufferL().Format( KUpdateDeleteObject, nmspId ); User::LeaveIfError( updateResult += connection.ExecuteL( buffer.ConstBufferL(), rowDataUpd ) ); + if( updateResult > 0 ) + { + // If objects were modified, continue garbage collection + CleanupStack::PopAndDestroy( 3, &commonClauseOne ); + return ETrue; + } + + RRowData rowDataDelRel; + CleanupClosePushL( rowDataDelRel ); + rowDataDelRel.AppendL( TColumn( EMdERelationFlagGarbageDeleted ) ); + + RRowData rowDataUpdRel; + CleanupClosePushL( rowDataUpdRel ); + rowDataUpdRel.AppendL( TColumn( EMdERelationFlagGarbageDeleted ) ); + rowDataUpdRel.AppendL( TColumn( EMdERelationFlagDeleted ) ); + // deleting relations buffer.BufferL().Format( KDeleteRelations, nmspId ); User::LeaveIfError( connection.ExecuteL( @@ -3378,19 +3383,43 @@ buffer.BufferL().Format( KUpdateDeleteRelations, nmspId ); User::LeaveIfError( updateResult += connection.ExecuteL( buffer.ConstBufferL(), rowDataUpdRel ) ); - + + if( updateResult > 0 ) + { + // If objects were modified, continue garbage collection + CleanupStack::PopAndDestroy( 5, &commonClauseOne ); + return ETrue; + } + + RRowData rowDataDelContext; + CleanupClosePushL( rowDataDelContext ); + rowDataDelContext.AppendL( TColumn( EMdEObjectFlagRemoved ) ); + rowDataDelContext.AppendL( TColumn( EMdEObjectFlagContext ) ); + rowDataDelContext.AppendL( TColumn( EMdERelationFlagDeleted ) ); + // deleting context objects buffer.BufferL().Format( KUpdateDeleteContextObjects, nmspId, nmspId, nmspId ); User::LeaveIfError( updateResult += connection.ExecuteL( buffer.ConstBufferL(), rowDataDelContext ) ); - + + if( updateResult > 0 ) + { + // If objects were modified, continue garbage collection + CleanupStack::PopAndDestroy( 6, &commonClauseOne ); + return ETrue; + } + + RRowData emptyRow; + CleanupClosePushL( emptyRow ); + // deleting words from text search dictionary - if ( deleteObjectResult > 0 ) + if ( iDictionaryToBeCleaned ) { buffer.BufferL().Format( KDeleteWordFromTextSearchDict, nmspId, nmspId, nmspId ); User::LeaveIfError( connection.ExecuteL( buffer.ConstBufferL(), emptyRow ) ); + iDictionaryToBeCleaned = EFalse; } } @@ -3405,9 +3434,15 @@ } #endif - return updateResult != 0; + return EFalse; } +void CMdSSqlObjectManipulate::AnalyzeL() + { + CMdSSqLiteConnection& db = MMdSDbConnectionPool::GetDefaultDBL(); + db.DoAnalyzeL(); + } + #ifdef MDS_PLAYLIST_HARVESTING_ENABLED TInt CMdSSqlObjectManipulate::CleanPlaylistsL() { diff -r bf039b7fe409 -r 3d9988ee47f5 rom/mds_cellid_reverse_geocode_enabled.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rom/mds_cellid_reverse_geocode_enabled.iby Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2006-2009 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: +* Metadata system iby file (for ROM image creation) +* +* +*/ + + +#ifndef __METADATA_IBY__ +#define __METADATA_IBY__ + +// sql is mandatory for mds +#include + +rem - MdE binaries +file=ABI_DIR\BUILD_DIR\mdeclient.dll SHARED_LIB_DIR\mdeclient.dll +file=ABI_DIR\BUILD_DIR\mdccommon.dll SHARED_LIB_DIR\mdccommon.dll +file=ABI_DIR\BUILD_DIR\!mdsserver.exe PROGRAMS_DIR\!mdsserver.exe + +rem - MdE data files +data=EPOCROOT##epoc32\data\z\Private\200009F3\schema.mde PRIVATE\200009F3\schema.mde +data=EPOCROOT##epoc32\data\z\Private\200009F3\defaultimportfile.mde PRIVATE\200009F3\defaultimportfile.mde +data=EPOCROOT##epoc32\data\z\Private\200009F3\backup_registration.xml PRIVATE\200009F3\backup_registration.xml +data=EPOCROOT##epoc32\data\z\Private\200009F5\backup_registration.xml PRIVATE\200009F5\backup_registration.xml +data=EPOCROOT##epoc32\data\z\Private\200009F5\mappings.db PRIVATE\200009F5\mappings.db + +rem - Harvester and Context Engine binaries +file=ABI_DIR\BUILD_DIR\HarvesterPluginInterface.dll SHARED_LIB_DIR\HarvesterPluginInterface.dll +file=ABI_DIR\BUILD_DIR\HarvesterClient.dll SHARED_LIB_DIR\HarvesterClient.dll +file=ABI_DIR\BUILD_DIR\HarvesterServer.exe PROGRAMS_DIR\HarvesterServer.exe +file=ABI_DIR\BUILD_DIR\harvestercommon.dll SHARED_LIB_DIR\harvestercommon.dll +file=ABI_DIR\BUILD_DIR\harvesterdata.dll SHARED_LIB_DIR\harvesterdata.dll +file=ABI_DIR\BUILD_DIR\mdsfileserverplugin.pxt SHARED_LIB_DIR\mdsfileserverplugin.pxt +ECOM_PLUGIN(HarvesterImagePlugin.dll,HarvesterImagePlugin.rsc) +ECOM_PLUGIN(HarvesterVideoPlugin.dll,HarvesterVideoPlugin.rsc) +ECOM_PLUGIN(HarvesterMessagePlugin.dll,HarvesterMessagePlugin.rsc) +ECOM_PLUGIN(harvesteromadrmplugin.dll,harvesteromadrmplugin.rsc) +ECOM_PLUGIN(harvesterwmvplugin.dll,harvesterwmvplugin.rsc) +ECOM_PLUGIN(harvesterrtpplugin.dll,harvesterrtpplugin.rsc) +ECOM_PLUGIN(harvesteraudioplugin.dll,harvesteraudioplugin.rsc) + +rem - Blacklist server binaries +file=ABI_DIR\BUILD_DIR\!blacklistserver.exe PROGRAMS_DIR\!blacklistserver.exe +file=ABI_DIR\BUILD_DIR\blacklistclient.dll SHARED_LIB_DIR\blacklistclient.dll + +file=ABI_DIR\BUILD_DIR\MonitorPluginInterface.dll SHARED_LIB_DIR\MonitorPluginInterface.dll +ECOM_PLUGIN(MMCMonitorPlugin.dll,MMCMonitorPlugin.rsc) +ECOM_PLUGIN(FileMonitorPlugin.dll,FileMonitorPlugin.rsc) +ECOM_PLUGIN(MessageMonitorPlugin.dll,MessageMonitorPlugin.rsc) +ECOM_PLUGIN(mdsoomplugin.dll,mdsoomplugin.rsc) + +file=ABI_DIR\BUILD_DIR\ContextPluginInterface.dll SHARED_LIB_DIR\ContextPluginInterface.dll +file=ABI_DIR\BUILD_DIR\ContextEngine.dll SHARED_LIB_DIR\ContextEngine.dll +ECOM_PLUGIN(locationcontextplugin.dll,locationcontextplugin.rsc) +ECOM_PLUGIN(calendarcontextplugin.dll,calendarcontextplugin.rsc) + +file=ABI_DIR\BUILD_DIR\ComposerPluginInterface.dll SHARED_LIB_DIR\ComposerPluginInterface.dll +ECOM_PLUGIN(ComposerImagePlugin.dll,ComposerImagePlugin.rsc) + +// Location Manager +REM locationmanager +file=ABI_DIR\BUILD_DIR\locationmanager.dll SHARED_LIB_DIR\locationmanager.dll + +REM locationmanagerserver +file=ABI_DIR\BUILD_DIR\locationmanagerserver.exe PROGRAMS_DIR\locationmanagerserver.exe + +REM watchdog +file=ABI_DIR\BUILD_DIR\mdswatchdog.exe PROGRAMS_DIR\mdswatchdog.exe + +REM locationtrail +file=ABI_DIR\BUILD_DIR\locationtrail.dll SHARED_LIB_DIR\locationtrail.dll + +REM ReverseGeocode +file=ABI_DIR\BUILD_DIR\ReverseGeocode.dll SHARED_LIB_DIR\ReverseGeocode.dll + +REM Reverse geocoder plugin +ECOM_PLUGIN(ReverseGeoCoderPlugin.dll,reversegeocoderplugin.rsc) + +REM tagcreator +file=ABI_DIR\BUILD_DIR\tagcreator.dll SHARED_LIB_DIR\tagcreator.dll + +REM geotagger +file=ABI_DIR\BUILD_DIR\geotagger.dll SHARED_LIB_DIR\geotagger.dll + +REM geoconverter +file=ABI_DIR\BUILD_DIR\geoconverter.dll SHARED_LIB_DIR\geoconverter.dll + +REM Location Manager data files +data=ZPRIVATE\10202BE9\200071BE.txt "PRIVATE\10202BE9\200071BE.txt" + +REM Harvester Cen Repo file +data=ZPRIVATE\10202BE9\200009FE.txt "PRIVATE\10202BE9\200009FE.txt" + +REM MdS version CenRep file +data=ZPRIVATE\10202BE9\200009F3.txt "PRIVATE\10202BE9\200009F3.txt" + +REM Harvester MMC plugin CenRep file +data=ZPRIVATE\10202BE9\20007183.txt "PRIVATE\10202BE9\20007183.txt" + +data=ZSYSTEM\install\contentlistingframework_stub.sis system\install\contentlistingframework_stub.sis +data=ZSYSTEM\install\contextengine_stub.sis system\install\contextengine_stub.sis +data=ZSYSTEM\install\blacklistserver_stub.sis system\install\blacklistserver_stub.sis +data=ZSYSTEM\install\composerplugins_stub.sis system\install\composerplugins_stub.sis +data=ZSYSTEM\install\harvester_stub.sis system\install\harvester_stub.sis +data=ZSYSTEM\install\harvesterplugins_stub.sis system\install\harvesterplugins_stub.sis +data=ZSYSTEM\install\monitorplugins_stub.sis system\install\monitorplugins_stub.sis +data=ZSYSTEM\install\locationmanager_stub.sis system\install\locationmanager_stub.sis +data=ZSYSTEM\install\metadataengine_stub.sis system\install\metadataengine_stub.sis +data=ZSYSTEM\install\mds_stub.sis system\install\mds_stub.sis +data=ZSYSTEM\install\mdswatchdog_stub.sis system\install\mdswatchdog_stub.sis + +#endif //__METADATA_IBY__ diff -r bf039b7fe409 -r 3d9988ee47f5 rom/mds_cellidenabled.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rom/mds_cellidenabled.iby Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2006-2009 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: +* Metadata system iby file (for ROM image creation) +* +* +*/ + + +#ifndef __METADATA_IBY__ +#define __METADATA_IBY__ + +// sql is mandatory for mds +#include + +rem - MdE binaries +file=ABI_DIR\BUILD_DIR\mdeclient.dll SHARED_LIB_DIR\mdeclient.dll +file=ABI_DIR\BUILD_DIR\mdccommon.dll SHARED_LIB_DIR\mdccommon.dll +file=ABI_DIR\BUILD_DIR\!mdsserver.exe PROGRAMS_DIR\!mdsserver.exe + +rem - MdE data files +data=EPOCROOT##epoc32\data\z\Private\200009F3\schema.mde PRIVATE\200009F3\schema.mde +data=EPOCROOT##epoc32\data\z\Private\200009F3\defaultimportfile.mde PRIVATE\200009F3\defaultimportfile.mde +data=EPOCROOT##epoc32\data\z\Private\200009F3\backup_registration.xml PRIVATE\200009F3\backup_registration.xml +data=EPOCROOT##epoc32\data\z\Private\200009F5\backup_registration.xml PRIVATE\200009F5\backup_registration.xml +data=EPOCROOT##epoc32\data\z\Private\200009F5\mappings.db PRIVATE\200009F5\mappings.db + +rem - Harvester and Context Engine binaries +file=ABI_DIR\BUILD_DIR\HarvesterPluginInterface.dll SHARED_LIB_DIR\HarvesterPluginInterface.dll +file=ABI_DIR\BUILD_DIR\HarvesterClient.dll SHARED_LIB_DIR\HarvesterClient.dll +file=ABI_DIR\BUILD_DIR\HarvesterServer.exe PROGRAMS_DIR\HarvesterServer.exe +file=ABI_DIR\BUILD_DIR\harvestercommon.dll SHARED_LIB_DIR\harvestercommon.dll +file=ABI_DIR\BUILD_DIR\harvesterdata.dll SHARED_LIB_DIR\harvesterdata.dll +file=ABI_DIR\BUILD_DIR\mdsfileserverplugin.pxt SHARED_LIB_DIR\mdsfileserverplugin.pxt +ECOM_PLUGIN(HarvesterImagePlugin.dll,HarvesterImagePlugin.rsc) +ECOM_PLUGIN(HarvesterVideoPlugin.dll,HarvesterVideoPlugin.rsc) +ECOM_PLUGIN(HarvesterMessagePlugin.dll,HarvesterMessagePlugin.rsc) +ECOM_PLUGIN(harvesteromadrmplugin.dll,harvesteromadrmplugin.rsc) +ECOM_PLUGIN(harvesterwmvplugin.dll,harvesterwmvplugin.rsc) +ECOM_PLUGIN(harvesterrtpplugin.dll,harvesterrtpplugin.rsc) +ECOM_PLUGIN(harvesteraudioplugin.dll,harvesteraudioplugin.rsc) + +rem - Blacklist server binaries +file=ABI_DIR\BUILD_DIR\!blacklistserver.exe PROGRAMS_DIR\!blacklistserver.exe +file=ABI_DIR\BUILD_DIR\blacklistclient.dll SHARED_LIB_DIR\blacklistclient.dll + +file=ABI_DIR\BUILD_DIR\MonitorPluginInterface.dll SHARED_LIB_DIR\MonitorPluginInterface.dll +ECOM_PLUGIN(MMCMonitorPlugin.dll,MMCMonitorPlugin.rsc) +ECOM_PLUGIN(FileMonitorPlugin.dll,FileMonitorPlugin.rsc) +ECOM_PLUGIN(MessageMonitorPlugin.dll,MessageMonitorPlugin.rsc) +ECOM_PLUGIN(mdsoomplugin.dll,mdsoomplugin.rsc) + +file=ABI_DIR\BUILD_DIR\ContextPluginInterface.dll SHARED_LIB_DIR\ContextPluginInterface.dll +file=ABI_DIR\BUILD_DIR\ContextEngine.dll SHARED_LIB_DIR\ContextEngine.dll +ECOM_PLUGIN(locationcontextplugin.dll,locationcontextplugin.rsc) +ECOM_PLUGIN(calendarcontextplugin.dll,calendarcontextplugin.rsc) + +file=ABI_DIR\BUILD_DIR\ComposerPluginInterface.dll SHARED_LIB_DIR\ComposerPluginInterface.dll +ECOM_PLUGIN(ComposerImagePlugin.dll,ComposerImagePlugin.rsc) + +// Location Manager +REM locationmanager +file=ABI_DIR\BUILD_DIR\locationmanager.dll SHARED_LIB_DIR\locationmanager.dll + +REM locationmanagerserver +file=ABI_DIR\BUILD_DIR\locationmanagerserver.exe PROGRAMS_DIR\locationmanagerserver.exe + +REM watchdog +file=ABI_DIR\BUILD_DIR\mdswatchdog.exe PROGRAMS_DIR\mdswatchdog.exe + +REM locationtrail +file=ABI_DIR\BUILD_DIR\locationtrail.dll SHARED_LIB_DIR\locationtrail.dll + +REM geoconverter +file=ABI_DIR\BUILD_DIR\geoconverter.dll SHARED_LIB_DIR\geoconverter.dll + + +REM Location Manager data files +data=ZPRIVATE\10202BE9\200071BE.txt "PRIVATE\10202BE9\200071BE.txt" + +REM Harvester Cen Repo file +data=ZPRIVATE\10202BE9\200009FE.txt "PRIVATE\10202BE9\200009FE.txt" + +REM MdS version CenRep file +data=ZPRIVATE\10202BE9\200009F3.txt "PRIVATE\10202BE9\200009F3.txt" + +REM Harvester MMC plugin CenRep file +data=ZPRIVATE\10202BE9\20007183.txt "PRIVATE\10202BE9\20007183.txt" + +data=ZSYSTEM\install\contentlistingframework_stub.sis system\install\contentlistingframework_stub.sis +data=ZSYSTEM\install\contextengine_stub.sis system\install\contextengine_stub.sis +data=ZSYSTEM\install\blacklistserver_stub.sis system\install\blacklistserver_stub.sis +data=ZSYSTEM\install\composerplugins_stub.sis system\install\composerplugins_stub.sis +data=ZSYSTEM\install\harvester_stub.sis system\install\harvester_stub.sis +data=ZSYSTEM\install\harvesterplugins_stub.sis system\install\harvesterplugins_stub.sis +data=ZSYSTEM\install\monitorplugins_stub.sis system\install\monitorplugins_stub.sis +data=ZSYSTEM\install\locationmanager_stub.sis system\install\locationmanager_stub.sis +data=ZSYSTEM\install\metadataengine_stub.sis system\install\metadataengine_stub.sis +data=ZSYSTEM\install\mds_stub.sis system\install\mds_stub.sis +data=ZSYSTEM\install\mdswatchdog_stub.sis system\install\mdswatchdog_stub.sis + +#endif //__METADATA_IBY__ diff -r bf039b7fe409 -r 3d9988ee47f5 rom/mds_reverse_geocode_enabled_only.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rom/mds_reverse_geocode_enabled_only.iby Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2006-2009 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: +* Metadata system iby file (for ROM image creation) +* +* +*/ + + +#ifndef __METADATA_IBY__ +#define __METADATA_IBY__ + +// sql is mandatory for mds +#include + +rem - MdE binaries +file=ABI_DIR\BUILD_DIR\mdeclient.dll SHARED_LIB_DIR\mdeclient.dll +file=ABI_DIR\BUILD_DIR\mdccommon.dll SHARED_LIB_DIR\mdccommon.dll +file=ABI_DIR\BUILD_DIR\!mdsserver.exe PROGRAMS_DIR\!mdsserver.exe + +rem - MdE data files +data=EPOCROOT##epoc32\data\z\Private\200009F3\schema.mde PRIVATE\200009F3\schema.mde +data=EPOCROOT##epoc32\data\z\Private\200009F3\defaultimportfile.mde PRIVATE\200009F3\defaultimportfile.mde +data=EPOCROOT##epoc32\data\z\Private\200009F3\backup_registration.xml PRIVATE\200009F3\backup_registration.xml +data=EPOCROOT##epoc32\data\z\Private\200009F5\backup_registration.xml PRIVATE\200009F5\backup_registration.xml +data=EPOCROOT##epoc32\data\z\Private\200009F5\mappings.db PRIVATE\200009F5\mappings.db + +rem - Harvester and Context Engine binaries +file=ABI_DIR\BUILD_DIR\HarvesterPluginInterface.dll SHARED_LIB_DIR\HarvesterPluginInterface.dll +file=ABI_DIR\BUILD_DIR\HarvesterClient.dll SHARED_LIB_DIR\HarvesterClient.dll +file=ABI_DIR\BUILD_DIR\HarvesterServer.exe PROGRAMS_DIR\HarvesterServer.exe +file=ABI_DIR\BUILD_DIR\harvestercommon.dll SHARED_LIB_DIR\harvestercommon.dll +file=ABI_DIR\BUILD_DIR\harvesterdata.dll SHARED_LIB_DIR\harvesterdata.dll +file=ABI_DIR\BUILD_DIR\mdsfileserverplugin.pxt SHARED_LIB_DIR\mdsfileserverplugin.pxt +ECOM_PLUGIN(HarvesterImagePlugin.dll,HarvesterImagePlugin.rsc) +ECOM_PLUGIN(HarvesterVideoPlugin.dll,HarvesterVideoPlugin.rsc) +ECOM_PLUGIN(HarvesterMessagePlugin.dll,HarvesterMessagePlugin.rsc) +ECOM_PLUGIN(harvesteromadrmplugin.dll,harvesteromadrmplugin.rsc) +ECOM_PLUGIN(harvesterwmvplugin.dll,harvesterwmvplugin.rsc) +ECOM_PLUGIN(harvesterrtpplugin.dll,harvesterrtpplugin.rsc) +ECOM_PLUGIN(harvesteraudioplugin.dll,harvesteraudioplugin.rsc) + +rem - Blacklist server binaries +file=ABI_DIR\BUILD_DIR\!blacklistserver.exe PROGRAMS_DIR\!blacklistserver.exe +file=ABI_DIR\BUILD_DIR\blacklistclient.dll SHARED_LIB_DIR\blacklistclient.dll + +file=ABI_DIR\BUILD_DIR\MonitorPluginInterface.dll SHARED_LIB_DIR\MonitorPluginInterface.dll +ECOM_PLUGIN(MMCMonitorPlugin.dll,MMCMonitorPlugin.rsc) +ECOM_PLUGIN(FileMonitorPlugin.dll,FileMonitorPlugin.rsc) +ECOM_PLUGIN(MessageMonitorPlugin.dll,MessageMonitorPlugin.rsc) +ECOM_PLUGIN(mdsoomplugin.dll,mdsoomplugin.rsc) + +file=ABI_DIR\BUILD_DIR\ContextPluginInterface.dll SHARED_LIB_DIR\ContextPluginInterface.dll +file=ABI_DIR\BUILD_DIR\ContextEngine.dll SHARED_LIB_DIR\ContextEngine.dll +ECOM_PLUGIN(locationcontextplugin.dll,locationcontextplugin.rsc) +ECOM_PLUGIN(calendarcontextplugin.dll,calendarcontextplugin.rsc) + +file=ABI_DIR\BUILD_DIR\ComposerPluginInterface.dll SHARED_LIB_DIR\ComposerPluginInterface.dll +ECOM_PLUGIN(ComposerImagePlugin.dll,ComposerImagePlugin.rsc) + +// Location Manager +REM locationmanager +file=ABI_DIR\BUILD_DIR\locationmanager.dll SHARED_LIB_DIR\locationmanager.dll + +REM locationmanagerserver +file=ABI_DIR\BUILD_DIR\locationmanagerserver.exe PROGRAMS_DIR\locationmanagerserver.exe + +REM watchdog +file=ABI_DIR\BUILD_DIR\mdswatchdog.exe PROGRAMS_DIR\mdswatchdog.exe + +REM locationtrail +file=ABI_DIR\BUILD_DIR\locationtrail.dll SHARED_LIB_DIR\locationtrail.dll + +REM ReverseGeocode +file=ABI_DIR\BUILD_DIR\ReverseGeocode.dll SHARED_LIB_DIR\ReverseGeocode.dll + +REM Reverse geocoder plugin +ECOM_PLUGIN(ReverseGeoCoderPlugin.dll,reversegeocoderplugin.rsc) + +REM tagcreator +file=ABI_DIR\BUILD_DIR\tagcreator.dll SHARED_LIB_DIR\tagcreator.dll + +REM geotagger +file=ABI_DIR\BUILD_DIR\geotagger.dll SHARED_LIB_DIR\geotagger.dll + +REM Location Manager data files +data=ZPRIVATE\10202BE9\200071BE.txt "PRIVATE\10202BE9\200071BE.txt" + +REM Harvester Cen Repo file +data=ZPRIVATE\10202BE9\200009FE.txt "PRIVATE\10202BE9\200009FE.txt" + +REM MdS version CenRep file +data=ZPRIVATE\10202BE9\200009F3.txt "PRIVATE\10202BE9\200009F3.txt" + +REM Harvester MMC plugin CenRep file +data=ZPRIVATE\10202BE9\20007183.txt "PRIVATE\10202BE9\20007183.txt" + +data=ZSYSTEM\install\contentlistingframework_stub.sis system\install\contentlistingframework_stub.sis +data=ZSYSTEM\install\contextengine_stub.sis system\install\contextengine_stub.sis +data=ZSYSTEM\install\blacklistserver_stub.sis system\install\blacklistserver_stub.sis +data=ZSYSTEM\install\composerplugins_stub.sis system\install\composerplugins_stub.sis +data=ZSYSTEM\install\harvester_stub.sis system\install\harvester_stub.sis +data=ZSYSTEM\install\harvesterplugins_stub.sis system\install\harvesterplugins_stub.sis +data=ZSYSTEM\install\monitorplugins_stub.sis system\install\monitorplugins_stub.sis +data=ZSYSTEM\install\locationmanager_stub.sis system\install\locationmanager_stub.sis +data=ZSYSTEM\install\metadataengine_stub.sis system\install\metadataengine_stub.sis +data=ZSYSTEM\install\mds_stub.sis system\install\mds_stub.sis +data=ZSYSTEM\install\mdswatchdog_stub.sis system\install\mdswatchdog_stub.sis + +#endif //__METADATA_IBY__ diff -r bf039b7fe409 -r 3d9988ee47f5 sis/mds/mds_stub.sis Binary file sis/mds/mds_stub.sis has changed diff -r bf039b7fe409 -r 3d9988ee47f5 sis/mds/package.pkg --- a/sis/mds/package.pkg Fri Jun 25 13:56:30 2010 +0100 +++ b/sis/mds/package.pkg Thu Jul 22 16:38:01 2010 +0100 @@ -17,7 +17,7 @@ &EN ;packet-header (name, uid, major, minor, build, type) -#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 7, TYPE=SA, RU +#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 10, TYPE=SA, RU ; Localised vendor name %{"Nokia"} diff -r bf039b7fe409 -r 3d9988ee47f5 sis/mds/package_cellid_reverse_geocode_enabled.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sis/mds/package_cellid_reverse_geocode_enabled.pkg Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,117 @@ +; +; Copyright (c) 2009 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: +; +;Languages +&EN + +;packet-header (name, uid, major, minor, build, type) +#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 9, TYPE=SA, RU + +; Localised vendor name +%{"Nokia"} + +; Unique vendor name +:"Nokia" + +;Files +"\epoc32\release\armv5\udeb\mdsiadstop.exe"-"c:\sys\bin\mdsiadstop.exe",FILERUN,RB,RW + +; CenRep +"..\..\clfwrapper\conf\102828AC.txt"-"c:\private\10202be9\102828AC.txt" +"..\..\harvester\common\data\200009FE.txt"-"c:\private\10202be9\200009FE.txt" +"..\..\locationmanager\data\200071BE.txt"-"c:\private\10202be9\200071BE.txt" + +; contextengine +"\EPOC32\RELEASE\ARMV5\UREL\contextengine.dll" -"c:\sys\bin\contextengine.dll" +"\EPOC32\RELEASE\ARMV5\UREL\contextplugininterface.dll" -"c:\sys\bin\contextplugininterface.dll" +"\EPOC32\RELEASE\ARMV5\UREL\calendarcontextplugin.dll" -"c:\sys\bin\calendarcontextplugin.dll" +"\epoc32\data\z\resource\plugins\calendarcontextplugin.rsc" -"c:\resource\plugins\calendarcontextplugin.rsc" +"\EPOC32\RELEASE\ARMV5\UREL\locationcontextplugin.dll" -"c:\sys\bin\locationcontextplugin.dll" +"\epoc32\data\z\resource\plugins\locationcontextplugin.rsc" -"c:\resource\plugins\locationcontextplugin.rsc" + +; clf wrapper +"\EPOC32\RELEASE\ARMV5\UREL\MediaCollectionManager.dll" -"c:\sys\bin\MediaCollectionManager.dll" +"\EPOC32\RELEASE\ARMV5\UREL\ContentListingFramework.dll" -"c:\sys\bin\ContentListingFramework.dll" + +; blacklist +"\EPOC32\RELEASE\ARMV5\UREL\!blacklistserver.exe" -"c:\sys\bin\!blacklistserver.exe" +"\EPOC32\RELEASE\ARMV5\UREL\blacklistclient.dll" -"c:\sys\bin\blacklistclient.dll" + +; composer plugins +"\epoc32\RELEASE\armv5\UREL\composerplugininterface.dll"-"c:\sys\bin\composerplugininterface.dll" +"\epoc32\RELEASE\armv5\UREL\composerimageplugin.dll"-"c:\sys\bin\composerimageplugin.dll" +"\epoc32\data\z\resource\plugins\composerimageplugin.rsc"-"c:\resource\plugins\composerimageplugin.rsc" + +; harvester +"\epoc32\RELEASE\armv5\UREL\harvesterclient.dll" -"c:\sys\bin\harvesterclient.dll" +"\epoc32\RELEASE\armv5\UREL\harvestercommon.dll" -"c:\sys\bin\harvestercommon.dll" +"\epoc32\RELEASE\armv5\UREL\harvesterdata.dll" -"c:\sys\bin\harvesterdata.dll" +"\epoc32\RELEASE\armv5\UREL\harvesterplugininterface.dll" -"c:\sys\bin\harvesterplugininterface.dll" +"\epoc32\RELEASE\armv5\UREL\harvesterserver.exe" -"c:\sys\bin\harvesterserver.exe" + +; harvester plugins +"\epoc32\RELEASE\armv5\UREL\harvesteraudioplugin.dll"-"c:\sys\bin\harvesteraudioplugin.dll" +"\epoc32\data\z\resource\plugins\harvesteraudioplugin.rsc"-"c:\resource\plugins\harvesteraudioplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\harvesterimageplugin.dll"-"c:\sys\bin\harvesterimageplugin.dll" +"\epoc32\data\z\resource\plugins\harvesterimageplugin.rsc"-"c:\resource\plugins\harvesterimageplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\harvestermessageplugin.dll"-"c:\sys\bin\harvestermessageplugin.dll" +"\epoc32\data\z\resource\plugins\harvestermessageplugin.rsc"-"c:\resource\plugins\harvestermessageplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\harvesteromadrmplugin.dll"-"c:\sys\bin\harvesteromadrmplugin.dll" +"\epoc32\data\z\resource\plugins\harvesteromadrmplugin.rsc"-"c:\resource\plugins\harvesteromadrmplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\harvesterrtpplugin.dll"-"c:\sys\bin\harvesterrtpplugin.dll" +"\epoc32\data\z\resource\plugins\harvesterrtpplugin.rsc"-"c:\resource\plugins\harvesterrtpplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\harvestervideoplugin.dll"-"c:\sys\bin\harvestervideoplugin.dll" +"\epoc32\data\z\resource\plugins\harvestervideoplugin.rsc"-"c:\resource\plugins\harvestervideoplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\harvesterwmvplugin.dll"-"c:\sys\bin\harvesterwmvplugin.dll" +"\epoc32\data\z\resource\plugins\harvesterwmvplugin.rsc"-"c:\resource\plugins\harvesterwmvplugin.rsc" + +; monitor plugins +"\epoc32\RELEASE\armv5\UREL\monitorplugininterface.dll"-"c:\sys\bin\monitorplugininterface.dll" +"\epoc32\RELEASE\armv5\UREL\mdsfileserverplugin.pxt"-"c:\sys\bin\mdsfileserverplugin.pxt" +"\epoc32\RELEASE\armv5\UREL\filemonitorplugin.dll"-"c:\sys\bin\filemonitorplugin.dll" +"\epoc32\data\z\resource\plugins\filemonitorplugin.rsc"-"c:\resource\plugins\filemonitorplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\MessageMonitorPlugin.dll"-"c:\sys\bin\MessageMonitorPlugin.dll" +"\epoc32\data\z\resource\plugins\MessageMonitorPlugin.rsc"-"c:\resource\plugins\MessageMonitorPlugin.rsc" +"\epoc32\RELEASE\armv5\UREL\mmcmonitorplugin.dll"-"c:\sys\bin\mmcmonitorplugin.dll" +"\epoc32\data\z\resource\plugins\mmcmonitorplugin.rsc"-"c:\resource\plugins\mmcmonitorplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\mdsoomplugin.dll"-"c:\sys\bin\mdsoomplugin.dll" +"\epoc32\data\z\resource\plugins\mdsoomplugin.rsc"-"c:\resource\plugins\mdsoomplugin.rsc" + +; location manager +"\EPOC32\RELEASE\ARMV5\UREL\LocationTrail.dll" -"c:\sys\bin\LocationTrail.dll" +"\EPOC32\RELEASE\ARMV5\UREL\locationmanager.dll" -"c:\sys\bin\locationmanager.dll" +"\EPOC32\RELEASE\ARMV5\UREL\locationmanagerserver.exe" -"c:\sys\bin\locationmanagerserver.exe" +"\EPOC32\RELEASE\ARMV5\UREL\geoconverter.dll" -"c:\sys\bin\geoconverter.dll" +"\EPOC32\RELEASE\ARMV5\UREL\ReverseGeocode.dll" -"c:\sys\bin\ReverseGeocode.dll" +"\EPOC32\RELEASE\ARMV5\UREL\tagcreator.dll" -"c:\sys\bin\tagcreator.dll" +"\EPOC32\RELEASE\ARMV5\UREL\geotagger.dll" -"c:\sys\bin\geotagger.dll" +"\epoc32\RELEASE\armv5\UREL\ReverseGeoCoderPlugin.dll"-"c:\sys\bin\ReverseGeoCoderPlugin.dll" +"\epoc32\data\z\resource\plugins\reversegeocoderplugin.rsc"-"c:\resource\plugins\reversegeocoderplugin.rsc" + +; metadata engine +"\EPOC32\RELEASE\ARMV5\UREL\mdeclient.dll" -"c:\sys\bin\mdeclient.dll" +"\EPOC32\RELEASE\ARMV5\UREL\mdccommon.dll" -"c:\sys\bin\mdccommon.dll" +"\EPOC32\RELEASE\ARMV5\UREL\!mdsserver.exe" -"c:\sys\bin\!mdsserver.exe" + +"\epoc32\release\armv5\udeb\mdswatchdog.exe"-"c:\sys\bin\mdswatchdog.exe" + +"\epoc32\data\z\Private\200009F3\schema.mde"-"c:\PRIVATE\200009F3\schema.mde" +"\epoc32\data\z\Private\200009F3\defaultimportfile.mde"-"c:\PRIVATE\200009F3\defaultimportfile.mde" +"\epoc32\data\z\Private\200009F3\backup_registration.xml"-"c:\PRIVATE\200009F3\backup_registration.xml" +"\epoc32\data\z\Private\200009F5\backup_registration.xml"-"c:\PRIVATE\200009F5\backup_registration.xml" +"\epoc32\data\z\Private\200009F5\mappings.db"-"c:\PRIVATE\200009F5\mappings.db" + +"\epoc32\release\armv5\udeb\mdsiadrestart.exe"-"c:\sys\bin\mdsiadrestart.exe",FILERUN,RB,RW + diff -r bf039b7fe409 -r 3d9988ee47f5 sis/mds/package_cellidenabled.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sis/mds/package_cellidenabled.pkg Thu Jul 22 16:38:01 2010 +0100 @@ -0,0 +1,112 @@ +; +; Copyright (c) 2009 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: +; +;Languages +&EN + +;packet-header (name, uid, major, minor, build, type) +#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 9, TYPE=SA, RU + +; Localised vendor name +%{"Nokia"} + +; Unique vendor name +:"Nokia" + +;Files +"\epoc32\release\armv5\udeb\mdsiadstop.exe"-"c:\sys\bin\mdsiadstop.exe",FILERUN,RB,RW + +; CenRep +"..\..\clfwrapper\conf\102828AC.txt"-"c:\private\10202be9\102828AC.txt" +"..\..\harvester\common\data\200009FE.txt"-"c:\private\10202be9\200009FE.txt" +"..\..\locationmanager\data\200071BE.txt"-"c:\private\10202be9\200071BE.txt" + +; contextengine +"\EPOC32\RELEASE\ARMV5\UREL\contextengine.dll" -"c:\sys\bin\contextengine.dll" +"\EPOC32\RELEASE\ARMV5\UREL\contextplugininterface.dll" -"c:\sys\bin\contextplugininterface.dll" +"\EPOC32\RELEASE\ARMV5\UREL\calendarcontextplugin.dll" -"c:\sys\bin\calendarcontextplugin.dll" +"\epoc32\data\z\resource\plugins\calendarcontextplugin.rsc" -"c:\resource\plugins\calendarcontextplugin.rsc" +"\EPOC32\RELEASE\ARMV5\UREL\locationcontextplugin.dll" -"c:\sys\bin\locationcontextplugin.dll" +"\epoc32\data\z\resource\plugins\locationcontextplugin.rsc" -"c:\resource\plugins\locationcontextplugin.rsc" + +; clf wrapper +"\EPOC32\RELEASE\ARMV5\UREL\MediaCollectionManager.dll" -"c:\sys\bin\MediaCollectionManager.dll" +"\EPOC32\RELEASE\ARMV5\UREL\ContentListingFramework.dll" -"c:\sys\bin\ContentListingFramework.dll" + +; blacklist +"\EPOC32\RELEASE\ARMV5\UREL\!blacklistserver.exe" -"c:\sys\bin\!blacklistserver.exe" +"\EPOC32\RELEASE\ARMV5\UREL\blacklistclient.dll" -"c:\sys\bin\blacklistclient.dll" + +; composer plugins +"\epoc32\RELEASE\armv5\UREL\composerplugininterface.dll"-"c:\sys\bin\composerplugininterface.dll" +"\epoc32\RELEASE\armv5\UREL\composerimageplugin.dll"-"c:\sys\bin\composerimageplugin.dll" +"\epoc32\data\z\resource\plugins\composerimageplugin.rsc"-"c:\resource\plugins\composerimageplugin.rsc" + +; harvester +"\epoc32\RELEASE\armv5\UREL\harvesterclient.dll" -"c:\sys\bin\harvesterclient.dll" +"\epoc32\RELEASE\armv5\UREL\harvestercommon.dll" -"c:\sys\bin\harvestercommon.dll" +"\epoc32\RELEASE\armv5\UREL\harvesterdata.dll" -"c:\sys\bin\harvesterdata.dll" +"\epoc32\RELEASE\armv5\UREL\harvesterplugininterface.dll" -"c:\sys\bin\harvesterplugininterface.dll" +"\epoc32\RELEASE\armv5\UREL\harvesterserver.exe" -"c:\sys\bin\harvesterserver.exe" + +; harvester plugins +"\epoc32\RELEASE\armv5\UREL\harvesteraudioplugin.dll"-"c:\sys\bin\harvesteraudioplugin.dll" +"\epoc32\data\z\resource\plugins\harvesteraudioplugin.rsc"-"c:\resource\plugins\harvesteraudioplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\harvesterimageplugin.dll"-"c:\sys\bin\harvesterimageplugin.dll" +"\epoc32\data\z\resource\plugins\harvesterimageplugin.rsc"-"c:\resource\plugins\harvesterimageplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\harvestermessageplugin.dll"-"c:\sys\bin\harvestermessageplugin.dll" +"\epoc32\data\z\resource\plugins\harvestermessageplugin.rsc"-"c:\resource\plugins\harvestermessageplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\harvesteromadrmplugin.dll"-"c:\sys\bin\harvesteromadrmplugin.dll" +"\epoc32\data\z\resource\plugins\harvesteromadrmplugin.rsc"-"c:\resource\plugins\harvesteromadrmplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\harvesterrtpplugin.dll"-"c:\sys\bin\harvesterrtpplugin.dll" +"\epoc32\data\z\resource\plugins\harvesterrtpplugin.rsc"-"c:\resource\plugins\harvesterrtpplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\harvestervideoplugin.dll"-"c:\sys\bin\harvestervideoplugin.dll" +"\epoc32\data\z\resource\plugins\harvestervideoplugin.rsc"-"c:\resource\plugins\harvestervideoplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\harvesterwmvplugin.dll"-"c:\sys\bin\harvesterwmvplugin.dll" +"\epoc32\data\z\resource\plugins\harvesterwmvplugin.rsc"-"c:\resource\plugins\harvesterwmvplugin.rsc" + +; monitor plugins +"\epoc32\RELEASE\armv5\UREL\monitorplugininterface.dll"-"c:\sys\bin\monitorplugininterface.dll" +"\epoc32\RELEASE\armv5\UREL\mdsfileserverplugin.pxt"-"c:\sys\bin\mdsfileserverplugin.pxt" +"\epoc32\RELEASE\armv5\UREL\filemonitorplugin.dll"-"c:\sys\bin\filemonitorplugin.dll" +"\epoc32\data\z\resource\plugins\filemonitorplugin.rsc"-"c:\resource\plugins\filemonitorplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\MessageMonitorPlugin.dll"-"c:\sys\bin\MessageMonitorPlugin.dll" +"\epoc32\data\z\resource\plugins\MessageMonitorPlugin.rsc"-"c:\resource\plugins\MessageMonitorPlugin.rsc" +"\epoc32\RELEASE\armv5\UREL\mmcmonitorplugin.dll"-"c:\sys\bin\mmcmonitorplugin.dll" +"\epoc32\data\z\resource\plugins\mmcmonitorplugin.rsc"-"c:\resource\plugins\mmcmonitorplugin.rsc" +"\epoc32\RELEASE\armv5\UREL\mdsoomplugin.dll"-"c:\sys\bin\mdsoomplugin.dll" +"\epoc32\data\z\resource\plugins\mdsoomplugin.rsc"-"c:\resource\plugins\mdsoomplugin.rsc" + +; location manager +"\EPOC32\RELEASE\ARMV5\UREL\LocationTrail.dll" -"c:\sys\bin\LocationTrail.dll" +"\EPOC32\RELEASE\ARMV5\UREL\locationmanager.dll" -"c:\sys\bin\locationmanager.dll" +"\EPOC32\RELEASE\ARMV5\UREL\locationmanagerserver.exe" -"c:\sys\bin\locationmanagerserver.exe" +"\EPOC32\RELEASE\ARMV5\UREL\geoconverter.dll" -"c:\sys\bin\geoconverter.dll" + +; metadata engine +"\EPOC32\RELEASE\ARMV5\UREL\mdeclient.dll" -"c:\sys\bin\mdeclient.dll" +"\EPOC32\RELEASE\ARMV5\UREL\mdccommon.dll" -"c:\sys\bin\mdccommon.dll" +"\EPOC32\RELEASE\ARMV5\UREL\!mdsserver.exe" -"c:\sys\bin\!mdsserver.exe" + +"\epoc32\release\armv5\udeb\mdswatchdog.exe"-"c:\sys\bin\mdswatchdog.exe" + +"\epoc32\data\z\Private\200009F3\schema.mde"-"c:\PRIVATE\200009F3\schema.mde" +"\epoc32\data\z\Private\200009F3\defaultimportfile.mde"-"c:\PRIVATE\200009F3\defaultimportfile.mde" +"\epoc32\data\z\Private\200009F3\backup_registration.xml"-"c:\PRIVATE\200009F3\backup_registration.xml" +"\epoc32\data\z\Private\200009F5\backup_registration.xml"-"c:\PRIVATE\200009F5\backup_registration.xml" +"\epoc32\data\z\Private\200009F5\mappings.db"-"c:\PRIVATE\200009F5\mappings.db" + +"\epoc32\release\armv5\udeb\mdsiadrestart.exe"-"c:\sys\bin\mdsiadrestart.exe",FILERUN,RB,RW + diff -r bf039b7fe409 -r 3d9988ee47f5 sis/mds/package_separate.pkg --- a/sis/mds/package_separate.pkg Fri Jun 25 13:56:30 2010 +0100 +++ b/sis/mds/package_separate.pkg Thu Jul 22 16:38:01 2010 +0100 @@ -17,7 +17,7 @@ &EN ;packet-header (name, uid, major, minor, build, type) -#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 7, TYPE=SA, RU +#{"Metadata System Upgrade"},(0x200009F5), 10, 10, 10, TYPE=SA, RU ; Localised vendor name %{"Nokia"} diff -r bf039b7fe409 -r 3d9988ee47f5 sis/mds/stub.pkg --- a/sis/mds/stub.pkg Fri Jun 25 13:56:30 2010 +0100 +++ b/sis/mds/stub.pkg Thu Jul 22 16:38:01 2010 +0100 @@ -17,7 +17,7 @@ &EN ; Header -#{"Metadata System"}, (0x200009F5), 10, 10, 7, TYPE=SA +#{"Metadata System"}, (0x200009F5), 10, 10, 10, TYPE=SA ; Localised Vendor name %{"Nokia"} diff -r bf039b7fe409 -r 3d9988ee47f5 watchdog/src/watchdog.cpp --- a/watchdog/src/watchdog.cpp Fri Jun 25 13:56:30 2010 +0100 +++ b/watchdog/src/watchdog.cpp Thu Jul 22 16:38:01 2010 +0100 @@ -51,7 +51,7 @@ // --------------------------------------------------------------------------- // CWatchdog::CWatchdog() : - CActive( CActive::EPriorityLow ), iState(EIdle) + CActive( CActive::EPriorityStandard ), iState(EIdle) { // Add to active scheduler. CActiveScheduler::Add( this );