# HG changeset patch # User hgs # Date 1279894248 -19800 # Node ID e175e2ba2fb059ad52318de39446cdf681d999b2 # Parent 1a92308afc4699a4d5b8acd09b1df80d79bd2450 201029 diff -r 1a92308afc46 -r e175e2ba2fb0 landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/BWINS/FT_lmservlibu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/BWINS/FT_lmservlibu.def Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,13 @@ +EXPORTS + ??0RPosLandmarkServer@@QAE@XZ @ 1 NONAME ; RPosLandmarkServer::RPosLandmarkServer(void) + ?Close@RPosLandmarkServer@@QAEXXZ @ 2 NONAME ; void RPosLandmarkServer::Close(void) + ?Connect@RPosLandmarkServer@@QAEHXZ @ 3 NONAME ; int RPosLandmarkServer::Connect(void) + ?GetDatabaseInfo@RPosLandmarkServer@@QAEHAAVHPosLmDatabaseInfo@@@Z @ 4 NONAME ; int RPosLandmarkServer::GetDatabaseInfo(class HPosLmDatabaseInfo &) + ?ListDatabasesL@RPosLandmarkServer@@QAEXAAV?$RPointerArray@VHPosLmDatabaseInfo@@@@ABVTDesC16@@@Z @ 5 NONAME ; void RPosLandmarkServer::ListDatabasesL(class RPointerArray &, class TDesC16 const &) + ?ListDatabasesLC@RPosLandmarkServer@@QAEPAVCDesC16Array@@ABVTDesC16@@@Z @ 6 NONAME ; class CDesC16Array * RPosLandmarkServer::ListDatabasesLC(class TDesC16 const &) + ?ModifyDatabaseSettings@RPosLandmarkServer@@QAEHABVTDesC16@@ABVTPosLmDatabaseSettings@@VTChar@@@Z @ 7 NONAME ; int RPosLandmarkServer::ModifyDatabaseSettings(class TDesC16 const &, class TPosLmDatabaseSettings const &, class TChar) + ?RegisterDatabase@RPosLandmarkServer@@QAEHAAVHPosLmDatabaseInfo@@@Z @ 8 NONAME ; int RPosLandmarkServer::RegisterDatabase(class HPosLmDatabaseInfo &) + ?ReportEvent@RPosLandmarkServer@@QAEHABUTPosLmDatabaseEvent@@ABVTDesC16@@@Z @ 9 NONAME ; int RPosLandmarkServer::ReportEvent(struct TPosLmDatabaseEvent const &, class TDesC16 const &) + ?UnregisterAllDatabases@RPosLandmarkServer@@QAEHABVTDesC16@@@Z @ 10 NONAME ; int RPosLandmarkServer::UnregisterAllDatabases(class TDesC16 const &) + ?UnregisterDatabase@RPosLandmarkServer@@QAEHABVTDesC16@@VTChar@@@Z @ 11 NONAME ; int RPosLandmarkServer::UnregisterDatabase(class TDesC16 const &, class TChar) + diff -r 1a92308afc46 -r e175e2ba2fb0 landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/eabi/FT_lmservlibu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/eabi/FT_lmservlibu.def Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,14 @@ +EXPORTS + _ZN18RPosLandmarkServer11ReportEventERK19TPosLmDatabaseEventRK7TDesC16 @ 1 NONAME + _ZN18RPosLandmarkServer14ListDatabasesLER13RPointerArrayI18HPosLmDatabaseInfoERK7TDesC16 @ 2 NONAME + _ZN18RPosLandmarkServer15GetDatabaseInfoER18HPosLmDatabaseInfo @ 3 NONAME + _ZN18RPosLandmarkServer15ListDatabasesLCERK7TDesC16 @ 4 NONAME + _ZN18RPosLandmarkServer16RegisterDatabaseER18HPosLmDatabaseInfo @ 5 NONAME + _ZN18RPosLandmarkServer18UnregisterDatabaseERK7TDesC165TChar @ 6 NONAME + _ZN18RPosLandmarkServer22ModifyDatabaseSettingsERK7TDesC16RK22TPosLmDatabaseSettings5TChar @ 7 NONAME + _ZN18RPosLandmarkServer22UnregisterAllDatabasesERK7TDesC16 @ 8 NONAME + _ZN18RPosLandmarkServer5CloseEv @ 9 NONAME + _ZN18RPosLandmarkServer7ConnectEv @ 10 NONAME + _ZN18RPosLandmarkServerC1Ev @ 11 NONAME + _ZN18RPosLandmarkServerC2Ev @ 12 NONAME + diff -r 1a92308afc46 -r e175e2ba2fb0 landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/group/ABLD.BAT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/group/ABLD.BAT Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,31 @@ +rem +rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +rem All rights reserved. +rem This component and the accompanying materials are made available +rem under the terms of the License "Symbian Foundation License v1.0" +rem which accompanies this distribution, and is available +rem at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +rem +rem Initial Contributors: +rem Nokia Corporation - initial contribution. +rem +rem Contributors: +rem +rem Description: +rem + +@ECHO OFF + +REM Bldmake-generated batch file - ABLD.BAT +REM ** DO NOT EDIT ** + +perl -S ABLD.PL "\work\mrt\TestProvider\ServerClientLib\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 +if errorlevel==1 goto CheckPerl +goto End + +:CheckPerl +perl -v >NUL +if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? +goto End + +:End diff -r 1a92308afc46 -r e175e2ba2fb0 landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/group/FT_LmServerClientLibrary.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/group/FT_LmServerClientLibrary.mmp Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2005 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 is the project specification file for Landmarks Server +* Client Library. +* +*/ + +#include + +TARGET FT_lmservlib.dll +TARGETTYPE dll +//UID 0x1000008d 0x101fe97a +UID 0x1000008d 0x03132019 + +//VENDORID VID_DEFAULT +//CAPABILITY CAP_CLIENT_DLL +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE FT_RPosLandmarkServer.cpp + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE /Epoc32/Include + + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY estor.lib +LIBRARY eposlmdbmanlib.lib + + +SMPSAFE + +// End of File diff -r 1a92308afc46 -r e175e2ba2fb0 landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/group/bld.inf Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2005 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 info file for Landmarks Server Client Library +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + + +PRJ_MMPFILES +FT_LmServerClientLibrary.mmp + diff -r 1a92308afc46 -r e175e2ba2fb0 landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/inc/FT_PosLmServerCommon.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/inc/FT_PosLmServerCommon.h Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2005 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 POSLMSERVERCOMMON_H +#define POSLMSERVERCOMMON_H + +#include "FT_PosLmServerDefs.h" + +// CONSTANTS +const TUint KPosLmServerEventArg = 0; +const TUint KPosLmServerDbManEventArg =0; +const TUint KPosLmServerUriArg = 0; +const TUint KPosLmServerUriLengthArg = 1; +const TUint KPosLmServerDbReplaceArg = 1; +const TUint KPosLmServerProtocolArg = 0; +const TUint KPosLmServerSourceUriArg = 0; +const TUint KPosLmServerDbInfoArg = 0; +const TUint KPosLmServerTargetUriArg = 1; + +const TUint KPosLmServerDbManUriArg = 1; +const TUint KPosLmServerDriveArg = 1; +const TUint KPosLmServerBufferArg = 1; +const TUint KPosLmServerDbEventArg = 1; + +const TUint KPosLmServerAllocLengthArg =2; +const TUint KPosLmServerDbSettingsArg =2; + +const TUint KPosLmServerStatusArg = 0; +const TUint KPosLmServerProgressArg = 1; +const TUint KPosLmServerInitFlagArg = 2; + +const TUint KPosLmServerDbLockSetOnArg = 0; +const TUint KPosLmServerDbLockSetWriteArg = 1; + +/** +* Possible messages to be sent between client and server. +*/ +enum TPosLmServerMessage + { + // NOTE! + // If you add a new message here, it must also be added + // to the policy handling in the CPosLmServer class. + + EPosLmServerInitializeSync = 0, + EPosLmServerInitializeAsync, + EPosLmServerInitializeCancel, + EPosLmServerLangSwitchSync, + EPosLmServerLangSwitchAsync, + EPosLmServerLangSwitchCancel, + EPosLmServerRecoverSync, + EPosLmServerRecoverAsync, + EPosLmServerRecoverCancel, + EPosLmServerListenForLmEvent, + EPosLmServerCancelListenForLmEvent, + EPosLmServerListenForDbEvent, + EPosLmServerCancelListenForDbEvent, + EPosLmServerUriFromLastEvent, + EPosLmServerCreateDefaultDb, + EPosLmServerListDatabaseUris, + EPosLmServerRemainingDatabaseUris, + EPosLmServerListDatabaseInfo, + EPosLmServerRemainingDatabaseInfo, + EPosLmServerReadDatabaseSettings, + // The IPC messages above requires capability ReadUserData. + + EPosLmServerRegisterSession, + EPosLmServerRegisterLocalAccessSubsession, + EPosLmServerRegisterEventListenerSubsession, + EPosLmServerRegisterLocalDbManSubsession, + EPosLmServerUnregisterSubsession, + // The IPC messages above requires NO capabilities. + + EPosLmServerDbLock, + // The IPC message above requires a custom check. + // Read lock requires: ReadUserData + // Write lock requires: ReadUserData, WriteUserData + + EPosLmServerCreateDatabase, + EPosLmServerDeleteDatabase, + EPosLmServerCopyDatabase, + EPosLmServerRegisterDatabase, + EPosLmServerUnregisterDatabase, + EPosLmServerUnregisterAllDatabases, + EPosLmServerModifyDatabaseSettings, + EPosLmServerReportLmEvent, + EPosLmServerReportDbEvent, + EPosLmServerFreeResources, + // The IPC messages above requires capability ReadUserData and WriteUserData + + EPosLmServerLast + }; + + +#endif // POSLMSERVERCOMMON_H + +// End of File + diff -r 1a92308afc46 -r e175e2ba2fb0 landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/inc/FT_PosLmServerDefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/inc/FT_PosLmServerDefs.h Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2005 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 POSLMSERVERDEFS_H +#define POSLMSERVERDEFS_H + +// CONSTANTS +_LIT(KPosLandmarksServerName, "!eposlmserver"); + +const TUint KPosLmServerMajorVersionNumber = 1; +const TUint KPosLmServerMinorVersionNumber = 0; +const TUint KPosLmServerBuildVersionNumber = 0; + +#endif // POSLMSERVERDEFS_H + +// End of File diff -r 1a92308afc46 -r e175e2ba2fb0 landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/inc/FT_RPosLandmarkServer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/inc/FT_RPosLandmarkServer.h Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,285 @@ +/* +* Copyright (c) 2005 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 RPOSLANDMARKSERVER_H +#define RPOSLANDMARKSERVER_H + +// INCLUDES +#include +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CPosLandmarkServerExtension; + +// CLASS DECLARATION + +/** +* Client API for the landmark server. +* +* @lib eposlmservlib.lib +* @since S60 3.0 +* @version $Revision: 1.4 $, $Date: 2005/07/07 13:40:03 $ +*/ +class RPosLandmarkServer : public RSessionBase + { + public: // Constructors and destructor + + /** + * C++ default constructor. + */ + IMPORT_C RPosLandmarkServer(); + + public: // New functions + + + /** + * Connect to the landmark server. + * + * The server is started if it is not already running. + * + * This function requires @p ReadUserData capability. + * + * @since S60 3.0 + * @return @p KErrNone if successful, otherwise a system-wide error + * code. + */ + IMPORT_C TInt Connect(); + + /** + * Closes the session to the server + * + * @since S60 3.0 + */ + IMPORT_C void Close(); + + /** + * Lists all URIs in the server's database registry for a certain + * protocol. + * + * The client specifies a protocol string as input to this function. + * The function only returns a list of the databases which are + * accessed through this protocol. + * + * The client takes ownership of the returned array. + * + * This function requires @p ReadUserData capability. + * + * @since S60 3.0 + * @param aProtocol The protocol for which database URIs should be + * listed. + * @return The list of database URIs. + */ + IMPORT_C CDesCArray* ListDatabasesLC( + /* IN */ const TDesC& aProtocol + ); + + /** + * Lists information about each landmark database in the + * server's database registry. + * + * The client specifies a protocol string as input to this function. + * The function only returns information about the databases + * which are accessed through this protocol. + * + * The client specifies an array which is populated by this function. + * The client takes ownership of all information objects in the array. + * + * This function requires @p ReadUserData capability. + * + * @since S60 3.0 + * @param aDatabaseInfoArray On return, contains information about + * the landmark databases. Any objects which are in the array when + * it is passed to this function will be not be removed. + * @param aProtocol The protocol for which database URIs should be + * listed. + */ + IMPORT_C void ListDatabasesL( + /* OUT */ RPointerArray& aDatabaseInfoArray, + /* IN */ const TDesC& aProtocol = KNullDesC + ); + + /** + * Registers a landmark database. + * + * The landmark database is then returned when listing landmark + * databases. + * + * The client supplies an information object containing the URI of the + * database to register. The information object can also contain + * database settings, e.g. a display name for the database. + * + * This function requires @p ReadUserData and @p WriteUserData + * capabilities. + * + * @since S60 3.0 + * @param aDatabaseInfo Information about the landmark database to + * register. + * @return @p KErrNone if successful.\n + * @p KErrArgument if the URI is incorrect.\n + * @p KErrAlreadyExists if the database has already been registered. + */ + IMPORT_C TInt RegisterDatabase( + /* IN/OUT */ HPosLmDatabaseInfo& aDatabaseInfo + ); + + /** + * Unregisters a landmark database. + * + * After this, the landmark database will not be returned when listing + * landmark databases. + * + * If the database has not been registered, nothing happens. + * + * This function requires @p ReadUserData and @p WriteUserData + * capabilities. + * + * @since S60 3.0 + * @param aDatabaseUri The URI of the database to unregister. + * @param aDriveLetter The drive where the database resides. If + * drive is not applicable, 0 should be specified. + * @return @p KErrNone if successful.\n + * @p KErrArgument if the URI is incorrect. + */ + IMPORT_C TInt UnregisterDatabase( + /* IN */ const TDesC& aDatabaseUri, + /* IN */ TChar aDriveLetter = 0 + ); + + /** + * Unregisters all landmark databases which are accessed through a + * certain protocol. + * + * After this, the landmark databases will not be returned when listing + * landmark databases. + * + * If the protocol is not known or if there are no databases for + * the protocol, nothing happens. + * + * This function requires @p ReadUserData and @p WriteUserData + * capabilities. + * + * @since S60 3.0 + * @param aProtocol The protocol to unregister all databases for. + * @return @p KErrNone if successful, otherwise a system-wide error + * code. + */ + IMPORT_C TInt UnregisterAllDatabases( + /* IN */ const TDesC& aProtocol + ); + + /** + * Modifies the settings for a landmark database. + * + * This function requires @p ReadUserData and @p WriteUserData + * capabilities. + * + * @since S60 3.0 + * @param aDatabaseUri The URI of the database to modify settings for. + * @param aDatabaseSettings The new settings for the database. + * @param aDriveLetter The drive where the database resides. If + * drive is not applicable, 0 should be specified. + * @return @p KErrNone if successful.\n + * @p KErrArgument if the URI is incorrect.\n + * @p KErrNotFound if the URI does not exist in the registry. + */ + IMPORT_C TInt ModifyDatabaseSettings( + /* IN */ const TDesC& aDatabaseUri, + /* IN */ const TPosLmDatabaseSettings& aDatabaseSettings, + /* IN */ TChar aDriveLetter = 0 + ); + + /** + * Retrieve information about a landmark database. + * + * This function requires @p ReadUserData capability. + * + * @since S60 3.0 + * @param aDatabaseInfo An information object containing the URI of the + * landmark database. On return, the object contains information about + * the landmark database, including any database settings. + * @return @p KErrNone if successful.\n + * @p KErrArgument if the URI is incorrect.\n + * @p KErrNotFound if the URI does not exist in the registry. + */ + IMPORT_C TInt GetDatabaseInfo( + /* IN/OUT */ HPosLmDatabaseInfo& aDatabaseInfo + ); + + /** + * Reports a database management event. + * + * The event is distributed to all listening clients. + * + * A database URI can be specified to indicate which database the + * event is about. + * + * This function requires @p ReadUserData and @p WriteUserData + * capabilities. + * + * @since S60 3.0 + * @param aEvent Event information + * @param aDatabaseUri The URI of the database which the event is about. + * @return @p KErrNone if successful, otherwise a system-wide error + * code. + */ + IMPORT_C TInt ReportEvent( + /* IN */ const TPosLmDatabaseEvent& aEvent, + /* IN */ const TDesC& aDatabaseUri = KNullDesC + ); + + private: + + HBufC8* SendMessageLC( + /* IN */ TInt aFunction, + /* IN */ const TDesC& aDes, + /* IN */ TInt aLength, + /* IN/OUT */ TInt& aAllocLength + ); + + void PopulateArrayL( + /* OUT */ RPointerArray& aDatabaseInfoArray, + /* IN */ HBufC8* aBuffer + ); + + void PopulateArrayL( + /* OUT */ CDesCArray* aArray, + /* IN */ HBufC8* aBuffer + ); + + void FreeResources(); + + static void FreeRsc(TAny* aParam); + /** + * Starts the server. + * + * @return KErrNone on success, otherwise any system wide error. + */ + TInt StartServer(); + + private: // Data + + CPosLandmarkServerExtension* iExtension; + }; + +#endif // RPOSLANDMARKSERVER_H + +// End of File diff -r 1a92308afc46 -r e175e2ba2fb0 landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/src/FT_RPosLandmarkServer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/landmarks/locationlandmarks/tsrc/LandmarkTestModule/TestProvider/ServerClientLib/src/FT_RPosLandmarkServer.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,401 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +* +*/ + + +// INCLUDE FILES +#include +#include "FT_PosLmServerCommon.h" +#include "FT_RPosLandmarkServer.h" + +// CONSTANTS +const TInt KDefaultMessageSlots = 4; +const TInt KPosLmNumberOfTrials = 5; +const TUid KLandmarksServerUid = { 0x101fdf81 }; +const TInt KGranularity = 10; +const TInt KPreAllocLengthURI = 1024; +const TInt KPreAllocLengthDbInfo = 2048; + +_LIT(KPosLandmarksServerImg, "EPosLmServer"); + + + +// ============================ MEMBER FUNCTIONS =============================== + +// C++ default constructor can NOT contain any code, that +// might leave. +// +EXPORT_C RPosLandmarkServer::RPosLandmarkServer() : + RSessionBase(), + iExtension(NULL) + { + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::Connect +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RPosLandmarkServer::Connect() + { + TBool retrying = ETrue; + TInt counter = KPosLmNumberOfTrials; + TInt err; + + + while (retrying && counter > 0) + { + err = CreateSession( + KPosLandmarksServerName, + TVersion( + KPosLmServerMajorVersionNumber, + KPosLmServerMinorVersionNumber, + KPosLmServerBuildVersionNumber), + KDefaultMessageSlots); + + if (err != KErrNotFound && err != KErrServerTerminated) + { + // Session is up. + retrying = EFalse; + } + else if (--counter > 0) + { + err = StartServer(); + + if (err != KErrAlreadyExists && err != KErrNone) + { + // Server returned error code other than + // KErrAlreadyExists or KErrNone. The client should + // receive this code. + retrying = EFalse; + } + } + } + + return err; + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::Close +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RPosLandmarkServer::Close() + { + RSessionBase::Close(); + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::ListDatabasesLC +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C CDesCArray* RPosLandmarkServer::ListDatabasesLC( + const TDesC& aProtocol) + { + TInt allocLength = 0; + CDesCArray* array = new (ELeave) CDesCArrayFlat(KGranularity); + CleanupStack::PushL(array); + + CleanupStack::PushL(TCleanupItem(*FreeRsc, this)); + + HBufC8* buffer = SendMessageLC(EPosLmServerListDatabaseUris, + aProtocol, KPreAllocLengthURI, allocLength); + + PopulateArrayL(array, buffer); + CleanupStack::PopAndDestroy(buffer); + CleanupStack::Pop(); //FreeRsc + + if (allocLength > 0) + { + buffer = SendMessageLC(EPosLmServerRemainingDatabaseUris, + KNullDesC, allocLength, allocLength); + PopulateArrayL(array, buffer); + CleanupStack::PopAndDestroy(buffer); + } + return array; + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::ListDatabasesL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C void RPosLandmarkServer::ListDatabasesL( + RPointerArray& aDatabaseInfoArray, + const TDesC& aProtocol) + { + CleanupStack::PushL(TCleanupItem(*FreeRsc, this)); + + TInt allocLength = 0; + HBufC8* buffer = SendMessageLC(EPosLmServerListDatabaseInfo, + aProtocol, KPreAllocLengthDbInfo, allocLength); + + PopulateArrayL(aDatabaseInfoArray, buffer); + CleanupStack::PopAndDestroy(buffer); + CleanupStack::Pop(); //FreeRsc + + if (allocLength > 0) + { + buffer = SendMessageLC(EPosLmServerRemainingDatabaseInfo, + KNullDesC, allocLength, allocLength); + PopulateArrayL(aDatabaseInfoArray, buffer); + CleanupStack::PopAndDestroy(buffer); + } + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::RegisterDatabase +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RPosLandmarkServer::RegisterDatabase( + HPosLmDatabaseInfo& aDatabaseInfo) + { + TInt size = aDatabaseInfo.Size(); + TPtr8 ptr(reinterpret_cast(&aDatabaseInfo), size, size); + + return SendReceive(EPosLmServerRegisterDatabase, TIpcArgs(&ptr)); + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::UnregisterDatabase +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RPosLandmarkServer::UnregisterDatabase( + const TDesC& aDatabaseUri, + TChar aDriveLetter) + { + TPckgC drivePckg(aDriveLetter); + return SendReceive(EPosLmServerUnregisterDatabase, + TIpcArgs(&aDatabaseUri, &drivePckg)); + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::UnregisterAllDatabases +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RPosLandmarkServer::UnregisterAllDatabases( + const TDesC& aProtocol) + { + return SendReceive(EPosLmServerUnregisterAllDatabases, + TIpcArgs(&aProtocol)); + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::ModifyDatabaseSettings +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RPosLandmarkServer::ModifyDatabaseSettings( + const TDesC& aDatabaseUri, + const TPosLmDatabaseSettings& aDatabaseSettings, + TChar aDriveLetter) + { + TPckgC drivePckg(aDriveLetter); + TPckgC settingsPckg(aDatabaseSettings); + + return SendReceive(EPosLmServerModifyDatabaseSettings, + TIpcArgs(&aDatabaseUri, &drivePckg, &settingsPckg)); + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::GetDatabaseInfo +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RPosLandmarkServer::GetDatabaseInfo( + HPosLmDatabaseInfo& aDatabaseInfo) + { + TInt size = aDatabaseInfo.Size(); + TPtr8 ptr(reinterpret_cast(&aDatabaseInfo), size, size); + + return SendReceive( + EPosLmServerReadDatabaseSettings, TIpcArgs(&ptr)); + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::ReportEvent +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt RPosLandmarkServer::ReportEvent( + const TPosLmDatabaseEvent& aEvent, + const TDesC& aDatabaseUri) + { + TPckgC eventPckg(aEvent); + + return SendReceive(EPosLmServerReportDbEvent, + TIpcArgs(&aDatabaseUri, &eventPckg)); + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::StartServer +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt RPosLandmarkServer::StartServer() + { + TRequestStatus started; + + const TUidType serverUid(KNullUid, KNullUid, KLandmarksServerUid); + + /** + EPOC is easy, we just create a new server process. Simultaneous launching + of two such processes should be detected when the second one attempts to + create the server object, failing with KErrAlreadyExists. + **/ + RProcess server; + TInt ret = server.Create(KPosLandmarksServerImg, KNullDesC, serverUid); + + if (ret != KErrNone) + { + return ret; + } + + server.Rendezvous(started); + // + // logon OK - start the server + server.Resume(); + + User::WaitForRequest(started); // wait for start or death + + server.Close(); + + return started.Int(); + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::SendMessageLC +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +HBufC8* RPosLandmarkServer::SendMessageLC( + TInt aFunction, + const TDesC& aDes, + TInt aLength, + TInt& aAllocLength) + { + HBufC8* buffer = HBufC8::NewLC(aLength); + TPtr8 bufPtr = buffer->Des(); + + TPckg allocPckg(aAllocLength); + User::LeaveIfError(SendReceive(aFunction, + TIpcArgs(&aDes, &bufPtr, &allocPckg))); + return buffer; + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::PopulateArrayL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void RPosLandmarkServer::PopulateArrayL( + CDesCArray* aArray, + HBufC8* aBuffer) + { + if (aBuffer->Length() > 0) + { + TUint8* bufPointer = const_cast(aBuffer->Ptr()); + const TUint8* endPointer = bufPointer + aBuffer->Size(); + while (bufPointer < endPointer) + { + TPckgBuf intPckg; + intPckg.Copy(bufPointer, intPckg.MaxLength()); + + TInt uriLength = intPckg(); + TInt uriSize = uriLength * 2; + bufPointer += intPckg.Size(); + HBufC* uri = HBufC::NewLC(uriSize); + uri->Des().SetLength(uriLength); + + TPtr8 uriPtr(reinterpret_cast( + const_cast(uri->Ptr())), uriSize, uriSize); + uriPtr.Copy(bufPointer, uriSize); + bufPointer += uriSize; + + aArray->AppendL(*uri); + CleanupStack::PopAndDestroy(uri); + } + } + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::PopulateArrayL +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void RPosLandmarkServer::PopulateArrayL( + RPointerArray& aDatabaseInfoArray, + HBufC8* aBuffer) + { + if (aBuffer->Length() > 0) + { + TInt currentLength = 0; + TInt bufferLength = aBuffer->Length(); + do { + TUint8* infoPtr = + const_cast(aBuffer->Ptr() + currentLength); + HPosLmDatabaseInfo* dbInfo = HPosLmDatabaseInfo::NewLC( + *(reinterpret_cast(infoPtr))); + + aDatabaseInfoArray.AppendL(dbInfo); + currentLength += dbInfo->Size(); + CleanupStack::Pop(dbInfo); + } while (currentLength < bufferLength); + } + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::FreeResources +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void RPosLandmarkServer::FreeResources() + { + SendReceive(EPosLmServerFreeResources, TIpcArgs(TIpcArgs::ENothing)); + } + +// ----------------------------------------------------------------------------- +// RPosLandmarkServer::FreeRsc +// +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void RPosLandmarkServer::FreeRsc(TAny* aParam) + { + reinterpret_cast(aParam)->FreeResources(); + } + +// End of File diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/posindicator/posindicatorplugin/posindicator.pro --- a/locationsystemui/locationsysui/posindicator/posindicatorplugin/posindicator.pro Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/posindicator/posindicatorplugin/posindicator.pro Fri Jul 23 19:40:48 2010 +0530 @@ -21,7 +21,6 @@ plugin MOC_DIR = moc OBJECTS_DIR = obj -RESOURCES += posindicatorplugin.qrc DEPENDPATH += . INCLUDEPATH += ../inc @@ -51,9 +50,5 @@ pluginstub.path = /resource/plugins/indicators DEPLOYMENT += pluginstub - # Add translation files - addFiles.sources = translations/lilocationmw.qm - addFiles.path = . - DEPLOYMENT += addFiles } diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/posindicator/posindicatorplugin/posindicatorplugin.qrc --- a/locationsystemui/locationsysui/posindicator/posindicatorplugin/posindicatorplugin.qrc Fri Jul 09 20:18:03 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - - translations/lilocationmw.qm - - diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/posindicator/posindicatorplugin/src/posindicator.cpp --- a/locationsystemui/locationsysui/posindicator/posindicatorplugin/src/posindicator.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/posindicator/posindicatorplugin/src/posindicator.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -51,16 +51,8 @@ QString locale = QLocale::system().name(); QString path = "z:/resource/qt/translations/"; - bool loaded = false; - loaded = mTranslator->load(path + QString("lilocationmw_") + locale); - if (loaded == false) - { - loaded = mTranslator->load("lilocationmw", ":/translations"); - } - if (loaded) - { - qApp->installTranslator(mTranslator); - } + mTranslator->load(path + QString("lilocationmw_") + locale); + qApp->installTranslator(mTranslator); mIndicatorTypes.append(typeOfIndicator); qDebug() << "- PosIndicatorPlugin::PosIndicatorPlugin()"; diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/posindicator/posindicatorplugin/translations/lilocationmw.qm Binary file locationsystemui/locationsysui/posindicator/posindicatorplugin/translations/lilocationmw.qm has changed diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/posindicator/posindicatorplugin/translations/lilocationmw.ts --- a/locationsystemui/locationsysui/posindicator/posindicatorplugin/translations/lilocationmw.ts Fri Jul 09 20:18:03 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,826 +0,0 @@ - - - - - - %1 is the name of the positioning server - Use %1 - - qtl_checkbox_sec - loe_008 - list - lo - False - - - Button for accessing settings in control palel - Settings - - txt_lint_button_settings - loe_002 - button - lo - False - - - Update interval value when update happens in seconds (59s or less) - Updates every %L1 seconds - - qtl_list_sec - loe_008 - list - lo - False - - - Coordinate value - %L1˚%L2'%L3.%L4"E - - txt_loe_list_l1l2l3l4e - loe_002 - list - lo - False - - - Location request query dialog - Softkey button. Allows the user to reject the suggested operation. - Reject - - qtl_dialog_softkey - common - button - co - False - - - Update interval. - Updates every %L1 day and %L2 hour - - qtl_list_sec - loe_008 - list - lo - False - - - Button. Note! Use this text ID only if there are max. two buttons in the dialog. Allows the user to cancel the action or process. - Cancel - - qtl_dialog_softkey_2 - common - button - co - False - - - Update interval. - Updates every %L1 hour and %L2 minute - - qtl_list_sec - loe_008 - list - lo - False - - - Wi-FI - enable/disable wifi usage in positioning context - Wi-Fi - - qtl_checkbox_sec - loe_008 - list - lo - False - - - Update interval. - Updates every %L1 minute and %L2 second - - qtl_list_sec - loe_008 - list - lo - False - - - Description text for GPS under the checkbox item - Enable for most accurate positioning - - qtl_dataform_description_sec - loe_007 - info - lo - False - - - %L1 = Accuracy information in kilometers. Displayed when over 999 meters - Accuracy: %Ln kilometers - - txt_lint_list_accuracy_1_kilometers - loe_002 - list - lo - False - - - Assisted GPS - enabling or disabling - Assisted GPS - - qtl_checkbox_sec - loe_008 - list - lo - False - - - subtitle for positioning settings main view - Positioning settings - - qtl_groupbox_simple_sec - loe_007 - subtitle - lo - False - - - Requestor info text in Location request query dialog - Location was requested by : - - qtl_dialog_pri5 - loe_013 - info - lo - False - - - %1 is the date value until the service is active/available - Valid until %1 - - qtl_list_sec - loe_008 - list - lo - False - - - Multiline secondary text in a list item. %1 is the name of the service - Your location not sent to: %1 - - qtl_list_sec - loe_018 - list - lo - False - - - Update interval. - Updates every %L1 hour and %L2 minutes - - qtl_list_sec - loe_008 - list - lo - False - - - Checkbox item for enabling/disabling Background positioning - Background positioning - - qtl_checkbox_sec - loe_007 - list - lo - False - - - Update interval. - Updates every %L1 hours and %L2 minute - - qtl_list_sec - loe_008 - list - lo - False - - - update interval value - Updates every %Ln months - - qtl_list_sec - loe_008 - list - lo - False - - - Update interval. - Updates every %L1 minutes and %L2 second - - qtl_list_sec - loe_008 - list - lo - False - - - Coordinate value - %L1˚%L2'%L3.%L4"N - - txt_loe_list_l1l2l3l4n - loe_002 - list - lo - False - - - Update interval. - Updates every %L1 months and %L2 days - - qtl_list_sec - loe_008 - list - lo - False - - - Multiline secondary text in a list item. %1 is the name of the service - Your location sent to : %1 - - qtl_list_sec - loe_018 - list - lo - False - - - Multiline secondary text in a list item for periodic location notifiers. %1 is the name of the service. %Ln indicates how many times the location has been sent to %1. Example text : Your location sent to Nokia , Friends finder 6 times - Your location sent to %1 %Ln times - - qtl_list_sec - loe_018 - list - lo - False - - - Update interval. - Updates every %L1 month and %L2 days - - qtl_list_sec - loe_008 - list - lo - False - - - If the requestor is unknown, this text string should be shown to the user. - Unknown requestor - - qtl_dialog_pri5 - loe_013 - info - lo - False - - - Update interval. - Updates every %L1 hours and %L2 minutes - - qtl_list_sec - loe_008 - list - lo - False - - - Info text for periodic location request query - No default policy - You location will be shared periodically with : - - qtl_dialog_pri5 - loe_014 - info - lo - False - - - UniversalIndicatorMenu item text. - Positioning - - qtl_indimenu_pri_medium_graphic - loe_001 - dblist_1 - lo - False - - - Button in dialog for closing the Positioning info dialog - Done - - qtl_dialog_softkey_1 - loe_002 - button - lo - False - - - If there are more than one unknown requestor, this text string should be shown to the user. - %Ln Unknown requestors - - qtl_dialog_pri5 - loe_013 - info - lo - False - - - Confirmation about stopping service. %1 is the name of the service - Stop service %1 - - qtl_dialog_pri3_large_graphic - loe_010 - info - lo - False - - - Location notification heading text - Your location not sent to : - - qtl_notifdialog_pri - loe_016 - dpophead - lo - False - - - Update interval. - Updates every %L1 days and %L2 hour - - qtl_list_sec - loe_008 - list - lo - False - - - Location request query dialog - Softkey button. Allows the user to accept the location request - Accept - - qtl_dialog_softkey - loe_013 - button - lo - False - - - Button. Note! Use this text ID only if there are max. two buttons in the dialog. When this button is pressed, the focused item or operation will be selected or accepted. - OK - - qtl_dialog_softkey_2 - common - button - co - False - - - 2G/3G/etc network settings for positionin use - Cellular network - - qtl_checkbox_sec - loe_008 - list - lo - False - - - Option menu item - Delete server - - qtl_menu_pri - loe_008 - opt - lo - False - - - Sub heading text for Location notification logs view - Logs - - qtl_groupbox_simple_sec - loe_018 - subhead - lo - False - - - Button - takes to advanced positioning settings - Advanced - - qtl_dataform_button_sec - loe_007 - button - lo - False - - - Update interval. - Updates every %L1 days and %L2 hours - - qtl_list_sec - loe_008 - list - lo - False - - - Control panel item in CP main view - Change positioning settings - - qtl_list_sec_large_graphic - cp_001 - dblist_1_val - cp - False - - - %L1 = Accuracy information in meters. Displayed when value is 999 meters or less - Accuracy: %Ln meters - - txt_lint_accuracy_1_meters - loe_002 - list - lo - False - - - Location notification heading text - Your location sent to : - - qtl_notifdialog_pri - loe_016 - dpophead - lo - False - - - Group heading for positioning methods - Positioning methods - - qtl_groupbox_expand_pri - loe_008 - subtitle - lo - False - - - update interval value - Updates every %Ln hours - - qtl_list_sec - loe_008 - list - lo - False - - - Internal GPS chipset - enabling or disabling that - Internal GPS - - qtl_checkbox_sec - loe_008 - list - lo - False - - - Single toolbar item to clear logs in Location notification log view - Clear logs - - qtl_toolbar_tiny1 - loe_018 - button - lo - False - - - Description text for wireless networks under the checkbox item - Use only WI-FI and mobile networks to get position information - - qtl_dataform_description_sec - loe_007 - info - lo - False - - - Group heading positioning servers - Positioning servers - - qtl_groupbox_expand_pri - loe_008 - subtitle - lo - False - - - Save button for saving current position - Save - - txt_loe_button_save - loe_002 - button - lo - False - - - Dialog text for server deletion - Select server to delete - - qtl_dialog_pri3 - loe_011 - info - lo - False - - - Info text for periodic location request query (Default policy - Accept) - Your location will be shared periodically by default if you don’t respond. - - qtl_dialog_pri5 - loe_015 - info - lo - False - - - Button. Note! Use this text ID only if there are max. two buttons in the dialog. Allows the user to delete an item. Note that deleting removes the item permanently from memory. - Delete - - qtl_dialog_softkey_2 - common - button - co - False - - - Heading for the positioning info dialog - Positioning - - qtl_dialog_pri_heading - loe_001 - title - lo - False - - - Title text for Location notifications log view - Location notifications - - qtl_titlebar - loe_018 - title - lo - False - - - Info text for periodic location request query (Default policy - Reject) - Your location will not be shared periodically by default if you don't respond - - qtl_dialog_pri5 - loe_015 - info - lo - False - - - Group heading for location based services - Background positioning - - qtl_groupbox_expand_pri - loe_008 - subtitle - lo - False - - - Button - takes to advanced positioning settings - Advanced positioning settings - - qtl_groupbox_simple_sec - loe_008 - subtitle - lo - False - - - Info text for location request query - No default policy - Your location will be shared with : - - qtl_dialog_pri5 - loe_014 - info - lo - False - - - Location notification primarry text in Universal Indicator Menu - %Ln Location notifications - - qtl_indimenu_pri_medium_graphic - loe_017 - dblist_1 - lo - False - - - Info text in Location request query dialog (Default policy - Accept) - Your location will be shared by default if you don’t respond - - qtl_dialog_pri5 - loe_013 - info - lo - False - - - Checkbox item for enabling/disabling GPS - GPS - - qtl_checkbox_sec - loe_007 - list - lo - False - - - Info text in Location request query dialog (Default policy - Reject) - Your location will not be shared by default if you don’t respond - - qtl_dialog_pri5 - loe_013 - info - lo - False - - - Update interval. - Updates every %L1 day and %L2 hours - - qtl_list_sec - loe_008 - list - lo - False - - - Coordinate value - %L1˚%L2'%L3.%L4"W - - txt_loe_list_l1l2l3l4w - loe_002 - list - lo - False - - - Query header for save dialog - Save as - - qtl_dialog_pri_heading - loe_005 - title - lo - False - - - Bluetooth GPS - enabling/disabling external BT GPS device usage - Bluetooth GPS - - qtl_checkbox_sec - loe_008 - list - lo - False - - - Title text in Location request query dialog - Location request - - qtl_dialog_pri_heading - loe_013 - title - lo - False - - - Checkbox item for enabling/disabling Wireless positioning - Wireless networks - - qtl_checkbox_sec - loe_007 - list - lo - False - - - Control panel item in CP main view - Positioning - - qtl_list_pri_large_graphic - cp_001 - dblist_1 - cp - False - - - Update interval. - Updates every %L1 month and %L2 day - - qtl_list_sec - loe_008 - list - lo - False - - - Coordinate value - %L1˚%L2'%L3.%L4"S - - txt_loe_list_l1l2l3l4s - loe_002 - list - lo - False - - - update interval value - Updates every %Ln days - - qtl_list_sec - loe_008 - list - lo - False - - - Update interval. - Updates every %L1 minutes and %L2 seconds - - qtl_list_sec - loe_008 - list - lo - False - - - update interval value - Updates every %Ln minutes - - qtl_list_sec - loe_008 - list - lo - False - - - Description text for Location based services & background applications - Enable applications and services update and retrieve location information on the background - - qtl_dataform_description_sec - loe_007 - info - lo - False - - - Update interval. - Updates every %L1 months and %L2 day - - qtl_list_sec - loe_008 - list - lo - False - - - Update interval. - Updates every %L1 minute and %L2 seconds - - qtl_list_sec - loe_008 - list - lo - False - - - Universaln indicator menu. Secondary text when positioning is being acquired - Acquiring position - - qtl_indimenu_sec_medium_graphic - loe_001 - dblist_1_val - lo - False - - - diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/possettings/possettings.pro --- a/locationsystemui/locationsysui/possettings/possettings.pro Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/possettings/possettings.pro Fri Jul 23 19:40:48 2010 +0530 @@ -26,12 +26,13 @@ DEFINES += BUILD_POSSETTINGS +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + # Build.inf rules BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ "possettings_stub.sis /epoc32/data/z/system/install/possettings_stub.sis" \ "rom/possettings.iby CORE_MW_LAYER_IBY_EXPORT_PATH(possettings.iby)" \ - "rom/possettings_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(possettings_resources.iby)" \ "conf/positioningsettings.confml MW_LAYER_CONFML(positioningsettings.confml)" \ - "conf/positioningsettings_2002E685.crml MW_LAYER_CRML(positioningsettings_2002E685.crml)" - + "conf/positioningsettings_2002E685.crml MW_LAYER_CRML(positioningsettings_2002E685.crml)" \ + "rom/possettings_resources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(possettings_resources.iby)" \ No newline at end of file diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsengineprivate.cpp --- a/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsengineprivate.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsengineprivate.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -24,6 +24,17 @@ #include #include +// AGPS psy module UID +const TUid KAGPSPsyModuleID = + { + 0x101fe98c + }; +// NPP Psy module UID +const TUid KNPPPsyModuleID = + { + 0x10206915 + }; + //--------------------------------------------------------------------- // PosSettingsEnginePrivate::PosSettingsEnginePrivate() // (other items were commented in a header). @@ -256,6 +267,8 @@ //--------------------------------------------------------------------- void PosSettingsEnginePrivate::populatePsyModuleInfoListL() { + TBool agpsState = EFalse; + TBool nppState = EFalse; CPosModuleIdList* idList = mPosModules->ModuleIdListLC(); TInt cnt = idList->Count(); for ( TInt i = 0; i < cnt; ++i ) @@ -285,15 +298,49 @@ if( moduleInfo.IsAvailable() ) { psyModuleInfo.mState = StateEnable; + // capture the state of the agps psy module + if (moduleInfo.ModuleId() == KAGPSPsyModuleID) + { + agpsState = ETrue; + } + // capture the state of npp psy module + if (moduleInfo.ModuleId() == KNPPPsyModuleID) + { + nppState = ETrue; + } + } else { psyModuleInfo.mState = StateDisable; + // capture the state of the agps psy module + if (moduleInfo.ModuleId() == KAGPSPsyModuleID) + { + agpsState = EFalse; + } + // capture the state of npp psy module + if (moduleInfo.ModuleId() == KNPPPsyModuleID) + { + nppState = EFalse; + } } - mPsyModuleInfoList.Append( psyModuleInfo ); + mPsyModuleInfoList.AppendL( psyModuleInfo ); } - CleanupStack::PopAndDestroy( idList ); + // Check if the state of both agps & npp psy are disabled then turn off the supl trigger status + // else turn it back on again even if either is enabled + if (!agpsState && !nppState) + { + User::LeaveIfError(mSuplSettings->SetSuplTriggeredServiceStatus( + CSuplSettings::ESuplTriggerOff)); + } + else + { + User::LeaveIfError(mSuplSettings->SetSuplTriggeredServiceStatus( + CSuplSettings::ESuplTriggerOn)); + } + + CleanupStack::PopAndDestroy(idList); } diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsform.cpp --- a/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsform.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/possettings/possettingsengine/src/possettingsform.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -319,7 +319,7 @@ // So next time when we want to check if it is present, we have to create dummy modelitem // else with existing handle, we will get kern exec 3 error createPosTypeModelItem(posTypeModelItemIndex); - if(posTypeModelItem == mBgPosType) { + if(posTypeModelItemIndex == PosTypeIndexBackground) { mSettingsEngine.setBackGroundPositioningState(StateDisable); } } @@ -330,7 +330,7 @@ model->insertDataFormItem(posIndex,posTypeModelItem,model->invisibleRootItem()); addPosTypeConnection(posTypeModelItem); - if(posTypeModelItem == mBgPosType) { + if(posTypeModelItemIndex == PosTypeIndexBackground){ //Restore to old state in case of background positioning. if(mSettingsEngine.cRBackgroundPositioningStatus()) { mSettingsEngine.setBackGroundPositioningState(StateEnable); diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/possettings/possettingsplugin/possettingsplugin.pro --- a/locationsystemui/locationsysui/possettings/possettingsplugin/possettingsplugin.pro Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/possettingsplugin.pro Fri Jul 23 19:40:48 2010 +0530 @@ -28,8 +28,6 @@ MOC_DIR = moc OBJECTS_DIR = obj RCC_DIR = rcc -RESOURCES += possettingsplugin.qrc -TRANSLATIONS = lilocationmw.ts # Platforms SYMBIAN_PLATFORMS = WINSCW \ @@ -50,17 +48,15 @@ inc/possettingspluginhelper.h \ inc/possettingspluginhelper_p.h \ inc/apilogger.h - + + +TRANSLATIONS=lilocationmw.ts + symbian { TARGET.EPOCALLOWDLLDATA = 1 DEFINES += PLUGINUID3=0x2002C318 TARGET.UID3 = 0x2002C318 - # Add translation files - addFiles.sources = translations/possettings.qm - addFiles.path = . - #DEPLOYMENT += addFiles - deploy.path = C: qtplugins.path = /resource/qt/plugins/controlpanel qtplugins.sources += qmakepluginstubs/possettingsplugin.qtplugin diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/possettings/possettingsplugin/possettingsplugin.qrc --- a/locationsystemui/locationsysui/possettings/possettingsplugin/possettingsplugin.qrc Fri Jul 09 20:18:03 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - - translations/possettings.qm - - diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/possettings/possettingsplugin/src/possettingsplugin.cpp --- a/locationsystemui/locationsysui/possettings/possettingsplugin/src/possettingsplugin.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/possettings/possettingsplugin/src/possettingsplugin.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -43,16 +43,9 @@ QString lang = QLocale::system().name(); QString path = "z:/resource/qt/translations/"; - bool loaded = false; - loaded = mTranslator->load(path + QString("lilocationmw_") + lang); - if (loaded == false) - { - loaded = mTranslator->load("possettings", ":/translations"); - } - if (loaded) - { - qApp->installTranslator(mTranslator); - } + mTranslator->load(path + QString("lilocationmw_") + lang); + qApp->installTranslator(mTranslator); + qDebug() << "- PosSettingsPluginHelper::PosSettingsPlugin()"; } diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/possettings/possettingsplugin/translations/possettings.qm Binary file locationsystemui/locationsysui/possettings/possettingsplugin/translations/possettings.qm has changed diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/possettings/possettingsplugin/translations/possettings.ts --- a/locationsystemui/locationsysui/possettings/possettingsplugin/translations/possettings.ts Fri Jul 09 20:18:03 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,599 +0,0 @@ - - - - - - Info text for periodic location request query (Default policy - Reject) - Your location will not be shared periodically by default if you don't respond - Your location will not be shared periodically by default if you don't respond - qtl_dialog_pri5 - Location notifications_03 - info - Lo - False - - - Name of the positioning server - Use %1 - Use %1 - qtl_checkbox_sec - loe_008 - list - lo - False - - - 2G/3G/etc network settings for positionin use - Cellular network - Cellular network - qtl_checkbox_sec - loe_008 - list - lo - False - - - Option menu item - Delete server - Delete server - qtl_menu_pri - loe_008 - opt - lo - False - - - Button - takes to advanced positioning settings - Advanced - Advanced - qtl_dataform_button_sec - loe_007 - button - lo - False - - - Button for accessing settings in control palel - Settings - Settings - txt_lint_button_settings - loe_002 - button - lo - False - - - Update interval value when update happens in seconds (59s or less) - Updates every %L1 seconds - Updates every %L1 seconds - qtl_list_sec - loe_008 - list - lo - False - - - Coordinates - L1%?L2%'L3%.L4%"E - L1%?L2%'L3%.L4%"E - txt_loe_list_l1l2l3l4e - loe_002 - list - lo - False - - - Location request query dialog - Softkey button. Allows the user to reject the suggested operation. - Reject - Reject - qtl_dialog_softkey - common - button - co - False - - - Control panel item in CP main view - Change positioning settings - Change positioning settings - qtl_list_sec_large_graphic - cp_001 - dblist_1_val - cp - False - - - Update interval value when interval is in days - Updates every %L1 days and %L2 hours - Updates every %L1 days and %L2 hours - qtl_list_sec - loe_008 - list - lo - False - - - Accuracy information in meters. Displayed when value is 999 meters or less - Accuracy: %L1 meters - Accuracy: %L1 meters - txt_lint_accuracy_1_meters - loe_002 - list - lo - False - - - Group heading for positioning methods - Positioning methods - Positioning methods - qtl_groupbox_expand_pri - loe_008 - subtitle - lo - False - - - Button. Note! Use this text ID only if there are max. two buttons in the dialog. Allows the user to cancel the action or process. - Cancel - Cancel - None - common - button - co - False - - - Accuracy information in kilometers. Displayed when over 999 meters - Accuracy: %L1 kilometers - Accuracy: %L1 kilometers - txt_lint_list_accuracy_1_kilometers - loe_002 - list - lo - False - - - Primary text in list widget. Notification recieved time - <Time> - <Time> - qtl_list_pri - Location notifications_06 - list - Lo - False - - - Internal GPS chipset - enabling or disabling that - Internal GPS - Internal GPS - qtl_checkbox_sec - loe_008 - list - lo - False - - - Wi-FI - enable/disable wifi usage in positioning context - Wi-Fi - Wi-Fi - qtl_checkbox_sec - loe_008 - list - lo - False - - - Location notification heading text - Your location not sent to : - Your location not sent to : - qtl_notifdialog_pri - Location notifications_04 - dpophead - Lo - False - - - Description text for GPS under the checkbox item - Enable for most accurate positioning - Enable for most accurate positioning - qtl_dataform_description_sec - loe_007 - info - lo - False - - - Group heading positioning servers - Positioning servers - Positioning servers - qtl_groupbox_expand_pri - loe_008 - subtitle - lo - False - - - Description text for wireless networks under the checkbox item - Use WI-FI and mobile networks to get position information - Use WI-FI and mobile networks to get position information - qtl_dataform_description_sec - loe_007 - info - lo - False - - - Single toolbar item to clear logs in Location notification log view - Clear logs - Clear logs - qtl_toolbar_tiny1_1 - Location notifications_06 - button - Lo - False - - - Sub heading text for Location notification logs view - Logs - Logs - qtl_groupbox_simple_sec - Location notifications_06 - subhead - Lo - False - - - Save button for saving current position - Save - Save - txt_loe_button_save - loe_002 - button - lo - False - - - Dialog text for server deletion - Select server to delete - Select server to delete - qtl_dialog_pri3 - loe_011 - info - lo - False - - - Button. Note! Use this text ID only if there are max. two buttons in the dialog. Allows the user to delete an item. Note that deleting removes the item permanently from memory. - Delete - Delete - None - common - button - co - False - - - value that tells the date until service will be active - Valid until %2 - Valid until %2 - qtl_list_sec - loe_008 - list - lo - False - - - Heading for the positioning info dialog - Positioning - Positioning - qtl_dialog_pri_heading - loe_001 - title - lo - False - - - Location notification primarry text in Universal Indicator Menu - %Ln Location notifications - - (s)%Ln Location notifications - (p)%Ln Location notifications - - qtl_indimenu_pri_medium_graphic - Location notifications_05 - dblist_1 - Lo - False - - - Assisted GPS - enabling or disabling - Assisted GPS - Assisted GPS - qtl_checkbox_sec - loe_008 - list - lo - False - - - Group heading for location based services - Background positioning - Background positioning - qtl_groupbox_expand_pri - loe_008 - subtitle - lo - False - - - subtitle for positioning settings main view - Positioning settings - Positioning settings - qtl_groupbox_simple_sec - loe_007 - subtitle - lo - False - - - Requestor info text in Location request query dialog - Location was requested by : - Location was requested by : - qtl_dialog_pri5 - Location notifications_01 - info - Lo - False - - - Button - takes to advanced positioning settings - Advanced positioning settings - Advanced positioning settings - qtl_groupbox_simple_sec - loe_008 - subtitle - lo - False - - - Title text in Location request query dialog - Location request - Location request - qtl_dialog_pri_heading - Location notifications_01 - title - Lo - False - - - Checkbox item for enabling/disabling Background positioning - Background positioning - Background positioning - qtl_checkbox_sec - loe_007 - list - lo - False - - - Update interval value when interval is hours (not days or months etc) - Updates every %L1 hours and %L2 minutes - Updates every %L1 hours and %L2 minutes - qtl_list_sec - loe_008 - list - lo - False - - - Update interval value when interval is in minutes - Updates every %L1 minutes and %L2 seconds - Updates every %L1 minutes and %L2 seconds - qtl_list_sec - loe_008 - list - lo - False - - - Checkbox item for enabling/disabling GPS - GPS - GPS - qtl_checkbox_sec - loe_007 - list - lo - False - - - Info text for periodic location request query - No default policy - You location will be shared periodically with : - You location will be shared periodically with : - qtl_dialog_pri5 - Location notifications_02 - info - Lo - False - - - Coordinates - L1%?L2%'L3%.L4%"W - L1%?L2%'L3%.L4%"W - txt_loe_list_l1l2l3l4w - loe_002 - list - lo - False - - - Coordinates - L1%?L2%'L3%.L4%"N - L1%?L2%'L3%.L4%"N - txt_loe_list_l1l2l3l4n - loe_002 - list - lo - False - - - Query header for save dialog - Save as - Save as - qtl_dialog_pri_heading - loe_005 - title - lo - False - - - Update interval value when interval is months - Updates every %L1 months and %L2 days - Updates every %L1 months and %L2 days - qtl_list_sec - loe_008 - list - lo - False - - - Bluetooth GPS - enabling/disabling external BT GPS device usage - Bluetooth GPS - Bluetooth GPS - qtl_checkbox_sec - loe_008 - list - lo - False - - - Checkbox item for enabling/disabling Wireless positioning - Wireless networks - Wireless networks - qtl_checkbox_sec - loe_007 - list - lo - False - - - Primary text in list widget. Notification received time and ate - <Time><Date> - <Time><Date> - qtl_list_pri - Location notifications_06 - list - Lo - False - - - Control panel item in CP main view - Positioning - Positioning - qtl_list_pri_large_graphic - cp_001 - dblist_1 - cp - False - - - Multiline secondary text in a list item - Your location sent to : - Your location sent to : - qtl_list_sec - Location notifications_06 - list - Lo - False - - - Location request query dialog - Softkey button. Allows the user to accept the location request - Accept - Accept - qtl_dialog_softkey - Location notifications_01 - button - Lo - False - - - Coordinates - L1%?L2%'L3%.L4%"S - L1%?L2%'L3%.L4%"S - txt_loe_list_l1l2l3l4s - loe_002 - list - lo - False - - - UniversalIndicatorMenu item text. - Positioning - Positioning - qtl_indimenu_pri_medium_graphic - loe_001 - dblist_1 - lo - False - - - Button in dialog for closing the Positioning info dialog - Done - Done - qtl_dialog_softkey_1 - loe_002 - button - lo - False - - - Confirmation about stopping service - Stop service %1 - Stop service %1 - qtl_dialog_pri3_large_graphic - loe_010 - info - lo - False - - - Description text for Location based services & background applications - Enable applications and services update and retrieve location information - Enable applications and services update and retrieve location information - qtl_dataform_description_sec - loe_007 - info - lo - False - - - Multiline secondary text in a list item - Your location not sent to: - Your location not sent to: - qtl_list_sec - Location notifications_06 - list - Lo - False - - - Title text for Location notifications log view - Location notifications - Location notifications - qtl_chrome_title - Location notifications_06 - title - Lo - False - - - Button. Note! Use this text ID only if there are max. two buttons in the dialog. When this button is pressed, the focused item or operation will be selected or accepted. - OK - OK - qtl_dialog_softkey_2 - common - button - co - False - - - diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/possettings/rom/possettings.iby --- a/locationsystemui/locationsysui/possettings/rom/possettings.iby Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/possettings/rom/possettings.iby Fri Jul 23 19:40:48 2010 +0530 @@ -21,6 +21,7 @@ #ifdef __LOCATIONSYSUI #include +#include file=ABI_DIR\BUILD_DIR\possettingsengine.dll SHARED_LIB_DIR\possettingsengine.dll file=ABI_DIR\BUILD_DIR\possettingsplugin.dll SHARED_LIB_DIR\possettingsplugin.dll file=ABI_DIR\BUILD_DIR\pospsysettings.dll SHARED_LIB_DIR\pospsysettings.dll diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/bwins/locnotificationengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/bwins/locnotificationengineu.def Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,4 @@ +EXPORTS + ?ResolveRequestorsL@CLocRequestorUtilsResolver@@QAEXAAV?$RPointerArray@VCPosRequestor@@@@@Z @ 1 NONAME ; void CLocRequestorUtilsResolver::ResolveRequestorsL(class RPointerArray &) + ?NewL@CLocRequestorUtilsResolver@@SAPAV1@XZ @ 2 NONAME ; class CLocRequestorUtilsResolver * CLocRequestorUtilsResolver::NewL(void) + diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/contactresolversession/group/contactresolversession.mmp --- a/locationsystemui/locationsysui/privacyverifiernotifierui/contactresolversession/group/contactresolversession.mmp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/contactresolversession/group/contactresolversession.mmp Fri Jul 23 19:40:48 2010 +0530 @@ -44,6 +44,7 @@ LIBRARY eiksrv.lib LIBRARY eposprvtyp.lib LIBRARY estor.lib bafl.lib -LIBRARY flogger.lib +LIBRARY locutils.lib EPOCALLOWDLLDATA + diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/contactresolversession/src/contactresolversession.cpp --- a/locationsystemui/locationsysui/privacyverifiernotifierui/contactresolversession/src/contactresolversession.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/contactresolversession/src/contactresolversession.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -18,6 +18,7 @@ #include "contactresolversession.h" #include "locprivacyinternal.h" #include "locprivacycommon.h" +#include "locutilsdebug.h" #include #include @@ -25,7 +26,8 @@ #include #include - +//This determines the number of outstanding requests the client may have with the server at any one time. +//The maximum number of slots is 255. TInt KDefaultMessageSlots = 255; const TUid KServerUid3 = { @@ -53,6 +55,8 @@ CPosRequestor>& aRequestors) { + LOCUTILSDEBUG( "+RContactResolverSession::ResolveRequestorsL" ) + RPosRequestorStack* requestors = new (ELeave) RPosRequestorStack; CleanupStack::PushL(requestors); @@ -122,6 +126,7 @@ CleanupStack::PopAndDestroy(&readStream); CleanupStack::PopAndDestroy(buffer1); + LOCUTILSDEBUG( "-RContactResolverSession::ResolveRequestorsL" ) } // ----------------------------------------------------------------------------- @@ -131,6 +136,8 @@ EXPORT_C TInt RContactResolverSession::Connect() { + LOCUTILSDEBUG( "+RContactResolverSession::Connect" ) + TInt error = StartServer(); if (KErrNone == error) @@ -138,6 +145,7 @@ error = CreateSession(KLocPrivacyServerName, Version(), KDefaultMessageSlots); } + LOCUTILSDEBUG( "-RContactResolverSession::Connect" ) return error; } @@ -148,6 +156,8 @@ // TInt RContactResolverSession::StartServer() { + LOCUTILSDEBUG( "+RContactResolverSession::StartServer" ) + TInt result; TFindServer findServer(KLocPrivacyServerName); @@ -165,7 +175,8 @@ { return result; } - + LOCUTILSDEBUG( "-RContactResolverSession::StartServer" ) + return KErrNone; } @@ -176,6 +187,8 @@ // TInt RContactResolverSession::CreateServerProcess() { + LOCUTILSDEBUG( "+RContactResolverSession::CreateServerProcess" ) + TInt result; const TUidType serverUid(KNullUid, KNullUid, KServerUid3); @@ -212,11 +225,15 @@ return (status.Int()); } + LOCUTILSDEBUG( "-RContactResolverSession::CreateServerProcess" ) + return KErrNone; } TVersion RContactResolverSession::Version() const { + LOCUTILSDEBUG( "RContactResolverSession::Version" ) + return TVersion(KLocPrivacyServerMajorVersionNumber, KLocPrivacyServerMinorVersionNumber, KLocPrivacyServerBuildVersionNumber); @@ -224,5 +241,9 @@ EXPORT_C void RContactResolverSession::Close() { + LOCUTILSDEBUG( "+RContactResolverSession::Close" ) + RSessionBase::Close(); + + LOCUTILSDEBUG( "-RContactResolverSession::Close" ) } diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/eabi/locnotificationengineu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/eabi/locnotificationengineu.def Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,4 @@ +EXPORTS + _ZN26CLocRequestorUtilsResolver18ResolveRequestorsLER13RPointerArrayI13CPosRequestorE @ 1 NONAME + _ZN26CLocRequestorUtilsResolver4NewLEv @ 2 NONAME + diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/inc/apilogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/inc/apilogger.h Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class provides function that help in logging entry and exit of APIs of classes +* +*/ + +#ifndef APILOGGER_H +#define APILOGGER_H + +#include +#include +#include +#include +#include + +using namespace std; + + +class ApiLogger + { + public: + static void OpenLogFile(); + static void CloseLogFile(); + static void MyOutputHandler(QtMsgType type, const char *msg); + }; + +#endif // APILOGGER_H diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/locnotificationengine.pro --- a/locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/locnotificationengine.pro Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/locnotificationengine.pro Fri Jul 23 19:40:48 2010 +0530 @@ -29,9 +29,11 @@ # Input SOURCES += src/locrequestorutilsresolver.cpp \ - src/qlocnotificationengine.cpp + src/qlocnotificationengine.cpp \ + src/apilogger.cpp HEADERS += inc/locrequestorutilsresolver.h \ - inc/qlocnotificationengine.h + inc/qlocnotificationengine.h \ + inc/apilogger.h symbian: { TARGET.EPOCALLOWDLLDATA = 1 DEFINES += BUILD_POSSETTINGS diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/src/apilogger.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/src/apilogger.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class provides function that help in logging entry and exit of APIs of classes +* +*/ + + +#include "apilogger.h" +#include + +const char* debugFileName("c://logs//lbs//notifengine.txt"); +ofstream logfile; + +void ApiLogger::OpenLogFile() +{ + logfile.open(debugFileName, ios::app); +} + +void ApiLogger::CloseLogFile() +{ + logfile.flush(); + logfile.close(); +} + +void ApiLogger::MyOutputHandler(QtMsgType type, const char *msg) +{ + switch (type) { + case QtDebugMsg: + logfile << QTime::currentTime().toString().toAscii().data() << " Debug: " << msg << "\n"; + break; + case QtCriticalMsg: + logfile << QTime::currentTime().toString().toAscii().data() << " Critical: " << msg << "\n"; + break; + case QtWarningMsg: + logfile << QTime::currentTime().toString().toAscii().data() << " Warning: " << msg << "\n"; + break; + case QtFatalMsg: + logfile << QTime::currentTime().toString().toAscii().data() << " Fatal: " << msg << "\n"; + default: + break; + } + logfile.flush(); +} diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/src/locrequestorutilsresolver.cpp --- a/locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/src/locrequestorutilsresolver.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/src/locrequestorutilsresolver.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -157,7 +157,8 @@ } catch( int error ) { - User::Leave(error); + // Memory alloc failure + User::Leave(KErrNoMemory); } } diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/src/qlocnotificationengine.cpp --- a/locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/src/qlocnotificationengine.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locnotificationengine/src/qlocnotificationengine.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -40,8 +40,12 @@ //--------------------------------------------------------------------- QLocNotificationEngine::QLocNotificationEngine() { + qDebug() + << "+QLocNotificationEngine::QLocNotificationEngine()"; //"symbian" is the string used to load the contact manager corresponding to the phonebook database mContactManager = new QtMobility::QContactManager("symbian"); + qDebug() + << "-QLocNotificationEngine::QLocNotificationEngine()"; } //------QLocNotificationEngine----------------------------------------- @@ -60,7 +64,8 @@ //--------------------------------------------------------------------- void QLocNotificationEngine::processRequestors(QPosRequestorData& posRequestorData) { - + qDebug() + << "+QLocNotificationEngine::processRequestors()"; QtMobility::QContactDetailFilter filter; QString idString; @@ -100,8 +105,7 @@ { QtMobility::QContact match = mContactManager->contact(matchingContacts.at(0)); //return the first contact among the ones found - - // QtMobility::QContactDisplayLabel cdl = match.detail(QtMobility::QContactDisplayLabel::DefinitionName); + QString labelDetail = match.displayLabel(); posRequestorData.setPosRequestorData(idFormat,labelDetail); //set back result } @@ -120,6 +124,8 @@ } } + qDebug() + << "-QLocNotificationEngine::processRequestors()"; } //--------------------------------------------------------------------- diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/group/locprivacyserver.mmp --- a/locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/group/locprivacyserver.mmp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/group/locprivacyserver.mmp Fri Jul 23 19:40:48 2010 +0530 @@ -44,5 +44,6 @@ LIBRARY efsrv.lib LIBRARY estor.lib LIBRARY locnotificationengine.lib +LIBRARY locutils.lib // End of file diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/inc/locprivacyserver.h --- a/locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/inc/locprivacyserver.h Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/inc/locprivacyserver.h Fri Jul 23 19:40:48 2010 +0530 @@ -23,6 +23,7 @@ #include // FORWARD DECLARATIONS + class CLocPrivacyServerSession; // CLASS DECLARATION diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/inc/locprivacyserversession.h --- a/locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/inc/locprivacyserversession.h Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/inc/locprivacyserversession.h Fri Jul 23 19:40:48 2010 +0530 @@ -25,7 +25,6 @@ // FORWARD DECLARATIONS class CPosPrivacyServer; -//class CPosPrivManager; class RPosRequestorStack; // CLASS DECLARATION diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/src/locprivacyserver.cpp --- a/locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/src/locprivacyserver.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/src/locprivacyserver.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -21,6 +21,7 @@ #include "locprivacycommon.h" #include "locprivacyserversession.h" #include "locprivacyserverdebugpanic.h" +#include "locutilsdebug.h" // CONSTANTS @@ -41,7 +42,9 @@ // EPOC default constructor can leave. void CLocPrivacyServer::ConstructL() { + LOCUTILSDEBUG( "+CLocPrivacyServer::ConstructL" ) User::LeaveIfError(Start(KLocPrivacyServerName)); + LOCUTILSDEBUG( "-CLocPrivacyServer::ConstructL" ) } // Two-phased constructor @@ -67,7 +70,9 @@ // void CLocPrivacyServer::IncrementSessions() { + LOCUTILSDEBUG( "+CLocPrivacyServer::IncrementSessions" ) iNumSessions++; + LOCUTILSDEBUG( "-CLocPrivacyServer::IncrementSessions" ) } // --------------------------------------------------------- @@ -79,12 +84,14 @@ void CLocPrivacyServer::DecrementSessions( CLocPrivacyServerSession* /*aSession*/) { + LOCUTILSDEBUG( "+CLocPrivacyServer::DecrementSessions" ) iNumSessions--; if (iNumSessions == 0) { // Shutdown the server by shutting down the active scheduler. CActiveScheduler::Stop(); } + LOCUTILSDEBUG( "-CLocPrivacyServer::DecrementSessions" ) } // --------------------------------------------------------- @@ -97,11 +104,12 @@ const TVersion& /*aVersion*/, const RMessage2& /*aMessage*/) const { - + LOCUTILSDEBUG( "+CLocPrivacyServer::NewSessionL" ) // Make new session CLocPrivacyServerSession* newSession = CLocPrivacyServerSession::NewL( const_cast(*this)); + LOCUTILSDEBUG( "-CLocPrivacyServer::NewSessionL" ) return newSession; } @@ -114,8 +122,10 @@ // TInt CLocPrivacyServer::RunError(TInt aError) { + LOCUTILSDEBUG( "-CLocPrivacyServer::RunError" ) Message().Complete(aError); ReStart(); + LOCUTILSDEBUG( "-CLocPrivacyServer::RunError" ) return KErrNone; } diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/src/locprivacyserversession.cpp --- a/locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/src/locprivacyserversession.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/src/locprivacyserversession.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -16,13 +16,20 @@ */ // INCLUDE FILES + #include #include + #include "locprivacyinternal.h" #include "locprivacyserver.h" #include "locprivacyserversession.h" #include "locprivacyserverdebugpanic.h" #include "locrequestorutilsresolver.h" +#include "locutilsdebug.h" + + + + // CONSTANTS // ================= MEMBER FUNCTIONS ======================= @@ -60,8 +67,10 @@ // EPOC default constructor void CLocPrivacyServerSession::ConstructL(CLocPrivacyServer& aServer) { + LOCUTILSDEBUG( "+CLocPrivacyServerSession::ConstructL" ) aServer.IncrementSessions(); iBufFlat = CBufFlat::NewL(KPosBufFlatExpandSize); + LOCUTILSDEBUG( "-CLocPrivacyServerSession::ConstructL" ) } // --------------------------------------------------------- @@ -72,9 +81,11 @@ // void CLocPrivacyServerSession::ServiceL(const RMessage2& aMessage) { + LOCUTILSDEBUG( "+CLocPrivacyServerSession::ServiceL" ) TRAPD(err, DispatchL(aMessage)); aMessage.Complete(err); + LOCUTILSDEBUG( "-CLocPrivacyServerSession::ServiceL" ) } @@ -86,10 +97,12 @@ // void CLocPrivacyServerSession::CloseSession() { + LOCUTILSDEBUG( "+CLocPrivacyServerSession::CloseSession" ) CLocPrivacyServer * server = static_cast (const_cast (Server())); server->DecrementSessions(this); + LOCUTILSDEBUG( "-CLocPrivacyServerSession::CloseSession" ) } // --------------------------------------------------------- @@ -100,6 +113,7 @@ // void CLocPrivacyServerSession::DispatchL(const RMessage2& aMessage) { + LOCUTILSDEBUG( "+CLocPrivacyServerSession::DispatchL" ) switch ( aMessage.Function() ) { case ELocPrivacyGetSize: @@ -171,6 +185,7 @@ ELocPrivSrvPanicUnknownActivity); break; } + LOCUTILSDEBUG( "-CLocPrivacyServerSession::DispatchL" ) } // End of File diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/src/locprivacyserverstartup.cpp --- a/locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/src/locprivacyserverstartup.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/src/locprivacyserverstartup.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -19,6 +19,7 @@ #include "locprivacyserverstartup.h" #include "locprivacyserver.h" #include "locprivacycommon.h" +#include "locutilsdebug.h" // ============================ MEMBER FUNCTIONS =============================== @@ -30,6 +31,7 @@ // TInt LocPrivacyServerStartup::StartServer() { + LOCUTILSDEBUG( "+LocPrivacyServerStartup::StartServer" ) __UHEAP_MARK; CTrapCleanup* cleanupStack = CTrapCleanup::New(); @@ -44,6 +46,7 @@ __UHEAP_MARKEND; + LOCUTILSDEBUG( "-LocPrivacyServerStartup::StartServer" ) return ret; } @@ -55,6 +58,7 @@ // void LocPrivacyServerStartup::StartServerL() { + LOCUTILSDEBUG( "+LocPrivacyServerStartup::StartServerL" ) // Rename thread to aid debugging User::LeaveIfError(User::RenameThread(KLocPrivacyServerName)); @@ -74,6 +78,7 @@ delete server; delete scheduler; + LOCUTILSDEBUG( "-LocPrivacyServerStartup::StartServerL" ) } // ----------------------------------------------------------------------------- diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locverifier/src/lpdglobalplugindialog.cpp --- a/locationsystemui/locationsysui/privacyverifiernotifierui/locverifier/src/lpdglobalplugindialog.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locverifier/src/lpdglobalplugindialog.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -20,6 +20,7 @@ #include "lpdglobalplugindialog.h" #include "lpddlgobserver.h" #include "lpdrequestorprocessor.h" +#include "locverifierdlgdebug.h" #include #include @@ -81,6 +82,7 @@ // void CLpdGlobalPluginDialog::ConstructL() { + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::ConstructL" ); iMsgBox = CHbDeviceDialogSymbian::NewL(); iNotification = CHbDeviceNotificationDialogSymbian::NewL(this); TBool result = @@ -89,6 +91,7 @@ { HbTextResolverSymbian::Init(KLocTsFileName, KLocTsAFileAltPath); } + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::ConstructL" ); } // ----------------------------------------------------------------------------- @@ -110,6 +113,7 @@ // Destructor CLpdGlobalPluginDialog::~CLpdGlobalPluginDialog() { + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::~CLpdGlobalPluginDialog" ); delete iMsgBox; iMsgBox = NULL; @@ -118,7 +122,7 @@ delete iRequestInfo; iRequestInfo=NULL; - + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::~CLpdGlobalPluginDialog" ); } @@ -129,6 +133,7 @@ // void CLpdGlobalPluginDialog::RunVerificationQueryL() { + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::RunVerificationQueryL" ); mSymbianVariantMap = CHbSymbianVariantMap::NewL(); CleanupStack::PushL(mSymbianVariantMap); @@ -143,10 +148,12 @@ } CSystemToneService::Delete(sts); CleanupStack::Pop(mSymbianVariantMap); + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::RunVerificationQueryL" ); } void CLpdGlobalPluginDialog::RunNotificationL() { + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::RunNotificationL" ); if( EPosDecisionByRequestSource == iRequestInfo->iNotifReason || EPosVerificationTimeout == iRequestInfo->iNotifReason ) { @@ -195,6 +202,7 @@ iNotification->SetTimeout(KNotificationTimeout); iNotification->EnableTouchActivation(ETrue); iNotification->ShowL(); + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::RunNotificationL" ); } // ----------------------------------------------------------------------------- @@ -204,6 +212,7 @@ // void CLpdGlobalPluginDialog::SetRequestInfoL( CLpdRequestorProcessor* aRequestInfo ) { + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::SetRequestInfoL" ); if(iRequestInfo) { // clear and create again if already has been set before @@ -245,6 +254,7 @@ } } + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::SetRequestInfoL" ); } @@ -252,41 +262,52 @@ void CLpdGlobalPluginDialog::Cancel() { // Close any running dialogs if any.Close() doesnt have any effect if dialog is not running + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::Cancel" ); isCancelled = ETrue; iMsgBox->Cancel(); iNotification->Close(); + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::Cancel" ); } void CLpdGlobalPluginDialog::NotificationDialogActivated( const CHbDeviceNotificationDialogSymbian */*aDialog*/) { + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::NotificationDialogActivated" ); // Complete with KErrNone now TRAP_IGNORE(iCallBack.HandleDlgDismissedL( KErrNone )); + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::NotificationDialogActivated" ); } void CLpdGlobalPluginDialog::NotificationDialogClosed( const CHbDeviceNotificationDialogSymbian */*aDialog*/, TInt aCompletionCode) { + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::NotificationDialogClosed" ); TRAP_IGNORE(iCallBack.HandleDlgDismissedL( aCompletionCode )); + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::NotificationDialogClosed" ); } void CLpdGlobalPluginDialog::DataReceived(CHbSymbianVariantMap& /*aData*/) { + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::DataReceived" ); mDissmissed = ETrue; TRAP_IGNORE(iCallBack.HandleDlgDismissedL( KErrAccessDenied )); + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::DataReceived" ); } void CLpdGlobalPluginDialog::DeviceDialogClosed(TInt /*aCompletionCode*/) { + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::DeviceDialogClosed" ); if (!mDissmissed && !isCancelled) { TRAP_IGNORE(iCallBack.HandleDlgDismissedL( KErrNone )); } + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::DeviceDialogClosed" ); } void CLpdGlobalPluginDialog::AddVerDlgHeadingParamL() { + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::AddVerDlgHeadingParamL" ); HBufC* headingText = HbTextResolverSymbian::LoadL(KRequestHeading); CleanupStack::PushL(headingText); CHbSymbianVariant* heading = CHbSymbianVariant::NewL(headingText, @@ -295,10 +316,12 @@ mSymbianVariantMap->Add(KHeadingKey, heading ); CleanupStack::Pop(heading); CleanupStack::PopAndDestroy(headingText); + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::AddVerDlgHeadingParamL" ); } void CLpdGlobalPluginDialog::AddQueryTextParamL() { + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::AddQueryTextParamL" ); HBufC * value = HBufC::NewL(KVariantMaxSize); CleanupStack::PushL(value); HBufC * value2 = HBufC::NewL(KVariantMaxSize); @@ -387,11 +410,12 @@ CleanupStack::Pop(queryText2); CleanupStack::Pop(queryText); CleanupStack::PopAndDestroy(3); + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::AddQueryTextParamL" ); } void CLpdGlobalPluginDialog::AddRequestorsParamL() { - + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::AddRequestorsParamL" ); CDesC16ArrayFlat* array = new CDesC16ArrayFlat(8); TInt reqCount = iRequestInfo->iRequestors.Count(); if (!reqCount) @@ -414,6 +438,7 @@ CHbSymbianVariant* requestors = CHbSymbianVariant::NewL(marray, CHbSymbianVariant::EDesArray); mSymbianVariantMap->Add(KRequestorKey, requestors); + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::AddRequestorsParamL" ); } // End of file diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locverifier/src/lpdrequestorprocessor.cpp --- a/locationsystemui/locationsysui/privacyverifiernotifierui/locverifier/src/lpdrequestorprocessor.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locverifier/src/lpdrequestorprocessor.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -79,6 +79,7 @@ TBool CLpdRequestorProcessor::ReadRequestorsL( const CPosPrivacyNotifier& aPosNotifier ) { + LOCVERIFIERDLGDEBUG( "+CLpdGlobalPluginDialog::ReadRequestorsL" ); __ASSERT_DEBUG( aPosNotifier.CurrentRequest() != KPosNullQNRequestId, HandleAssertErrorL() ); @@ -117,6 +118,7 @@ } resSession.Close(); + LOCVERIFIERDLGDEBUG( "-CLpdGlobalPluginDialog::ReadRequestorsL" ); return allRequestorIdsValid; } diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/locverifier/src/lpdverifierplugin.cpp --- a/locationsystemui/locationsysui/privacyverifiernotifierui/locverifier/src/lpdverifierplugin.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/locverifier/src/lpdverifierplugin.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -76,9 +76,11 @@ // void CLpdVerifierPlugin::ConstructL() { + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::ConstructL" ); BaseConstructL(KNotifierChannel, KNotifierPriority); iRtorProcessor = CLpdRequestorProcessor::NewL(); + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::ConstructL" ); } // ----------------------------------------------------------------------------- @@ -88,18 +90,20 @@ // CLpdVerifierPlugin* CLpdVerifierPlugin::NewL() { + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::NewL" ); CLpdVerifierPlugin* self = new (ELeave) CLpdVerifierPlugin; CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(self); - + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::NewL" ); return self; } // Destructor CLpdVerifierPlugin::~CLpdVerifierPlugin() { + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::~CLpdVerifierPlugin" ); // Destruction of this plugin should only occur only in shutdown // or in severe problem situation. @@ -118,6 +122,7 @@ iRequestActiveObject = NULL; delete iRtorProcessor; iRtorProcessor = NULL; + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::~CLpdVerifierPlugin" ); } @@ -128,7 +133,7 @@ // void CLpdVerifierPlugin::HandleNewRequestL(TPosQNRequestId /*aRequestId */ ) { - LOCVERIFIERDLGDEBUG( "CLpdVerifierPlugin::HandleNewRequestL" ); + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::HandleNewRequestL" ); // Check whether the notifier is already handling a request // If yes, do nothing for now. @@ -141,6 +146,7 @@ iRequestActiveObject = CLpdRequestAO::NewL(*this); iRequestActiveObject->ScheduleRequest(); } + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleNewRequestL" ); } @@ -151,7 +157,7 @@ // void CLpdVerifierPlugin::HandleRequestCancelled(TPosQNRequestId aRequestId) { - LOCVERIFIERDLGDEBUG( "CLpdVerifierPlugin::HandleRequestCancelled" ); + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::HandleRequestCancelled" ); // Check whether the request is coming from Uikon Server. // If not reject this request. if (!CheckClientSecureId(KPrivSrvSecureId)) @@ -182,7 +188,7 @@ LOCVERIFIERDLGDEBUG( "Notification cancelled" ); iNotifier->Cancel(); } - + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleRequestCancelled" ); } // ----------------------------------------------------------------------------- @@ -192,12 +198,12 @@ // void CLpdVerifierPlugin::HandleAllRequestCancelled() { - LOCVERIFIERDLGDEBUG( "CLpdVerifierPlugin::HandleAllRequestCancelled" ); + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::HandleAllRequestCancelled" ); if (iCurrentRequest != KPosNullQNRequestId) { // current request requires some specific behavior HandleRequestCancelled(iCurrentRequest); } - + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleAllRequestCancelled" ); } // ----------------------------------------------------------------------------- @@ -209,7 +215,7 @@ { iVerifyResult = aResultCode; - LOCVERIFIERDLGDEBUG1( "CLpdVerifierPlugin::HandleVerificationResultL(%d)", + LOCVERIFIERDLGDEBUG1( "+CLpdVerifierPlugin::HandleVerificationResultL(%d)", iVerifyResult ); switch (iVerifyResult) @@ -244,6 +250,7 @@ } CompleteCurrentAndContinue(iVerifyResult); // this request was handled + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleVerificationResultL" ); } // ----------------------------------------------------------------------------- // CLpdVerifierPlugin::HandleNotificationResultL @@ -253,7 +260,7 @@ void CLpdVerifierPlugin::HandleNotificationResultL(TInt aResultCode) { - LOCVERIFIERDLGDEBUG1( "CLpdVerifierPlugin::HandleVerificationResultL(%d)", + LOCVERIFIERDLGDEBUG1( "+CLpdVerifierPlugin::HandleVerificationResultL(%d)", aResultCode ); CompleteRequest(iCurrentRequest, aResultCode); iCurrentRequest = KPosNullQNRequestId; @@ -284,6 +291,7 @@ } iRequestActiveObject->ScheduleRequest(); // handle next req. + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleNotificationResultL" ); } // ----------------------------------------------------------------------------- @@ -293,7 +301,7 @@ // void CLpdVerifierPlugin::HandleLeave(TInt /*aError*/) { - LOCVERIFIERDLGDEBUG1( "CLpdVerifierPlugin::HandleLeave(%d)", aError); + LOCVERIFIERDLGDEBUG1( "+CLpdVerifierPlugin::HandleLeave(%d)", aError); // In this case user needs feedback about the error situation: @@ -301,6 +309,7 @@ // iVerifyResult, but queue handling is still continued. // iVerifyResult is better completion code for request than aError. CompleteCurrentAndContinue(iVerifyResult); + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleLeave" ); } // ----------------------------------------------------------------------------- @@ -310,6 +319,7 @@ // void CLpdVerifierPlugin::HandleNextRequest() { + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::HandleNextRequest" ); TRAPD( err, HandleNextRequestL() ); if (err) { @@ -321,6 +331,7 @@ CompleteCurrentAndContinue(iVerifyResult); } + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleNextRequest" ); } // ----------------------------------------------------------------------------- @@ -330,7 +341,7 @@ // void CLpdVerifierPlugin::HandleNextRequestL() { - + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::HandleNextRequestL" ); // It is better to free previous query resources here, because // now all callback methods have finished (active object allowed // run to completion) @@ -382,6 +393,7 @@ { User::Leave(KErrNotSupported); } + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleNextRequestL" ); } // ----------------------------------------------------------------------------- @@ -391,6 +403,7 @@ // void CLpdVerifierPlugin::HandleNextVerificationL() { + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::HandleNextVerificationL" ); __ASSERT_DEBUG( iCurrentRequest != KPosNullQNRequestId, HandleAssertErrorL() ); __ASSERT_DEBUG( !iVerifierQuery, HandleAssertErrorL() ); @@ -421,6 +434,7 @@ iVerifierQuery->StartQueryL(); } + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleNextVerificationL" ); } // ----------------------------------------------------------------------------- @@ -430,11 +444,13 @@ // void CLpdVerifierPlugin::HandleNextNotificationL() { + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::HandleNextNotificationL" ); __ASSERT_DEBUG( iCurrentRequest != KPosNullQNRequestId, HandleAssertErrorL() ); // There is no differentiation now for periodic and single shot notifications HandleNextNonPeriodicNotificationL(); + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleNextNotificationL" ); } // ----------------------------------------------------------------------------- // CLpdVerifierPlugin::HandleNextNonPeriodicNotificationL @@ -443,7 +459,7 @@ // void CLpdVerifierPlugin::HandleNextNonPeriodicNotificationL() { - + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::HandleNextNonPeriodicNotificationL" ); __ASSERT_DEBUG( iCurrentRequest != KPosNullQNRequestId, HandleAssertErrorL() ); __ASSERT_DEBUG( !iNotifier, HandleAssertErrorL() ); @@ -462,6 +478,7 @@ iNotifier = CLpdNotifierQueryLauncher::NewL(*this); iNotifier->SetRequestInfoL(iRtorProcessor); iNotifier->StartQueryL(); + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleNextNonPeriodicNotificationL" ); } @@ -472,6 +489,7 @@ // void CLpdVerifierPlugin::CompleteCurrentAndContinue(TInt aResultCode) { + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::CompleteCurrentAndContinue" ); if (iCurrentRequest != KPosNullQNRequestId) { CompleteRequest(iCurrentRequest, aResultCode); @@ -480,6 +498,7 @@ __ASSERT_DEBUG( iRequestActiveObject, HandleDebugAssertError() ); iRequestActiveObject->ScheduleRequest(); // handle next req. + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::CompleteCurrentAndContinue" ); } // ----------------------------------------------------------------------------- @@ -489,6 +508,7 @@ // void CLpdVerifierPlugin::FreeQueryResources() { + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::FreeQueryResources" ); iCurrentRequest = KPosNullQNRequestId; delete iVerifierQuery; iVerifierQuery = NULL; @@ -500,6 +520,7 @@ // be NULL, otherwise it points to an instance. iRtorProcessor->ResetAndDestroyRequestors(); } + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::FreeQueryResources" ); } // ----------------------------------------------------------------------------- @@ -509,11 +530,13 @@ // void CLpdVerifierPlugin::HandleAssertErrorL() const { + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::HandleAssertErrorL" ); #ifdef _DEBUG User::Panic(KPanicText, KLpdErrGeneral); #else User::Leave( KErrCorrupt ); #endif + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleAssertErrorL" ); } // ----------------------------------------------------------------------------- @@ -523,9 +546,11 @@ // void CLpdVerifierPlugin::HandleDebugAssertError() const { + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::HandleDebugAssertError" ); #ifdef _DEBUG User::Panic(KPanicText, KLpdErrGeneral); #endif + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::HandleDebugAssertError" ); } @@ -538,6 +563,7 @@ // ----------------------------------------------------------------------------- CPosRequestor::TRequestType CLpdVerifierPlugin::CheckRequestTypeL() { + LOCVERIFIERDLGDEBUG( "+CLpdVerifierPlugin::CheckRequestTypeL" ); CPosRequestor::TRequestType reqType = CPosRequestor::ENetworkTypeUnknown; if (RequestorCountL() > 0) { @@ -545,6 +571,7 @@ reqType = requestor->RequestType(); CleanupStack::PopAndDestroy(requestor); } + LOCVERIFIERDLGDEBUG( "-CLpdVerifierPlugin::CheckRequestTypeL" ); return reqType; } diff -r 1a92308afc46 -r e175e2ba2fb0 locationsystemui/locationsysui/privacyverifiernotifierui/posverificationdialogplugin/src/posverificationcustomdialog.cpp --- a/locationsystemui/locationsysui/privacyverifiernotifierui/posverificationdialogplugin/src/posverificationcustomdialog.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationsystemui/locationsysui/privacyverifiernotifierui/posverificationdialogplugin/src/posverificationcustomdialog.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -40,24 +40,6 @@ { qDebug() << "+PosVerificationCustomDialog::~PosVerificationCustomDialog()"; - /* - delete mHeadingLabel; - mHeadingLabel = NULL; - - delete mPrimaryAction; - mPrimaryAction = NULL; - - delete mQueryText; - mQueryText = NULL; - - mRequestorListItems.clear(); - - delete mRequestorList; - mRequestorList = NULL; - - delete mSecondryAction; - mSecondryAction = NULL; - */ delete mQueryText2; mQueryText2 = NULL; diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/AdvancedTriggerSupervision/group/AdvancedTriggerSupervision.mmp --- a/locationtriggering/tsrc/lbtengine_test/AdvancedTriggerSupervision/group/AdvancedTriggerSupervision.mmp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/AdvancedTriggerSupervision/group/AdvancedTriggerSupervision.mmp Fri Jul 23 19:40:48 2010 +0530 @@ -56,6 +56,7 @@ LIBRARY lbt.lib LIBRARY lbs.lib LIBRARY centralrepository.lib +LIBRARY ProfileEngine.lib LANG SC diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/AdvancedTriggerSupervision/inc/AdvancedTriggerSupervision.h --- a/locationtriggering/tsrc/lbtengine_test/AdvancedTriggerSupervision/inc/AdvancedTriggerSupervision.h Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/AdvancedTriggerSupervision/inc/AdvancedTriggerSupervision.h Fri Jul 23 19:40:48 2010 +0530 @@ -30,6 +30,7 @@ // Forward declaration class TCoordinate; +class MProEngEngine; // CONSTANTS //const ?type ?constant_var = ?constant; @@ -142,6 +143,17 @@ * Gets current coordinate */ void GetCurrentCoordinateL( TCoordinate& aCoordinate ); + + /** + * Set the phone profile to offline mode + */ + void SetProfileToOfflineL(); + + /** + * Restore original profile + */ + void RestoreProfileL(); + /** * Test methods are listed below. @@ -187,11 +199,18 @@ private: // Data - // ?one_line_short_description_of_data - //?data_declaration; + /** + * Pointer to profile engine + * Own. + */ + MProEngEngine* iProEngine; + + /** + * Current profile id + */ + TInt iCurrentProfile; - // Reserved pointer for future extension - //TAny* iReserved; + public: // Friend classes //?friend_class_declaration; diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/AdvancedTriggerSupervision/src/AdvancedTriggerSupervision.cpp --- a/locationtriggering/tsrc/lbtengine_test/AdvancedTriggerSupervision/src/AdvancedTriggerSupervision.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/AdvancedTriggerSupervision/src/AdvancedTriggerSupervision.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -21,6 +21,8 @@ // INCLUDE FILES #include +#include +#include #include "AdvancedTriggerSupervision.h" #include @@ -132,13 +134,7 @@ CStifLogger::EFile, EFalse ); - RProcess process; - ret = process.Create(_L("lbsroot"), KNullDesC); - TRequestStatus status; - process.Rendezvous(status); - process.Resume(); - User::WaitForRequest(status); - process.Close(); + iProEngine= ProEngFactory::NewEngineL(); } // ----------------------------------------------------------------------------- @@ -168,7 +164,8 @@ // Delete logger delete iLog; - + delete iProEngine; + iProEngine = NULL; } // ========================== OTHER EXPORTED FUNCTIONS ========================= diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/AdvancedTriggerSupervision/src/AdvancedTriggerSupervisionBlocks.cpp --- a/locationtriggering/tsrc/lbtengine_test/AdvancedTriggerSupervision/src/AdvancedTriggerSupervisionBlocks.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/AdvancedTriggerSupervision/src/AdvancedTriggerSupervisionBlocks.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -75,6 +75,9 @@ #include #include #include // CPosModuleUpdate + +#include +#include // EXTERNAL DATA STRUCTURES //extern ?external_data; @@ -199,6 +202,24 @@ } // ----------------------------------------------------------------------------- +// CAdvancedTriggerSupervision::SetProfileToOfflineL +// ----------------------------------------------------------------------------- +void CAdvancedTriggerSupervision::SetProfileToOfflineL() + { + // Store current profile id. + iCurrentProfile = iProEngine->ActiveProfileId(); + // Change the active profile to Off-line + iProEngine->SetActiveProfileL( EProfileOffLineId ); + } +// ----------------------------------------------------------------------------- +// CAdvancedTriggerSupervision::RestoreProfileL +// ----------------------------------------------------------------------------- +void CAdvancedTriggerSupervision::RestoreProfileL() + { + iProEngine->SetActiveProfileL( iCurrentProfile ); + } + +// ----------------------------------------------------------------------------- // CAdvancedTriggerSupervision::RunMethodL // Run specified method. Contains also table of test mothods and their names. // ----------------------------------------------------------------------------- @@ -270,6 +291,11 @@ User::LeaveIfError( lbt.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -342,7 +368,7 @@ FireInfo.iFiredPositionInfo.GetPosition(firePosition); iLog->Log(_L("GP")); firePosition.Distance(coordinate,trigDistance); - + RestoreProfileL(); if( FireInfo.iTriggerId==trigId ) { @@ -390,6 +416,11 @@ User::LeaveIfError( lbt.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -462,7 +493,7 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); - + RestoreProfileL(); if( FireInfo.iTriggerId==trigId) { @@ -511,6 +542,11 @@ User::LeaveIfError( lbt.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -583,7 +619,7 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); - + RestoreProfileL(); if( FireInfo.iTriggerId==trigId) { @@ -631,6 +667,11 @@ User::LeaveIfError( lbt.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -701,7 +742,7 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); - + RestoreProfileL(); if( FireInfo.iTriggerId==trigId) { @@ -750,6 +791,11 @@ User::LeaveIfError( lbt.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -822,7 +868,8 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); - + + RestoreProfileL(); if( FireInfo.iTriggerId==trigId) { @@ -871,6 +918,11 @@ User::LeaveIfError( lbt.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -943,7 +995,8 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); - + + RestoreProfileL(); if( FireInfo.iTriggerId==trigId) { @@ -994,6 +1047,10 @@ iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -1071,6 +1128,7 @@ wait->Start( ); RArray Firedtriggers; lbt.GetFiredTriggersL(Firedtriggers); + RestoreProfileL(); if(Firedtriggers.Count()==2) { CleanupStack::PopAndDestroy( notifier ); @@ -1118,6 +1176,10 @@ iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -1195,6 +1257,7 @@ wait->Start( ); RArray Firedtriggers; lbt.GetFiredTriggersL(Firedtriggers); + RestoreProfileL(); if(Firedtriggers.Count()==2) { CleanupStack::PopAndDestroy( notifier ); @@ -1242,6 +1305,10 @@ iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -1324,6 +1391,7 @@ CleanupStack::Pop( &lbt ); CleanupStack::PopAndDestroy( &lbtserver ); //delete wait; + RestoreProfileL(); if(Firedtriggers.Count()==2) { return KErrNone; @@ -1360,6 +1428,11 @@ User::LeaveIfError( lbt.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -1439,6 +1512,7 @@ wait->Start( ); RArray Firedtriggers; lbt.GetFiredTriggersL(Firedtriggers); + RestoreProfileL(); if(Firedtriggers.Count()==2) { CleanupStack::PopAndDestroy( notifier ); @@ -1485,6 +1559,11 @@ iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -1567,6 +1646,7 @@ iLog->Log(_L("Trigger Fired")); RArray Firedtriggers; lbt.GetFiredTriggersL(Firedtriggers); + RestoreProfileL(); if(Firedtriggers.Count()==2) { CleanupStack::PopAndDestroy( notifier ); @@ -1611,6 +1691,10 @@ iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -1719,6 +1803,7 @@ RArray Firedtriggers; lbt.GetFiredTriggersL(Firedtriggers); + RestoreProfileL(); if(Firedtriggers.Count()==4) { CleanupStack::PopAndDestroy( notifier ); @@ -1762,6 +1847,11 @@ User::LeaveIfError( lbt.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -1832,7 +1922,7 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); - + RestoreProfileL(); if( FireInfo.iTriggerId==trigId) { @@ -1882,6 +1972,11 @@ User::LeaveIfError( lbt.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -1964,6 +2059,7 @@ TReal32 trigDistance; TPosition firePosition; FireInfo = notifier->GetFiredTrigger(); + RestoreProfileL(); if(FireInfo.iTriggerId!=trigId) { // notifier->StartNotification( wait ); @@ -2026,6 +2122,11 @@ User::LeaveIfError( lbt.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -2127,6 +2228,7 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); + RestoreProfileL(); if(FireInfo.iTriggerId ==trigIdtochange) { @@ -2178,6 +2280,11 @@ User::LeaveIfError( lbt1.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt1 ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -2281,7 +2388,7 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); - + RestoreProfileL(); if(FireInfo.iTriggerId ==trigIdtochange) { CleanupStack::PopAndDestroy( notifier ); @@ -2332,6 +2439,11 @@ User::LeaveIfError( lbt.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -2432,6 +2544,7 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); + RestoreProfileL(); if(FireInfo.iTriggerId ==trigIdtochange) { CleanupStack::PopAndDestroy( notifier ); @@ -2480,6 +2593,11 @@ User::LeaveIfError( lbt.Open(lbtserver)); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -2583,6 +2701,7 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); + RestoreProfileL(); if( trigDistance>=1000) { _LIT(KProcessToSearch, "About"); @@ -2648,6 +2767,11 @@ User::LeaveIfError( lbt.Open( lbtserver ) ); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -2732,6 +2856,7 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); + RestoreProfileL(); if( trigDistance<=1000 &¬ifier->iTriggerFireCount ==2) { CleanupStack::PopAndDestroy( notifier ); @@ -2776,6 +2901,11 @@ User::LeaveIfError( lbt.Open( lbtserver ) ); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -2856,6 +2986,7 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); + RestoreProfileL(); if( trigDistance>=1000 &¬ifier->iTriggerFireCount ==2) { CleanupStack::PopAndDestroy( notifier ); @@ -2899,6 +3030,11 @@ User::LeaveIfError( lbt.Open( lbtserver ) ); iLog->Log(_L("Subsession opened ")); CleanupClosePushL( lbt ); + + // Set profile to offline mode.This is required to avoid movement detection blocking the + // trigger firing. + SetProfileToOfflineL(); + //Enable only simpsy EnableSimPSYL(); //Clear all triggers @@ -2978,6 +3114,7 @@ FireInfo = notifier->GetFiredTrigger(); FireInfo.iFiredPositionInfo.GetPosition(firePosition); firePosition.Distance(coordinate,trigDistance); + RestoreProfileL(); if( trigDistance<=1000 &¬ifier->iTriggerFireCount ==2) { CleanupStack::PopAndDestroy( notifier ); diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/conf/CellbasedtriggerOperations.cfg --- a/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/conf/CellbasedtriggerOperations.cfg Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/conf/CellbasedtriggerOperations.cfg Fri Jul 23 19:40:48 2010 +0530 @@ -286,6 +286,20 @@ foobar TC_LBT_034_56L delete foobar [Endtest] + +[Test] +title TC_LBT_034_61L +create CellbasedtriggerOperations foobar +foobar TC_LBT_034_61L +delete foobar +[Endtest] +[Test] +title TC_LBT_034_62L +create CellbasedtriggerOperations foobar +foobar TC_LBT_034_62L +delete foobar +[Endtest] + [Test] title TC_LBT_034_69L create CellbasedtriggerOperations foobar diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/inc/AsynOperationAO.h --- a/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/inc/AsynOperationAO.h Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/inc/AsynOperationAO.h Fri Jul 23 19:40:48 2010 +0530 @@ -139,7 +139,8 @@ */ static CLbtEventObserver* NewL( RLbt& aLbt ); - + static CLbtEventObserver* NewL(); + /** * Destructor. */ @@ -162,7 +163,8 @@ void HandleCIDChangeL(const CTelephony::TNetworkInfoV1 &aNwInfo); void StartCidNotification( CActiveSchedulerWait* aWait ); - + void GetCurrentCGIInfo( CTelephony::TNetworkInfoV1& aNwInfo, + CActiveSchedulerWait* aWait); private: @@ -170,18 +172,23 @@ /** * C++ default constructor. */ - CLbtEventObserver( ); + CLbtEventObserver(); /** * By default Symbian 2nd phase constructor is private. */ void ConstructL( RLbt& aLbt ); + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + private: CLbtCidChangeNotifier* iCidchangenotifier; CActiveSchedulerWait* iWait; - + CTelephony::TNetworkInfoV1* iNetWorkInfo; diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/inc/CellbasedtriggerOperations.h --- a/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/inc/CellbasedtriggerOperations.h Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/inc/CellbasedtriggerOperations.h Fri Jul 23 19:40:48 2010 +0530 @@ -27,8 +27,8 @@ #include #include #include - - +#include +#include // CONSTANTS //const ?type ?constant_var = ?constant; @@ -138,6 +138,13 @@ * @since ?Series60_version */ void Delete(); + + /** + * Gets current cell information + */ + void GetCurrentCellInfoL( + RMobilePhone::TMobilePhoneNetworkMode& aNetworkMode, + CTelephony::TNetworkInfoV1& aNwInfo ); /** * Test methods are listed below. diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/inc/lbtcidchangenotifier.h --- a/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/inc/lbtcidchangenotifier.h Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/inc/lbtcidchangenotifier.h Fri Jul 23 19:40:48 2010 +0530 @@ -43,6 +43,14 @@ */ NONSHARABLE_CLASS( CLbtCidChangeNotifier ) : public CActive { + enum TState + { + ENone, + + ECurrentNetwork, + + ENotifyNetworkChange + }; public: /** @@ -56,7 +64,12 @@ ~CLbtCidChangeNotifier(); public: - + + /** + * + */ + void GetCurrentCGIInfo(); + /** * Initiates a request for notification after the specified time interval * has elapsed @@ -92,6 +105,8 @@ MLbtCidChangeObsrvr *iObs; + + TState iState; }; #endif // C_LBTSTRATEGYTIMER_H diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/src/AsynOperationAO.cpp --- a/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/src/AsynOperationAO.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/src/AsynOperationAO.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -286,6 +286,17 @@ } // ----------------------------------------------------------------------------- +// CTriggerFireObserver::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CLbtEventObserver::ConstructL() + { + RFileLogger aLog; + iCidchangenotifier=CLbtCidChangeNotifier::NewL(aLog,this); + } + +// ----------------------------------------------------------------------------- // CTriggerFireObserver::NewL // Two-phased constructor. // ----------------------------------------------------------------------------- @@ -304,6 +315,19 @@ } + +// ----------------------------------------------------------------------------- +// CTriggerFireObserver::NewL +// ----------------------------------------------------------------------------- +CLbtEventObserver* CLbtEventObserver::NewL() + { + CLbtEventObserver* self = new (ELeave) CLbtEventObserver(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + // Destructor CLbtEventObserver::~CLbtEventObserver() { @@ -352,6 +376,14 @@ SetActive( ); } +void CLbtEventObserver::GetCurrentCGIInfo( CTelephony::TNetworkInfoV1& aNwInfo, + CActiveSchedulerWait* aWait ) + { + iWait=aWait; + iNetWorkInfo = &aNwInfo; + iCidchangenotifier->GetCurrentCGIInfo(); + } + void CLbtEventObserver::HandleCIDChangeL(const CTelephony::TNetworkInfoV1 &aNwInfo) { @@ -360,12 +392,20 @@ // RFileLogger::WriteFormat(KLbtTraceDir, KLbtTraceFile, EFileLoggingModeAppend,_L( "Network id = %s"),aNwInfo.iNetworkId); // RFileLogger::WriteFormat(KLbtTraceDir, KLbtTraceFile, EFileLoggingModeAppend,_L( "Location Area code= %d"),aNwInfo.iLocationAreaCode); RFileLogger::WriteFormat(KLbtTraceDir, KLbtTraceFile, EFileLoggingModeAppend,_L( "Cell Id= %d"),aNwInfo.iCellId); - + if( iNetWorkInfo ) + { + iNetWorkInfo->iMode = aNwInfo.iMode; + iNetWorkInfo->iCountryCode = aNwInfo.iCountryCode; + iNetWorkInfo->iNetworkId = aNwInfo.iNetworkId; + iNetWorkInfo->iLocationAreaCode = aNwInfo.iLocationAreaCode; + iNetWorkInfo->iCellId = aNwInfo.iCellId; + iWait->AsyncStop( ); + } } void CLbtEventObserver::StartCidNotification( CActiveSchedulerWait* aWait ) { - + iNetWorkInfo = NULL; iWait=aWait; iCidchangenotifier->Start(); } diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/src/CellbasedtriggerOperationsBlocks.cpp --- a/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/src/CellbasedtriggerOperationsBlocks.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/src/CellbasedtriggerOperationsBlocks.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -139,6 +139,42 @@ } + +// ----------------------------------------------------------------------------- +// CCellbasedtriggerOperations::GetCurrentCellInfo +// ----------------------------------------------------------------------------- +void CCellbasedtriggerOperations::GetCurrentCellInfoL( + RMobilePhone::TMobilePhoneNetworkMode& aNetworkMode, + CTelephony::TNetworkInfoV1& aNwInfo ) + { + iLog->Log(_L("+GetCurrentCellInfoL")); + CLbtEventObserver* notifier= CLbtEventObserver::NewL(); + CleanupStack::PushL( notifier ); + CActiveSchedulerWait* wait = new( ELeave ) CActiveSchedulerWait; + // Ownership of wait is taken by notifier + iLog->Log(_L("+GetCurrentCGIInfo")); + notifier->GetCurrentCGIInfo( aNwInfo,wait ); + iLog->Log(_L("-GetCurrentCGIInfo")); + wait->Start(); + iLog->Log(_L("WaitStart")); + switch( aNwInfo.iMode ) + { + case CTelephony::ENetworkModeGsm: + aNetworkMode = RMobilePhone::ENetworkModeGsm; + break; + + case CTelephony::ENetworkModeWcdma: + aNetworkMode = RMobilePhone::ENetworkModeWcdma; + break; + + default: + aNetworkMode = RMobilePhone::ENetworkModeUnknown; + } + + CleanupStack::PopAndDestroy( notifier ); + iLog->Log(_L("-GetCurrentCellInfoL")); + } + // ----------------------------------------------------------------------------- // CCellbasedtriggerOperations::RunMethodL // Run specified method. Contains also table of test mothods and their names. @@ -6067,24 +6103,23 @@ // set condition - CActiveSchedulerWait* wait=new(ELeave)CActiveSchedulerWait; - CActiveSchedulerWait* wait2=new(ELeave)CActiveSchedulerWait; + CActiveSchedulerWait* wait=new(ELeave)CActiveSchedulerWait; + CActiveSchedulerWait* wait2=new(ELeave)CActiveSchedulerWait; CLbtEventObserver* notifier= CLbtEventObserver::NewL( lbt); CleanupStack::PushL( notifier ); CTriggerFireObserver* notifier2= CTriggerFireObserver::NewL( lbt); CleanupStack::PushL( notifier2 ); - TBuf<4> Networkcountrycode = _L("404"); - TBuf<8> Networkidentitycode = _L("45"); - TUint Locationareacode = 1627; - TUint CellId = 11681; - - CLbtGeoCell* Cellarea = CLbtGeoCell::NewL(RMobilePhone :: ENetworkModeGsm, - Networkcountrycode, - Networkidentitycode, - Locationareacode, - CellId - ); + + RMobilePhone::TMobilePhoneNetworkMode networkMode; + CTelephony::TNetworkInfoV1 nwInfo; + GetCurrentCellInfoL( networkMode,nwInfo ); + + CLbtGeoCell* Cellarea = CLbtGeoCell::NewL( networkMode, + nwInfo.iCountryCode, + nwInfo.iNetworkId, + nwInfo.iLocationAreaCode, + nwInfo.iCellId ); // ownership of Cellarea object transferred to the condition object @@ -6100,14 +6135,12 @@ trig->SetRequestorL(ReqType,ReqFormat,ReqData); TLbtTriggerId trigId; - notifier->CreateTriggers( lbt,*trig,trigId,EFalse,wait ); + notifier->CreateTriggers( lbt,*trig,trigId,ETrue,wait ); wait->Start( ); - iLog->Log(_L("Trigger Created")); - notifier->StartCidNotification(wait); iLog->Log(_L("Cell id change notification requested")); notifier2->StartNotification( wait2 ); - wait2->Start( ); + wait2->Start( ); iLog->Log(_L("Trigger Fired")); notifier->Cancel(); @@ -6130,7 +6163,7 @@ { CLbtGeoCell* cell=NULL; cell= static_cast (area); - if(cell->CellId()==CellId) + if(cell->CellId()==nwInfo.iCellId) { CleanupStack::PopAndDestroy( Triginfo ); CleanupStack::PopAndDestroy( notifier2 ); @@ -6164,121 +6197,118 @@ //Firing of CGI based Cellular Session trigger TInt CCellbasedtriggerOperations::TC_LBT_034_62_testL( CStifItemParser& /* aItem */ ) { - - RLbtServer lbtserver; - RLbt lbt; - iLog->Log(_L("Before connecting")); - User::LeaveIfError( lbtserver.Connect() ); - CleanupClosePushL( lbtserver ); - iLog->Log(_L("Connection to RLbtServer Passed ")); - User::LeaveIfError( lbt.Open(lbtserver)); - iLog->Log(_L("Subsession opened ")); - CleanupClosePushL( lbt ); - - - //Construct a startup trigger - CLbtSessionTrigger* trig = CLbtSessionTrigger::NewL(); - - //Push to cleanup stack - CleanupStack::PushL( trig ); - iLog->Log(_L("Startup Trigger Entry Created ")); - - // Set Name - trig->SetNameL(_L("Trigger1")); - - - // set condition - - CActiveSchedulerWait* wait=new(ELeave)CActiveSchedulerWait; - CActiveSchedulerWait* wait2=new(ELeave)CActiveSchedulerWait; - CLbtEventObserver* notifier= CLbtEventObserver::NewL( lbt); - CleanupStack::PushL( notifier ); - CTriggerFireObserver* notifier2= CTriggerFireObserver::NewL( lbt); - CleanupStack::PushL( notifier2 ); - - TBuf<4> Networkcountrycode = _L("404"); - TBuf<8> Networkidentitycode = _L("45"); - TUint Locationareacode = 1627; - TUint CellId = 11681; - - CLbtGeoCell* Cellarea = CLbtGeoCell::NewL(RMobilePhone :: ENetworkModeGsm, - Networkcountrycode, - Networkidentitycode, - Locationareacode, - CellId - ); - - - // ownership of Cellarea object transferred to the condition object - CLbtTriggerConditionArea* condition=CLbtTriggerConditionArea::NewL( - Cellarea, - CLbtTriggerConditionArea::EFireOnEnter); - - trig->SetCondition(condition); // ownership transferred to object - - //set Requestor - CRequestorBase::TRequestorType ReqType=CRequestorBase::ERequestorUnknown; - CRequestorBase::_TRequestorFormat ReqFormat=CRequestorBase::EFormatUnknown; - TBuf ReqData=_L(""); - trig->SetRequestorL(ReqType,ReqFormat,ReqData); - TLbtTriggerId trigId; + + RLbtServer lbtserver; + RLbt lbt; + iLog->Log(_L("Before connecting")); + User::LeaveIfError( lbtserver.Connect() ); + CleanupClosePushL( lbtserver ); + iLog->Log(_L("Connection to RLbtServer Passed ")); + User::LeaveIfError( lbt.Open(lbtserver)); + iLog->Log(_L("Subsession opened ")); + CleanupClosePushL( lbt ); + + + //Construct a startup trigger + CLbtSessionTrigger* trig = CLbtSessionTrigger::NewL(); + + //Push to cleanup stack + CleanupStack::PushL( trig ); + iLog->Log(_L("Session Trigger Entry Created ")); + + // Set Name + trig->SetNameL(_L("Trigger1")); + // set condition + + CActiveSchedulerWait* wait=new(ELeave)CActiveSchedulerWait; + CActiveSchedulerWait* wait2=new(ELeave)CActiveSchedulerWait; + CLbtEventObserver* notifier= CLbtEventObserver::NewL( lbt); + CleanupStack::PushL( notifier ); + CTriggerFireObserver* notifier2= CTriggerFireObserver::NewL( lbt); + CleanupStack::PushL( notifier2 ); + + + RMobilePhone::TMobilePhoneNetworkMode networkMode; + CTelephony::TNetworkInfoV1 nwInfo; + GetCurrentCellInfoL( networkMode,nwInfo ); + + CLbtGeoCell* Cellarea = CLbtGeoCell::NewL( networkMode, + nwInfo.iCountryCode, + nwInfo.iNetworkId, + nwInfo.iLocationAreaCode, + nwInfo.iCellId ); + + + // ownership of Cellarea object transferred to the condition object + CLbtTriggerConditionArea* condition=CLbtTriggerConditionArea::NewL( + Cellarea, + CLbtTriggerConditionArea::EFireOnEnter); - notifier->CreateTriggers( lbt,*trig,trigId,EFalse,wait ); - wait->Start( ); - - iLog->Log(_L("Trigger Created")); - notifier->StartCidNotification(wait); - iLog->Log(_L("Cell id change notification requested")); - notifier2->StartNotification( wait2 ); - wait2->Start( ); - iLog->Log(_L("Trigger Fired")); - - notifier->Cancel(); - TLbtTriggerFireInfo FireInfo; - FireInfo = notifier2->GetFiredTrigger(); - - CLbtTriggerInfo *Triginfo; - iLog->Log(_L("Before GetTriggerLC ")); - - Triginfo = lbt.GetTriggerLC(FireInfo.iTriggerId); - CLbtTriggerEntry *TrigEntry = Triginfo->TriggerEntry(); - - //Check Condition of the trigger - CLbtTriggerConditionArea* Condition2 = static_cast (TrigEntry->GetCondition()); - - CLbtGeoAreaBase* area = Condition2->TriggerArea(); - - if(area->Type()==CLbtGeoAreaBase::ECellular) - { - CLbtGeoCell* cell=NULL; - cell= static_cast (area); - if(cell->CellId()==CellId) - { - CleanupStack::PopAndDestroy( Triginfo ); - CleanupStack::PopAndDestroy( notifier2 ); - CleanupStack::PopAndDestroy( notifier ); - CleanupStack::PopAndDestroy( trig ); - CleanupStack::Pop( &lbt ); - CleanupStack::PopAndDestroy( &lbtserver ); - //delete wait; - //delete wait2; - return KErrNone; - } - else - { - CleanupStack::PopAndDestroy( Triginfo ); - CleanupStack::PopAndDestroy( notifier2 ); - CleanupStack::PopAndDestroy( notifier ); - CleanupStack::PopAndDestroy( trig ); - CleanupStack::Pop( &lbt ); - CleanupStack::PopAndDestroy( &lbtserver ); - //delete wait; - //delete wait2; - return -99; - } - } - return KErrNone; - } + trig->SetCondition(condition); // ownership transferred to object + //set Requestor + CRequestorBase::TRequestorType ReqType=CRequestorBase::ERequestorUnknown; + CRequestorBase::_TRequestorFormat ReqFormat=CRequestorBase::EFormatUnknown; + TBuf ReqData=_L(""); + trig->SetRequestorL(ReqType,ReqFormat,ReqData); + TLbtTriggerId trigId; + + notifier->CreateTriggers( lbt,*trig,trigId,ETrue,wait ); + wait->Start( ); + + notifier2->StartNotification( wait2 ); + wait2->Start( ); + iLog->Log(_L("Trigger Fired")); + + notifier->Cancel(); + TLbtTriggerFireInfo FireInfo; + FireInfo = notifier2->GetFiredTrigger(); + + CLbtTriggerInfo *Triginfo; + iLog->Log(_L("Before GetTriggerLC ")); + + Triginfo = lbt.GetTriggerLC(FireInfo.iTriggerId); + //Triginfo = lbt.GetTriggerLC(trigId); + CLbtTriggerEntry *TrigEntry = Triginfo->TriggerEntry(); + + //Check Condition of the trigger + CLbtTriggerConditionArea* Condition2 = static_cast (TrigEntry->GetCondition()); + + CLbtGeoAreaBase* area = Condition2->TriggerArea(); + + if(area->Type()==CLbtGeoAreaBase::ECellular) + { + CLbtGeoCell* cell=NULL; + cell= static_cast (area); + if(cell->CellId()==nwInfo.iCellId) + { + CleanupStack::PopAndDestroy( Triginfo ); + CleanupStack::PopAndDestroy( notifier2 ); + CleanupStack::PopAndDestroy( notifier ); + CleanupStack::PopAndDestroy( trig ); + CleanupStack::Pop( &lbt ); + CleanupStack::PopAndDestroy( &lbtserver ); + // //delete wait; + // //delete wait2; + return KErrNone; + } + else + { + CleanupStack::PopAndDestroy( Triginfo ); + CleanupStack::PopAndDestroy( notifier2 ); + CleanupStack::PopAndDestroy( notifier ); + CleanupStack::PopAndDestroy( trig ); + CleanupStack::Pop( &lbt ); + CleanupStack::PopAndDestroy( &lbtserver ); + // //delete wait; + // //delete wait2; + return -99; + } + } + + + return KErrNone; + + } //Test case to check hysteresis condition for cell based triggers TInt CCellbasedtriggerOperations::TC_LBT_034_65_testL( CStifItemParser& /* aItem */ ) diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/src/lbtcidchangenotifier.cpp --- a/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/src/lbtcidchangenotifier.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/CellbasedtriggerOperations/src/lbtcidchangenotifier.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -50,21 +50,48 @@ //Make Async call iTelephony->NotifyChange(iStatus, CTelephony::ECurrentNetworkInfoChange, iNwInfoPckg); - + iState = ENotifyNetworkChange; } + +void CLbtCidChangeNotifier::GetCurrentCGIInfo() + { + //iStatus = KRequestPending; + if(IsActive()) + { + return; + } + + iTelephony->GetCurrentNetworkInfo(iStatus, iNwInfoPckg); + SetActive(); + iState = ECurrentNetwork; + } + void CLbtCidChangeNotifier::DoCancel() { - //Cancel Async call -// RFileLogger::WriteFormat(KLbtTraceDir, KLbtTraceFile, EFileLoggingModeAppend,_L( "DoCancel before CancelAsync")); - iTelephony->CancelAsync(CTelephony::ECurrentNetworkInfoChangeCancel); -// RFileLogger::WriteFormat(KLbtTraceDir, KLbtTraceFile, EFileLoggingModeAppend,_L( "DoCancel After CancelAsync")); + switch( iState ) + { + case ECurrentNetwork: + iTelephony->CancelAsync(CTelephony::EGetCurrentNetworkInfoCancel); + iState = ENone; + break; + + case ENotifyNetworkChange: + iTelephony->CancelAsync(CTelephony::ECurrentNetworkInfoChangeCancel); + iState = ENone; + break; + + default: + break; + } } + CLbtCidChangeNotifier::CLbtCidChangeNotifier(RFileLogger &aLog, MLbtCidChangeObsrvr *aObs) : CActive( EPriorityStandard ), iNwInfoPckg(iNwInfo), iLog(aLog), - iObs(aObs) + iObs(aObs), + iState( ENone ) { CActiveScheduler::Add( this ); @@ -73,14 +100,25 @@ { //Construct Async Object iTelephony = CTelephony::NewL(); - } void CLbtCidChangeNotifier::RunL() { - //iLog.Write(_L("CLbtCidChangeNotifier::RunL")); - iObs->HandleCIDChangeL(iNwInfo); - Start(); + switch( iState ) + { + case ECurrentNetwork: + iObs->HandleCIDChangeL(iNwInfo); + iState = ENone; + break; + + case ENotifyNetworkChange: + iObs->HandleCIDChangeL(iNwInfo); + Start(); + break; + + default: + break; + } } diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/TestHybridTriggers/conf/TestHybridTriggers.cfg --- a/locationtriggering/tsrc/lbtengine_test/TestHybridTriggers/conf/TestHybridTriggers.cfg Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/TestHybridTriggers/conf/TestHybridTriggers.cfg Fri Jul 23 19:40:48 2010 +0530 @@ -580,7 +580,7 @@ foobar TC_TestUpdateTrigger6L delete foobar [Endtest] -/* + [Test] title TC_TestHybridTriggerFiring1L create TestHybridTriggers foobar @@ -593,6 +593,8 @@ foobar TC_TestHybridTriggerFiring2L delete foobar [Endtest] + +/* [Test] title StartCellChangeNotifierL create TestHybridTriggers foobar diff -r 1a92308afc46 -r e175e2ba2fb0 locationtriggering/tsrc/lbtengine_test/TestHybridTriggers/src/TestHybridTriggersBlocks.cpp --- a/locationtriggering/tsrc/lbtengine_test/TestHybridTriggers/src/TestHybridTriggersBlocks.cpp Fri Jul 09 20:18:03 2010 +0530 +++ b/locationtriggering/tsrc/lbtengine_test/TestHybridTriggers/src/TestHybridTriggersBlocks.cpp Fri Jul 23 19:40:48 2010 +0530 @@ -6523,7 +6523,7 @@ CleanupStack::PushL( notifier ); - notifier->CreateTriggers( lbt,*trig,trigId,EFalse,wait ); + notifier->CreateTriggers( lbt,*trig,trigId,ETrue,wait ); wait->Start( ); iLog->Log(_L("Trigger Created")); notifier->StartNotification( wait );